/* ============================================
   KarA BelA · Estilos Completos
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --accent:        #D4447B;
    --accent-dark:   #B8376A;
    --income:        #27AE60;
    --income-bg:     #E8F5E9;
    --expense:       #E74C3C;
    --expense-bg:    #FFEBEE;
    --transfer:      #2980B9;
    --transfer-bg:   #E3F2FD;
    --bg:            #F4F4F6;
    --surface:       #FFFFFF;
    --border:        #E8E8ED;
    --text-primary:  #1A1A2E;
    --text-secondary:#6B7280;
    --text-muted:    #9CA3AF;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:     0 8px 32px rgba(0,0,0,0.14);
    --radius:        14px;
    --radius-sm:     8px;
    --sidebar-w:     272px;
    --header-h:      62px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* ─────────────────────────────────────────
   LOGIN SCREEN
───────────────────────────────────────── */
.login-screen {
    position: fixed;
    inset: 0;
    background: var(--text-primary);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-card {
    background: #1e1e30;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
    padding: 38px 32px;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.55);
}

.login-logo {
    font-size: 34px;
    color: var(--accent);
    text-align: center;
}

.login-brand-name {
    display: block;
    font-size: 21px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    letter-spacing: -0.5px;
    margin-top: -6px;
}

.login-brand-sub {
    display: block;
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    margin-bottom: 4px;
}

.login-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-align: center;
}

.login-card .form-label { color: rgba(255,255,255,0.45); }

.login-card .form-input {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: #fff;
}

.login-card .form-input:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.09);
    box-shadow: 0 0 0 3px rgba(212,68,123,0.2);
}

.login-card .form-input::placeholder { color: rgba(255,255,255,0.2); }

.login-error {
    font-size: 12px;
    color: #ff8a8a;
    text-align: center;
    min-height: 14px;
}

.login-toggle {
    font-size: 13px;
    color: rgba(255,255,255,0.38);
    text-align: center;
}

.login-toggle a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.login-toggle a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────
   HEADER
───────────────────────────────────────── */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: #ffffff;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 10px rgba(0,0,0,0.06);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    max-width: 1440px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent) 0%, #9B2760 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
}

.brand-text { display: flex; flex-direction: column; gap: 1px; }

.brand-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.brand-sub {
    font-size: 9.5px;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.balance-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.balance-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    font-variant-numeric: tabular-nums;
    transition: color 0.2s;
}

.balance-amount.negative { color: var(--expense); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-arqueo {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 33px;
    padding: 0 13px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-arqueo:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 9px;
}

.user-avatar {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-details { display: flex; flex-direction: column; gap: 1px; }

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-link {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: color 0.14s;
    line-height: 1;
}

.user-link:hover { color: var(--accent); }

.user-link-sep {
    font-size: 10px;
    color: var(--border);
    user-select: none;
    line-height: 1;
}

/* ─────────────────────────────────────────
   LAYOUT
───────────────────────────────────────── */
.layout {
    display: flex;
    min-height: calc(100vh - var(--header-h));
    margin-top: var(--header-h);
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
}

/* ─────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 2px;
}

.panel-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
}

.btn-icon-round {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.btn-icon-round.active,
.btn-icon-round:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: rotate(45deg);
}

/* Add wallet form */
.add-wallet-form {
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    overflow: hidden;
    max-height: 0;
    padding: 0 12px;
    opacity: 0;
    flex-shrink: 0;
    transition: max-height 0.32s ease, opacity 0.22s ease, padding 0.28s ease;
}

.add-wallet-form.open {
    max-height: 380px;
    padding: 14px 12px;
    opacity: 1;
}

.color-picker { display: flex; gap: 7px; flex-wrap: wrap; }

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    background-color: var(--c);
    cursor: pointer;
    transition: transform 0.14s, box-shadow 0.14s;
    outline: none;
    padding: 0;
}

.color-swatch:hover { transform: scale(1.18); }

.color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2.5px var(--c);
}

/* Wallets list */
.wallets-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}

.wallet-card {
    border-radius: var(--radius-sm);
    padding: 11px 12px 11px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wallet-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--wallet-color, var(--accent));
    border-radius: 2px 0 0 2px;
}

.wallet-card:hover {
    border-color: color-mix(in srgb, var(--wallet-color, var(--accent)) 55%, transparent);
    box-shadow: var(--shadow-sm);
}

.wallet-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wallet-name { font-weight: 600; font-size: 13px; }

.wallet-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    padding: 0 2px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.14s, color 0.14s;
}

.wallet-card:hover .wallet-delete-btn { opacity: 1; }
.wallet-delete-btn:hover { color: var(--expense); }

.wallet-balance {
    font-size: 18px;
    font-weight: 700;
    margin-top: 5px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
    transition: color 0.2s;
}

.wallet-balance.negative { color: var(--expense); }
.wallet-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.no-wallets {
    text-align: center;
    padding: 28px 8px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.8;
}

/* ─────────────────────────────────────────
   MAIN / CARDS
───────────────────────────────────────── */
.main {
    flex: 1;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    color: var(--text-muted);
    gap: 16px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 18px;
    letter-spacing: -0.2px;
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.card-header-row .card-title { margin-bottom: 0; }

/* ─────────────────────────────────────────
   FORMS
───────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.form-span-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212,68,123,0.12);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input-sm { height: 34px; font-size: 13px; padding: 0 10px; }

select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239CA3AF' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 30px;
    cursor: pointer;
}

.form-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

/* ─────────────────────────────────────────
   BUTTONS
───────────────────────────────────────── */
.btn-primary {
    height: 40px;
    padding: 0 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: 0 4px 12px rgba(212,68,123,0.28);
}

.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-full { width: 100%; }

.btn-secondary {
    height: 38px;
    padding: 0 20px;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-secondary:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.btn-danger {
    height: 38px;
    padding: 0 20px;
    background: var(--expense);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-danger:hover { background: #c0392b; }

.btn-close-modal {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.14s;
    flex-shrink: 0;
}

.btn-close-modal:hover { color: var(--text-primary); }

/* ─────────────────────────────────────────
   HISTORY TABLE
───────────────────────────────────────── */
.history-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 780px;
}

.history-table thead {
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 1;
}

.history-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.55px;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.history-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.history-table tbody tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover { background: rgba(0,0,0,0.016); }

.text-right { text-align: right; }

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.type-badge.income   { background: var(--income-bg);   color: var(--income); }
.type-badge.expense  { background: var(--expense-bg);  color: var(--expense); }
.type-badge.transfer { background: var(--transfer-bg); color: var(--transfer); }

.amount-cell {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.amount-cell.income   { color: var(--income); }
.amount-cell.expense  { color: var(--expense); }
.amount-cell.transfer { color: var(--transfer); }

.wallet-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    white-space: nowrap;
}

.wallet-arrow { color: var(--text-muted); margin: 0 2px; font-size: 11px; }

.wallet-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.balance-cell {
    font-variant-numeric: tabular-nums;
    font-size: 12.5px;
    white-space: nowrap;
}

.balance-cell.negative { color: var(--expense); }
.balance-cell.positive { color: var(--text-secondary); }

.registered-by {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.btn-delete-row {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 15px;
    line-height: 1;
    transition: color 0.13s, background 0.13s;
    opacity: 0;
}

tr:hover .btn-delete-row { opacity: 1; }
.btn-delete-row:hover { color: var(--expense); background: var(--expense-bg); }

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 52px 24px;
    color: var(--text-muted);
    text-align: center;
    gap: 7px;
}

.empty-state.visible { display: flex; }
.empty-icon { font-size: 34px; opacity: 0.2; margin-bottom: 6px; }
.empty-state p { font-weight: 500; color: var(--text-secondary); font-size: 14px; }
.empty-state span { font-size: 12px; }

/* ─────────────────────────────────────────
   TOAST
───────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 22px;
    right: 22px;
    background: var(--text-primary);
    color: #fff;
    padding: 11px 17px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    transform: translateY(70px);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
    z-index: 1000;
    max-width: 320px;
    pointer-events: none;
    border-left: 3px solid var(--accent);
}

.toast.show   { transform: translateY(0); opacity: 1; }
.toast.success { border-left-color: var(--income); }
.toast.error   { border-left-color: var(--expense); }
.toast.info    { border-left-color: var(--transfer); }

/* ─────────────────────────────────────────
   MODAL BASE
───────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10,10,20,0.52);
    backdrop-filter: blur(3px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-backdrop.open { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px 28px;
    max-width: 360px;
    width: 100%;
    box-shadow: var(--shadow-md);
    text-align: center;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { transform: scale(0.94) translateY(8px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);   opacity: 1; }
}

.modal-icon   { font-size: 26px; color: var(--expense); margin-bottom: 10px; }
.modal-title  { font-size: 16px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.2px; }
.modal-msg    { font-size: 13px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ─────────────────────────────────────────
   MODAL ARQUEO
───────────────────────────────────────── */
.modal-arqueo {
    max-width: 500px;
    padding: 0;
    text-align: left;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.arqueo-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.arqueo-wallet-bar {
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.arqueo-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.arqueo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.arqueo-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.arqueo-table th {
    padding: 8px 18px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.arqueo-table td {
    padding: 9px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.arqueo-table tbody tr:last-child td { border-bottom: none; }
.arqueo-table tbody tr:hover { background: rgba(0,0,0,0.018); }

.denom-label {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.denom-qty {
    width: 76px;
    height: 32px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 0 8px;
    font-family: inherit;
    font-size: 13px;
    text-align: center;
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    transition: border-color 0.13s;
}

.denom-qty:focus { border-color: var(--accent); }

.denom-subtotal {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
}

.arqueo-summary {
    padding: 15px 22px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex-shrink: 0;
}

.arqueo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.arqueo-row-diff {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.arqueo-val {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.arqueo-hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2px 0;
}

.arqueo-diff.cuadrado { color: var(--income); }
.arqueo-diff.faltante { color: var(--expense); }
.arqueo-diff.sobrante { color: var(--transfer); }

.arqueo-status-wrap {
    display: flex;
    justify-content: center;
    padding-top: 2px;
}

.arqueo-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.arqueo-badge.cuadrado { background: var(--income-bg);   color: var(--income); }
.arqueo-badge.faltante { background: var(--expense-bg);  color: var(--expense); }
.arqueo-badge.sobrante { background: var(--transfer-bg); color: var(--transfer); }
.arqueo-badge.pending  { background: var(--border); color: var(--text-muted); font-weight: 500; }

/* ─────────────────────────────────────────
   SCROLLBAR
───────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 900px) {
    .layout { flex-direction: column; }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 16px;
    }

    .wallets-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }

    .main { padding: 16px; }
    .form-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    /* Header: scroll horizontal en móvil para que se vean todos los botones */
    .header-inner {
        padding: 0 12px;
        gap: 12px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .header-inner::-webkit-scrollbar { display: none; }
    .brand, .header-center, .header-actions { flex-shrink: 0; }
    .header-center { min-width: 0; }

    .main-logo { height: 36px; }
    .balance-amount { font-size: 17px; }
    .btn-arqueo span { display: none; }
    .user-details { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .card-header-row { flex-direction: column; align-items: flex-start; }
    .history-filters { flex-direction: column; width: 100%; }
    .history-filters .form-input { width: 100%; }
    .modal-actions { flex-direction: column; }
    .btn-secondary, .btn-danger { width: 100%; }
}

/* ─────────────────────────────────────────
   LOGO PRINCIPAL
───────────────────────────────────────── */
.main-logo {
    height: 46px;
    max-height: 46px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
}

/* ─────────────────────────────────────────
   PASSWORD TOGGLE (OJO)
───────────────────────────────────────── */
.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap .form-input {
    padding-right: 46px;
}

.btn-eye {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.28);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 0;
}

.btn-eye:hover { color: rgba(255,255,255,0.75); }

/* ─────────────────────────────────────────
   MODAL PERFIL
───────────────────────────────────────── */
.modal-profile {
    max-width: 420px;
    text-align: left;
}

.modal-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.modal-header-inner .modal-title { margin-bottom: 0; }

.profile-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.profile-email {
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.4;
}

.profile-error {
    font-size: 12px;
    color: var(--expense);
    min-height: 14px;
    margin-top: 4px;
}

/* ─────────────────────────────────────────
   BOTÓN ADMIN (Gestión de Usuarios)
───────────────────────────────────────── */
.btn-admin {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 33px;
    padding: 0 13px;
    background: transparent;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-admin:hover {
    background: var(--accent);
    color: #fff;
}

/* ─────────────────────────────────────────
   MODAL GESTIÓN DE USUARIAS
───────────────────────────────────────── */
.modal-gestion {
    max-width: 660px;
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 28px 28px 24px;
}

.gestion-section {
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    margin-bottom: 16px;
}

.gestion-section:last-child { margin-bottom: 0; }

.gestion-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 14px;
}

.gestion-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.gestion-section-list .gestion-table-wrap {
    max-height: 220px;
    overflow-y: auto;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.gestion-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.gestion-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg);
    padding: 9px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}

.gestion-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.gestion-table tbody tr:last-child { border-bottom: none; }
.gestion-table tbody tr:hover { background: var(--bg); }

.gestion-table td {
    padding: 9px 12px;
    vertical-align: middle;
    color: var(--text-primary);
}

.gestion-td-name  { font-weight: 500; white-space: nowrap; }
.gestion-td-email { color: var(--text-secondary); word-break: break-all; }
.gestion-td-date  { white-space: nowrap; color: var(--text-muted); font-size: 12px; }
.gestion-td-action { text-align: right; white-space: nowrap; }

.btn-revoke-user {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    background: transparent;
    border: 1.5px solid var(--expense);
    border-radius: 6px;
    color: var(--expense);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-revoke-user:hover {
    background: var(--expense);
    color: #fff;
}

.gestion-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.gestion-nota-info {
    margin-top: 10px;
    padding: 10px 12px;
    background: #FFF8E1;
    border: 1.5px solid #FFE082;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    color: #795500;
    line-height: 1.55;
}

.gestion-nota-link {
    color: #795500;
    font-weight: 600;
    text-decoration: underline;
}

.gestion-nota-link:hover { color: #5c3d00; }

@media (max-width: 640px) {
    .gestion-form-grid { grid-template-columns: 1fr; }
    .modal-gestion { max-width: 100%; padding: 20px 16px; }
    .gestion-td-email { display: none; }
}

/* ═════════════════════════════════════════
   MÓDULO CURSOS DE AUTOMAQUILLAJE
═════════════════════════════════════════ */

/* ── Botón Cursos en header (variante del btn-arqueo) ── */
.btn-cursos {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-cursos:hover {
    background: var(--accent);
    color: #fff;
}

/* ── Modal cursos (grande, ocupa casi toda la pantalla) ── */
.modal-cursos {
    max-width: 1100px;
    width: 100%;
    height: 92vh;
    max-height: 92vh;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cursos-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.cursos-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Sidebar de cursos ── */
.cursos-sidebar {
    border-right: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.cursos-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.cursos-sidebar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.curso-add-form {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: none;
    flex-direction: column;
    gap: 11px;
    flex-shrink: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.curso-add-form.open { display: flex; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.cursos-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* ── Tarjeta de curso en sidebar ── */
.curso-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    margin-bottom: 7px;
    cursor: pointer;
    transition: border-color 0.13s, box-shadow 0.13s, transform 0.08s;
    position: relative;
}

.curso-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.curso-card.active {
    border-color: var(--accent);
    background: rgba(212, 68, 123, 0.05);
    box-shadow: 0 0 0 2px rgba(212, 68, 123, 0.12);
}

.curso-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.curso-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}

.curso-card-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 7px;
    overflow: hidden;
}

.curso-card-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s;
}

.curso-card-progress-fill.full { background: var(--income); }

.curso-card-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.curso-card-status.abierto   { background: var(--income-bg); color: var(--income); }
.curso-card-status.completo  { background: rgba(212, 68, 123, 0.12); color: var(--accent-dark); }
.curso-card-status.finalizado{ background: var(--border); color: var(--text-muted); }

/* ── Panel de detalle ── */
.curso-detail {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--surface);
}

.curso-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    gap: 6px;
    padding: 40px 20px;
}

.curso-empty-icon {
    font-size: 38px;
    opacity: 0.18;
    color: var(--accent);
    margin-bottom: 6px;
}

.curso-empty p {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.curso-empty span { font-size: 12px; }

.curso-empty-sm {
    padding: 28px 16px;
    flex: none;
}

.curso-empty-sm .curso-empty-icon { font-size: 28px; }

.curso-detail-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.curso-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 12px;
}

.curso-detail-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.curso-detail-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.curso-detail-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.curso-detail-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-icon-soft {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    width: 30px;
    height: 30px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.13s;
    padding: 0;
}

.btn-icon-soft:hover {
    background: var(--bg);
    color: var(--accent);
    border-color: var(--accent);
}

.btn-icon-soft.btn-icon-danger:hover {
    color: var(--expense);
    border-color: var(--expense);
    background: var(--expense-bg);
}

/* ── Stats ── */
.curso-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.curso-stat {
    background: var(--surface);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.curso-stat-label {
    display: block;
    font-size: 10.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    font-weight: 500;
}

.curso-stat-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.curso-stat-val.curso-stat-pending { color: var(--expense); }

/* ── Tabs ── */
.curso-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    flex-shrink: 0;
    gap: 4px;
}

.curso-tab {
    background: transparent;
    border: none;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.13s, border-color 0.13s;
    margin-bottom: -1px;
}

.curso-tab:hover { color: var(--text-primary); }

.curso-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.curso-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px 24px;
    min-height: 0;
}

.curso-tab-content.active { display: block; }

.curso-section-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 7px 13px;
    font-size: 12.5px;
    height: auto;
    line-height: 1.3;
}

/* ── Tabla de participantes ── */
.participantes-table-wrap, .pagos-table-wrap { width: 100%; }

.participantes-table, .pagos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.participantes-table thead th,
.pagos-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 9px 10px;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}

.participantes-table tbody td,
.pagos-table tbody td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.participantes-table tbody tr:hover,
.pagos-table tbody tr:hover {
    background: var(--bg);
}

.text-right { text-align: right; }
.participantes-table .text-right,
.pagos-table .text-right { text-align: right; }

.part-name {
    font-weight: 600;
    color: var(--text-primary);
}

.part-contact {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.35;
}

.part-contact-line {
    display: block;
}

.part-turno-cell {
    min-width: 130px;
}

.part-turno-select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 5px;
    font-size: 12px;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
}

.part-turno-select:hover { border-color: var(--accent); }

.part-precio-original {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 11px;
    display: block;
}

.part-precio-final {
    font-weight: 600;
    color: var(--text-primary);
}

.part-descuento-badge {
    display: inline-block;
    background: rgba(212, 68, 123, 0.1);
    color: var(--accent-dark);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
    cursor: help;
}

.part-estado {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.part-estado.pendiente { background: var(--expense-bg); color: var(--expense); }
.part-estado.parcial   { background: #FFF3CD;          color: #997404; }
.part-estado.completo  { background: var(--income-bg); color: var(--income); }

.part-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.13s;
}

.participantes-table tbody tr:hover .part-actions,
.pagos-table tbody tr:hover .part-actions { opacity: 1; }

/* En el Banco de Profesionales, las acciones siempre visibles */
.banco-table .part-actions { opacity: 1; }

.btn-row-pago {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 4px 9px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.13s;
    white-space: nowrap;
}

.btn-row-pago:hover { background: var(--accent-dark); }

.btn-row-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.13s, background 0.13s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-row-icon:hover { color: var(--accent); background: var(--bg); }
.btn-row-icon.danger:hover { color: var(--expense); background: var(--expense-bg); }

/* ── Lista de turnos ── */
.turnos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.turno-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 14px 12px;
    position: relative;
    transition: border-color 0.13s, box-shadow 0.13s;
}

.turno-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.turno-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.turno-card-name {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary);
}

.turno-card-actions { display: flex; gap: 3px; }

.turno-card-info {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.turno-card-info-line {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
}

.turno-card-cupo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.turno-card-cupo-text {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.turno-card-cupo-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

.turno-card-cupo-num.full { color: var(--income); }

.turno-card-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.turno-card-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s;
}

.turno-card-bar-fill.full { background: var(--income); }

/* ── Tabla de pagos ── */
.pago-tipo-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 3px;
    text-transform: capitalize;
}

.pago-tipo-badge.seña    { background: #FFF3CD;          color: #997404; }
.pago-tipo-badge.parcial { background: var(--transfer-bg); color: var(--transfer); }
.pago-tipo-badge.total   { background: var(--income-bg); color: var(--income); }

.pago-metodo {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.pago-wallet-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

/* ── Modal form (genérico) ── */
.modal-form {
    max-width: 480px;
    width: 100%;
    text-align: left;
    padding: 24px 24px 22px;
}

.modal-form-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.modal-form-body textarea.form-input {
    resize: vertical;
    min-height: 50px;
    font-family: inherit;
    line-height: 1.4;
}

.pago-info-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.pago-info-card strong { color: var(--text-primary); font-weight: 600; }

.pago-info-row {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
}

.pago-info-row:first-child { margin-top: 0; }

.pago-info-row .pago-info-val { font-weight: 600; color: var(--text-primary); }
.pago-info-row .pago-info-val.pending { color: var(--expense); }

/* ── Cierre de modales (×) ── */
.btn-close-modal {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.13s, color 0.13s;
    padding: 0;
    flex-shrink: 0;
}

.btn-close-modal:hover { background: var(--bg); color: var(--text-primary); }

/* ── Responsive ── */
@media (max-width: 900px) {
    .modal-cursos {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }
    .cursos-layout { grid-template-columns: 1fr; }
    .cursos-sidebar {
        max-height: 38vh;
        border-right: none;
        border-bottom: 1.5px solid var(--border);
    }
    .curso-stats { grid-template-columns: repeat(2, 1fr); padding: 12px; }
    .curso-detail-header { padding: 14px 16px; }
    .curso-tabs { padding: 0 12px; overflow-x: auto; }
    .curso-tab-content { padding: 14px 16px 20px; }
    .form-row { grid-template-columns: 1fr; }
    .turnos-list { grid-template-columns: 1fr; }

    /* Tablas con scroll horizontal en móvil */
    .participantes-table-wrap, .pagos-table-wrap {
        overflow-x: auto;
        margin: 0 -16px;
        padding: 0 16px;
    }
    .participantes-table, .pagos-table { min-width: 640px; }
}

@media (max-width: 640px) {
    .btn-cursos span { display: none; }
    .curso-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .curso-stat { padding: 8px 10px; }
    .curso-stat-val { font-size: 13px; }
    .modal-form { padding: 20px 18px; }
}

/* ═════════════════════════════════════════
   SELECT CON BOTÓN "+" INLINE
═════════════════════════════════════════ */
.select-with-add {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.select-with-add select {
    flex: 1;
    min-width: 0;
}

.btn-add-inline {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 1.5px solid var(--accent);
    background: transparent;
    color: var(--accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}

.btn-add-inline:hover {
    background: var(--accent);
    color: #fff;
}

/* Color picker dentro del modal de billetera (un poco más espaciado) */
#walletModalColorPicker {
    gap: 9px;
    padding: 4px 0;
}

#walletModalColorPicker .color-swatch {
    width: 26px;
    height: 26px;
}

/* ═════════════════════════════════════════
   BANCO DE PROFESIONALES
═════════════════════════════════════════ */

/* ── Botón footer en sidebar de cursos ── */
.cursos-sidebar-footer-btn {
    margin: 8px;
    padding: 10px 12px;
    background: transparent;
    border: 1.5px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.cursos-sidebar-footer-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* ── Modal del banco ── */
.modal-banco {
    max-width: 820px;
    width: 100%;
    height: 80vh;
    max-height: 80vh;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-banco .modal-header-inner {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    flex-shrink: 0;
}

.banco-actions {
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.banco-table-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 0 22px 18px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.banco-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.banco-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 10px;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 1;
}

.banco-table tbody td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.banco-table tbody tr:hover { background: var(--bg); }

.prof-name {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.prof-notas-snippet {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
    font-style: italic;
}

.prof-contact {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.prof-contact-line { display: block; }

.prof-instagram {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.prof-instagram:hover { text-decoration: underline; }

/* ── Lista de profesionales asignadas a un curso ── */
.profesionales-list-curso {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.curso-prof-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    align-items: center;
    transition: border-color 0.13s, box-shadow 0.13s;
}

.curso-prof-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.curso-prof-info {
    min-width: 0;
}

.curso-prof-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
    letter-spacing: -0.1px;
}

.curso-prof-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.curso-prof-meta-item::before {
    content: "•";
    margin-right: 5px;
    opacity: 0.4;
}

.curso-prof-meta-item:first-child::before { content: ""; margin: 0; }

.curso-prof-comp {
    text-align: right;
    min-width: 120px;
}

.curso-prof-comp-label {
    font-size: 10.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-bottom: 2px;
}

.curso-prof-comp-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-dark);
    letter-spacing: -0.2px;
}

.curso-prof-comp-tipo {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.curso-prof-comp-detail {
    font-size: 11.5px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 2px;
    max-width: 160px;
    word-wrap: break-word;
}

.curso-prof-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Badge de tipo de compensación */
.comp-tipo-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.comp-tipo-badge.porcentaje { background: rgba(212, 68, 123, 0.12); color: var(--accent-dark); }
.comp-tipo-badge.fijo       { background: var(--transfer-bg);     color: var(--transfer); }
.comp-tipo-badge.convenio   { background: #FFF3CD;                color: #997404; }
.comp-tipo-badge.ninguna    { background: var(--border);          color: var(--text-muted); }

/* ── Resumen de compensaciones ── */
.prof-resumen {
    margin-top: 22px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
}

.prof-resumen-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.prof-resumen-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.prof-resumen-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px dashed var(--border);
}

.prof-resumen-row:last-child { border-bottom: none; }

.prof-resumen-row-name { font-weight: 500; color: var(--text-primary); }
.prof-resumen-row-val  { font-weight: 600; }
.prof-resumen-row-val.muted { color: var(--text-muted); font-style: italic; font-weight: 500; }

.prof-resumen-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 6px;
    border-top: 1.5px solid var(--border);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.prof-resumen-total-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--expense);
}

.prof-resumen-neto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.prof-resumen-neto-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--income);
}

.prof-resumen-neto-val.negative { color: var(--expense); }

/* ── Responsive ── */
@media (max-width: 900px) {
    .modal-banco {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }
    .banco-table { min-width: 600px; }
    .banco-table-wrap { overflow-x: auto; }

    .curso-prof-card {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .curso-prof-comp { text-align: left; }
    .curso-prof-actions { justify-content: flex-end; }
}

/* ═════════════════════════════════════════
   Z-INDEX: Modal de confirmación SIEMPRE arriba
   ═════════════════════════════════════════ */
/* El modal genérico de "¿Eliminar?" debe quedar por encima de cualquier
   otro modal abierto (Cursos, Banco, Asignar Profesional, etc.) */
#modalBackdrop {
    z-index: 900;
}

/* ═════════════════════════════════════════
   PANEL ECONÓMICO DEL CURSO
═════════════════════════════════════════ */
.curso-economico {
    margin: 0 24px 12px;
    background: linear-gradient(135deg, #fafafd 0%, #f5f5fa 100%);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    flex-shrink: 0;
}

.economico-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
}

.economico-title {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.economico-actual {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.economico-actual.positivo  { background: var(--income-bg);  color: var(--income); }
.economico-actual.negativo  { background: var(--expense-bg); color: var(--expense); }
.economico-actual.equilibrio{ background: var(--border);     color: var(--text-muted); }

.economico-rows {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 6px;
}

.economico-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    color: var(--text-secondary);
    padding: 2px 0;
}

.economico-row.total {
    border-top: 1.5px solid var(--border);
    padding-top: 7px;
    margin-top: 3px;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 13.5px;
}

.economico-val {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.economico-val.positive  { color: var(--income); }
.economico-val.negative  { color: var(--expense); }
.economico-val.total-val { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; }
.economico-val.total-val.positive { color: var(--income); }
.economico-val.total-val.negative { color: var(--expense); }
.economico-val.total-val.zero     { color: var(--text-muted); }

.eco-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(212, 68, 123, 0.12);
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-left: 4px;
    vertical-align: middle;
}

.economico-proyeccion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0 0;
    border-top: 1px dashed var(--border);
    font-size: 11.5px;
    margin-top: 3px;
}

.economico-proyeccion-label {
    color: var(--text-muted);
    font-style: italic;
}

.economico-proyeccion-val {
    font-weight: 700;
    color: var(--accent-dark);
    font-variant-numeric: tabular-nums;
}

/* ── Toggle compacto/expandido del panel ── */
.economico-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    transition: background 0.13s, color 0.13s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.economico-toggle:hover {
    background: var(--border);
    color: var(--text-primary);
}

.economico-toggle svg {
    transition: transform 0.2s;
}

.curso-economico.collapsed .economico-toggle svg {
    transform: rotate(-90deg);
}

.curso-economico.collapsed .economico-rows,
.curso-economico.collapsed .economico-proyeccion {
    display: none;
}

.curso-economico.collapsed .economico-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Resumen rápido cuando está colapsado */
.economico-summary-collapsed {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-left: 12px;
}

.curso-economico.collapsed .economico-summary-collapsed { display: flex; }

.eco-summary-label { color: var(--text-muted); font-size: 11px; }
.eco-summary-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.eco-summary-val.positive { color: var(--income); }
.eco-summary-val.negative { color: var(--expense); }
.eco-summary-val.zero     { color: var(--text-muted); }

/* ═════════════════════════════════════════
   TAB GASTOS
═════════════════════════════════════════ */
.gastos-table-wrap { width: 100%; }

.gastos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.gastos-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 9px 10px;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}

.gastos-table tbody td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.gastos-table tbody tr:hover { background: var(--bg); }

.gastos-table .text-right { text-align: right; }

.gasto-concepto {
    font-weight: 600;
    color: var(--text-primary);
}

.gasto-notas-snippet {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
    font-style: italic;
}

/* Badge de categoría de gasto */
.cat-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: capitalize;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.cat-badge.alquiler   { background: #FFF3CD;            color: #997404; }
.cat-badge.catering   { background: var(--income-bg);   color: var(--income); }
.cat-badge.materiales { background: var(--transfer-bg); color: var(--transfer); }
.cat-badge.transporte { background: #FFE0E0;            color: #B71C1C; }
.cat-badge.marketing  { background: rgba(212, 68, 123, 0.12); color: var(--accent-dark); }
.cat-badge.otros      { background: var(--border);      color: var(--text-secondary); }

.gasto-monto {
    font-weight: 700;
    color: var(--expense);
    font-variant-numeric: tabular-nums;
}

/* Caja de honorarios pendientes */
.honorarios-pendientes {
    margin-top: 26px;
    padding: 16px 18px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
}

.honorarios-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}

.honorario-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}

.honorario-row:last-child { border-bottom: none; }

.honorario-info { min-width: 0; }

.honorario-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13.5px;
    margin-bottom: 2px;
}

.honorario-tipo {
    font-size: 11.5px;
    color: var(--text-muted);
}

.honorario-monto {
    font-weight: 700;
    color: var(--accent-dark);
    font-size: 14px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    min-width: 100px;
}

.honorario-monto-pagado {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.honorario-status {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}

.honorario-status.pendiente { background: var(--expense-bg); color: var(--expense); }
.honorario-status.parcial   { background: #FFF3CD; color: #997404; }
.honorario-status.pagado    { background: var(--income-bg); color: var(--income); }
.honorario-status.cubierto  { background: var(--border); color: var(--text-muted); }

.btn-pagar-prof {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.13s;
    white-space: nowrap;
}

.btn-pagar-prof:hover  { background: var(--accent-dark); }
.btn-pagar-prof:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }

@media (max-width: 768px) {
    .curso-economico { margin: 0 16px 12px; padding: 14px; }
    .gastos-table-wrap, .pagos-table-wrap, .participantes-table-wrap {
        overflow-x: auto;
    }
    .gastos-table, .pagos-table, .participantes-table { min-width: 640px; }
    .honorario-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .honorario-monto { text-align: left; }
}

/* ═════════════════════════════════════════
   PARTICIPANTE: FILA EXPANDIBLE CON DETALLE DE PAGOS
═════════════════════════════════════════ */
.part-row {
    cursor: pointer;
    transition: background 0.13s;
}

.part-row:hover { background: var(--bg); }

.part-row.expanded {
    background: rgba(212, 68, 123, 0.04);
}

.part-row.expanded:hover {
    background: rgba(212, 68, 123, 0.06);
}

.part-name-wrap {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.part-expand-arrow {
    flex-shrink: 0;
    margin-top: 4px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.part-row.expanded .part-expand-arrow {
    transform: rotate(90deg);
    color: var(--accent);
}

/* Fila de detalle (acordeón) */
.part-detail-row td {
    padding: 0 !important;
    background: linear-gradient(180deg, rgba(212, 68, 123, 0.025) 0%, transparent 100%);
}

.part-detail-box {
    margin: 0 12px 14px;
    background: var(--surface);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(212, 68, 123, 0.08);
    animation: detailSlideIn 0.2s ease;
}

@keyframes detailSlideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.part-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}

.part-detail-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.part-detail-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 18px 0;
    font-size: 13px;
    font-style: italic;
}

/* Tabla de pagos dentro del detalle */
.part-pagos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    margin-bottom: 12px;
}

.part-pagos-table thead th {
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.part-pagos-table tbody td {
    padding: 8px;
    border-bottom: 1px dashed var(--border);
    vertical-align: middle;
}

.part-pagos-table tbody tr:last-child td { border-bottom: none; }
.part-pagos-table tbody tr:hover { background: var(--bg); }
.part-pagos-table .text-right { text-align: right; }

/* Resumen del detalle */
.part-detail-summary {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 8px;
}

.part-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.part-summary-row.total {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-val {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.summary-val.positive { color: var(--income); }
.summary-val.pending  { color: var(--expense); }
.summary-val.zero     { color: var(--text-muted); }

/* Breakdown por método de pago */
.metodo-breakdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 11.5px;
}

.metodo-breakdown-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    font-size: 10.5px;
}

.metodo-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.metodo-chip-label {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.metodo-chip-val {
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 768px) {
    .part-detail-box { margin: 0 4px 10px; padding: 12px; }
    .part-pagos-table { font-size: 11.5px; }
    .part-pagos-table tbody td { padding: 6px; }
    .part-detail-header { flex-wrap: wrap; }
}

/* ═════════════════════════════════════════
   STATS DENTRO DE LA CARD DEL CURSO ACTIVO (SIDEBAR)
═════════════════════════════════════════ */
.curso-card-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    animation: fadeInStats 0.25s ease;
}

@keyframes fadeInStats {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.curso-card-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    line-height: 1.3;
}

.curso-card-stat-label {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 10px;
}

.curso-card-stat-val {
    font-weight: 700;
    font-size: 12.5px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.2px;
}

.curso-card-stat-val.positive { color: var(--income); }
.curso-card-stat-val.pending  { color: var(--expense); }
.curso-card-stat-val.zero     { color: var(--text-muted); }

/* ═════════════════════════════════════════
   BUSCADOR Y FILTROS DE PARTICIPANTES
═════════════════════════════════════════ */
.part-filters-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.part-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
}

.part-search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    pointer-events: none;
}

.part-search-input {
    width: 100%;
    height: 34px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 30px 0 32px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.part-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212,68,123,0.12);
}

.part-search-input::placeholder { color: var(--text-muted); }

.part-search-clear {
    position: absolute;
    right: 6px;
    background: var(--border);
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.13s;
}

.part-search-clear:hover {
    background: var(--text-muted);
    color: #fff;
}

.part-filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.part-filter-chip {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.13s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.part-filter-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.part-filter-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 17px;
    padding: 0 5px;
    background: rgba(0,0,0,0.08);
    border-radius: 9px;
    font-size: 10.5px;
    font-weight: 700;
}

.part-filter-chip.active .chip-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.part-filter-turno {
    height: 34px !important;
    font-size: 13px !important;
    width: auto;
    min-width: 140px;
}

@media (max-width: 768px) {
    .part-filters-bar { flex-direction: column; align-items: stretch; }
    .part-search-wrap { width: 100%; }
    .part-filter-chips { width: 100%; }
    .part-filter-chip { flex: 1; justify-content: center; }
    .part-filter-turno { width: 100%; }
}

/* ═════════════════════════════════════════
   MODAL COBRAR (Registrar Cobro)
═════════════════════════════════════════ */
.cobrar-info-card {
    background: var(--bg);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-secondary);
    animation: detailSlideIn 0.2s ease;
}

.cobrar-info-card strong { color: var(--text-primary); font-weight: 600; }

.cobrar-info-card .pago-info-row {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
}

.cobrar-info-card .pago-info-row:first-child { margin-top: 0; }
.cobrar-info-card .pago-info-val { font-weight: 600; color: var(--text-primary); }
.cobrar-info-card .pago-info-val.pending { color: var(--expense); }

/* Opción deshabilitada (pagada) */
#cobrarParticipanteId option:disabled {
    color: var(--text-muted);
    font-style: italic;
}
