/**
 * EggLedger Classy UI — v3.59 final refinement layer (after premium.css)
 */

/* ——— Layout rhythm ——— */
.content-area {
    padding: 20px 24px 32px;
}

.main-content {
    background: linear-gradient(180deg, #f6f9f6 0%, #f4f6f4 120px, transparent 320px);
}

/* ——— Cards & panels ——— */
.card-panel,
.card.card-panel {
    border-radius: var(--radius-lg, 14px);
    border: 1px solid rgba(30, 70, 32, 0.07);
    box-shadow: var(--shadow-premium, 0 8px 24px rgba(15, 45, 16, 0.06));
    overflow: hidden;
}

.card-panel .card-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(30, 70, 32, 0.06);
    background: linear-gradient(180deg, #fafcfa 0%, #fff 100%);
}

.card-panel .card-header h2,
.card-panel .card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--premium-ink, #1a2e1b);
}

.card-panel .card-body {
    padding: 16px 18px 18px;
}

/* ——— Dashboard stats ——— */
.stats-grid {
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-premium-lg, 0 20px 40px rgba(15, 45, 16, 0.08));
}

.stat-card .stat-value {
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* ——— Quick start & onboarding ——— */
.quick-start-card {
    position: relative;
    border: 1px solid rgba(201, 162, 39, 0.35);
    background: linear-gradient(165deg, #fffef8 0%, #ffffff 55%, #f8fcf8 100%);
    box-shadow: var(--shadow-premium-lg);
    overflow: hidden;
}

.quick-start-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1e4620, var(--premium-gold, #c9a227), #1e4620);
}

.quick-start-num {
    background: linear-gradient(145deg, #1e4620, #2e7d32);
    box-shadow: 0 2px 8px rgba(30, 70, 32, 0.25);
}

.welcome-te-hint {
    color: #6d5a12;
    font-size: 0.86rem;
    font-style: normal;
    line-height: 1.45;
    padding: 6px 10px;
    margin: 6px 0 0;
    background: rgba(201, 162, 39, 0.1);
    border-left: 3px solid var(--premium-gold, #c9a227);
    border-radius: 0 8px 8px 0;
}

/* ——— Welcome modal ——— */
.welcome-modal {
    border: 1px solid rgba(201, 162, 39, 0.25);
    border-radius: var(--radius-xl, 18px);
}

.welcome-modal .card-header {
    background: linear-gradient(135deg, #0f2d10 0%, #1e4620 100%);
    color: #fff;
    border: none;
}

.welcome-modal .card-header h2 {
    color: #fff;
}

.welcome-modal .card-header .welcome-te-hint {
    background: rgba(255, 255, 255, 0.12);
    border-left-color: var(--premium-gold, #c9a227);
    color: rgba(255, 255, 255, 0.92);
}

.welcome-modal-backdrop {
    backdrop-filter: blur(4px);
}

/* ——— Settings hub ——— */
.settings-hub-grid {
    gap: 16px;
}

.settings-hub-card {
    border: 1px solid rgba(30, 70, 32, 0.08);
    border-radius: var(--radius-lg, 14px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    text-decoration: none;
}

.settings-hub-card:hover {
    transform: translateY(-3px);
    border-color: rgba(201, 162, 39, 0.45);
    box-shadow: var(--shadow-premium-lg);
}

.settings-hub-icon {
    background: linear-gradient(145deg, #eef5ee, #fff);
    border: 1px solid #dce8dc;
    color: #1e4620;
    font-size: 0.8rem;
}

.settings-hub-intro {
    font-size: 0.95rem;
    color: var(--premium-muted, #6b7c6c);
}

/* ——— Money / collections sheet ——— */
.pay-sheet-wrap {
    border-radius: var(--radius-lg, 14px);
    border: 1px solid rgba(30, 70, 32, 0.1);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
}

.pay-sheet-title {
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(180deg, #f4faf4 0%, #eef5ee 100%);
    border-bottom: 1px solid #dce8dc;
}

.pay-sheet-action-panel {
    border-radius: 12px;
    border-color: rgba(46, 125, 50, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.pay-sheet-action-due-value {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.pay-sheet-actions .btn-success,
.pay-easy-submit.btn-success {
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.28);
}

.pay-sheet-tools--footer {
    margin-top: 16px;
    padding: 10px 14px;
    background: #f8faf8;
    border: 1px solid #e8efe8;
    border-radius: 999px;
    justify-content: center;
    gap: 6px 14px;
}

.pay-sheet-tools--footer a {
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    color: #1b5e20;
}

.pay-sheet-tools--footer a:hover {
    color: #0d3d0f;
    text-decoration: underline;
}

/* ——— Report heroes ——— */
.pl-report-hero {
    position: relative;
    overflow: hidden;
}

.pl-report-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--premium-gold, #c9a227), transparent);
    opacity: 0.75;
    pointer-events: none;
}

.pl-report-card {
    border-radius: var(--radius-lg, 14px);
    border: 1px solid rgba(30, 70, 32, 0.07);
    box-shadow: var(--shadow-premium);
}

/* ——— Tables ——— */
.sheet-grid-table thead th,
.data-table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
    background: linear-gradient(180deg, #f8faf8 0%, #f1f5f1 100%);
    border-bottom: 2px solid #dce8dc;
}

.sheet-grid-table tbody tr:hover td {
    background: #fafdfa;
}

/* ——— Alerts ——— */
.alert-banner {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-premium);
}

.go-live-banner.compact {
    border-radius: 12px;
}

/* ——— Sidebar money guide link ——— */
.sidebar-nav a.nav-item[href*='collections/help'] {
    margin-top: 4px;
    font-size: 0.88rem;
    opacity: 0.92;
}

.sidebar-nav a.nav-item[href*='collections/help'] .nav-icon {
    font-weight: 700;
    font-size: 0.95rem;
}

/* ——— Buttons ——— */
.btn {
    border-radius: 9px;
    font-weight: 600;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    box-shadow: 0 2px 6px rgba(30, 70, 32, 0.2);
}

/* ——— Money help ——— */
.money-help-box {
    border-radius: 10px;
    border-color: #c5ddf8;
}

.money-guide-page .money-guide-section .card-header {
    background: linear-gradient(180deg, #fafcfa, #fff);
}

/* ——— Mobile cards ——— */
.party-outstanding-card {
    box-shadow: var(--shadow-premium);
    transition: box-shadow 0.15s ease;
}

.party-outstanding-card:hover {
    box-shadow: var(--shadow-premium-lg);
}

.dash-admin-shortcut {
    border-radius: 12px;
    border: 1px solid rgba(30, 70, 32, 0.08);
    box-shadow: var(--shadow-premium);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-admin-shortcut:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-premium-lg);
}

.dash-admin-shortcut--owner {
    border-color: rgba(201, 162, 39, 0.35);
    background: linear-gradient(165deg, #fffef8, #fff);
}

/* ——— Login / public auth ——— */
.up-auth-card {
    border: 1px solid rgba(201, 162, 39, 0.22);
    box-shadow: 0 24px 48px rgba(10, 15, 13, 0.14);
    overflow: hidden;
}

.up-auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1e4620, var(--up-gold, #c9a227), #1e4620);
    z-index: 1;
}

.up-auth-body .welcome-te-hint {
    margin: -4px 0 14px;
    text-align: left;
}

.up-auth-body .btn-login-submit {
    letter-spacing: 0.03em;
}

/* ——— Payment receipt slip ——— */
.pay-receipt-slip {
    position: relative;
    border-radius: var(--radius-lg, 14px);
    border: 1px solid rgba(30, 70, 32, 0.12);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
}

.pay-receipt-slip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e4620, var(--premium-gold, #c9a227), #1e4620);
}

.pay-receipt-head {
    border-bottom: 2px solid rgba(30, 70, 32, 0.18);
    padding-bottom: 14px;
}

.pay-receipt-head h2 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.pay-clarity-box--receipt {
    background: linear-gradient(180deg, #f8faf8, #f4f8f4);
    border: 1px solid #dce8dc;
    border-radius: 10px;
    padding: 10px 14px;
    margin: 14px 0;
}

.pay-clarity-row--highlight {
    border-bottom: none;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px dashed rgba(30, 70, 32, 0.2);
}

.pay-receipt-thanks {
    color: #475569;
    font-weight: 500;
}

/* ——— List pages ——— */
.party-outstanding-row--due .party-payable-col {
    background: rgba(251, 191, 36, 0.1);
}

.party-payable-badge {
    font-size: 0.92rem;
    font-weight: 700;
    padding: 5px 10px;
}

.party-outstanding-tab {
    border-radius: 999px;
    transition: box-shadow 0.15s ease, background 0.15s ease;
}

.party-outstanding-tab.active {
    box-shadow: 0 2px 8px rgba(30, 70, 32, 0.18);
}

.filter-chips .chip.active {
    box-shadow: 0 1px 4px rgba(30, 70, 32, 0.15);
}

.empty-state,
.sheet-empty-state {
    border-radius: 12px;
    background: linear-gradient(180deg, #fafcfa 0%, #fff 100%);
    border: 1px dashed rgba(30, 70, 32, 0.12);
}

.sheet-empty-icon {
    font-size: 2.2rem;
    opacity: 0.85;
}

/* ——— Transaction view, slips & invoices ——— */
.txn-toolbar {
    border-radius: 12px;
    border: 1px solid rgba(30, 70, 32, 0.08);
    box-shadow: var(--shadow-premium);
    background: linear-gradient(180deg, #fafcfa 0%, #fff 100%);
    margin-bottom: 16px;
}

.txn-view-hero {
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-premium-lg);
    margin-bottom: 14px;
}

.txn-view-chips {
    gap: 10px;
    margin-bottom: 16px;
}

.txn-chip {
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(15, 45, 16, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.txn-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 45, 16, 0.08);
}

.txn-chip--due {
    border-color: rgba(251, 191, 36, 0.45);
}

.party-account-card {
    border-radius: var(--radius-lg, 14px);
    border: 1px solid rgba(30, 70, 32, 0.08);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
}

.party-account-card .card-header {
    background: linear-gradient(180deg, #fafcfa, #fff);
}

.party-account-row--payable {
    background: rgba(251, 191, 36, 0.1);
    border-radius: 8px;
    margin: 4px 0;
    padding: 8px 10px;
}

.party-account-stat--payable {
    border-color: rgba(201, 162, 39, 0.35);
    background: linear-gradient(165deg, #fffef8, #fff);
}

.pl-kpi-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pl-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-premium-lg);
}

.txn-slip-wrap .txn-slip-half {
    border-radius: 4px;
    box-shadow: 0 14px 36px rgba(15, 45, 16, 0.14);
}

.txn-view-page .welcome-te-hint {
    margin: 0 0 16px;
}

.invoice-print {
    border-radius: var(--radius-lg, 14px);
    border: 1px solid rgba(30, 70, 32, 0.1);
    box-shadow: var(--shadow-premium);
}

.pay-sheet-card {
    border-radius: var(--radius-lg, 14px);
    border: 1px solid rgba(30, 70, 32, 0.08);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
}

/* ——— Bill entry (sale / purchase add) ——— */
.txn-brain-hero {
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-premium-lg);
    margin-bottom: 16px;
}

.txn-brain-card {
    border-radius: 12px;
    border: 1px solid rgba(30, 70, 32, 0.08);
    box-shadow: var(--shadow-premium);
}

.txn-brain-section-title {
    letter-spacing: -0.02em;
}

.txn-brain-standard-chip {
    border-color: rgba(201, 162, 39, 0.35);
    background: rgba(255, 254, 248, 0.9);
}

.txn-qty-total-bar {
    border-radius: 10px;
    border: 1px solid rgba(46, 125, 50, 0.25);
    background: linear-gradient(180deg, #f4faf4, #eef5ee);
    font-weight: 600;
}

.txn-brain-calc {
    border-radius: 12px;
    border: 1px solid rgba(30, 70, 32, 0.1);
    box-shadow: var(--shadow-premium);
}

.txn-brain-actions {
    border-radius: 12px;
    background: #f8faf8;
    border: 1px solid #e8efe8;
    padding: 14px 16px;
}

.txn-view-card--payment {
    border-radius: var(--radius-lg, 14px);
    border: 1px solid rgba(30, 70, 32, 0.08);
    box-shadow: var(--shadow-premium);
}

.txn-view-card--payment .card-header {
    background: linear-gradient(180deg, #fafcfa, #fff);
}

.txn-payment-collect-link {
    text-align: center;
}

/* ——— Global shell polish ——— */
.top-header {
    box-shadow: 0 4px 20px rgba(15, 45, 16, 0.06);
}

.sidebar .nav-item.active {
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 3px 0 0 var(--premium-gold, #c9a227);
}

.sidebar .nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
}

.role-badge {
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* ——— Forms ——— */
.content-area .form-control:focus,
.up-auth-body .form-control:focus {
    border-color: rgba(46, 125, 50, 0.55);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.content-area select.form-control {
    cursor: pointer;
}

/* ——— Flash & banners ——— */
.content-area > .alert {
    border-radius: 10px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-premium);
    font-weight: 500;
}

.content-area > .alert-success {
    border-color: #a5d6a7;
    background: linear-gradient(180deg, #f1faf1, #e8f5e9);
}

.content-area > .alert-danger {
    border-color: #ef9a9a;
    background: linear-gradient(180deg, #fff5f5, #ffebee);
}

.alert-banner {
    backdrop-filter: blur(4px);
}

.alert-banner .btn {
    white-space: nowrap;
}

/* ——— Dashboard ——— */
.dash-hero-badge {
    border-color: rgba(201, 162, 39, 0.45);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.dashboard-grid {
    gap: 16px;
}

.dashboard-grid > .card {
    border-radius: var(--radius-lg, 14px);
    border: 1px solid rgba(30, 70, 32, 0.07);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
}

.dashboard-grid > .card > .card-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(30, 70, 32, 0.06);
    background: linear-gradient(180deg, #fafcfa 0%, #fff 100%);
}

.dashboard-grid > .card > .card-header h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-card .stat-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.dash-shortcut-badge {
    border-radius: 999px;
    font-weight: 700;
}

/* ——— Filters & chips ——— */
.pl-report-filter {
    border-radius: 12px;
    border: 1px solid rgba(30, 70, 32, 0.08);
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 45, 16, 0.04);
    padding: 14px 16px;
    margin-bottom: 14px;
}

.pl-preset-chip {
    border-radius: 999px;
    font-weight: 600;
    transition: box-shadow 0.15s ease, background 0.15s ease;
}

.pl-preset-chip.active {
    box-shadow: 0 2px 8px rgba(30, 70, 32, 0.18);
}

.filter-chips .chip {
    border-radius: 999px;
    font-weight: 600;
}

/* ——— Account bar & report heads ——— */
.pay-account-bar {
    border-radius: 12px;
    border: 1px solid rgba(30, 70, 32, 0.08);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
}

.pay-account-bar-item--payable {
    background: linear-gradient(165deg, #fffef8, #fff);
}

.pl-report-card-head {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(30, 70, 32, 0.06);
    background: linear-gradient(180deg, #fafcfa, #fff);
}

.pl-report-card-head h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ——— Badges & pagination ——— */
.badge {
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-warning {
    background: linear-gradient(180deg, #fff8e1, #ffecb3);
    color: #7c5a00;
    border: 1px solid rgba(201, 162, 39, 0.35);
}

.badge-success {
    border: 1px solid rgba(46, 125, 50, 0.25);
}

.erp-pagination {
    padding: 14px 4px;
    border-top: 1px solid rgba(30, 70, 32, 0.06);
    margin-top: 8px;
}

.erp-page-btn {
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.erp-page-btn:hover {
    background: #eef5ee;
    border-color: rgba(46, 125, 50, 0.35);
    color: #1b5e20;
}

/* ——— Qty presets (bill entry) ——— */
.txn-qty-preset {
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.txn-qty-preset:hover {
    box-shadow: 0 2px 6px rgba(30, 70, 32, 0.12);
}

.txn-qty-preset:active {
    transform: scale(0.97);
}

/* ——— Footer & finish ——— */
.footer {
    margin-top: 24px;
    padding: 14px 20px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
    border-top: 1px solid rgba(30, 70, 32, 0.08);
    background: linear-gradient(180deg, transparent, rgba(248, 250, 248, 0.9));
}

.footer p {
    margin: 0;
    letter-spacing: 0.02em;
}

@media print {
    .pay-receipt-slip {
        box-shadow: none;
        border: 1px solid #333;
        max-width: 100%;
    }

    .pay-receipt-slip::before {
        display: none;
    }

    .txn-slip-half {
        box-shadow: none;
    }

    .invoice-print {
        box-shadow: none;
        border: 1px solid #333;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .content-area {
        padding: 14px 12px 24px;
    }

    .pl-report-hero {
        padding: 18px 16px;
    }

    .pl-report-hero-title strong {
        font-size: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stat-card,
    .settings-hub-card,
    .btn,
    .txn-chip,
    .pl-kpi-card,
    .txn-qty-preset {
        transition: none;
    }

    .stat-card:hover,
    .settings-hub-card:hover,
    .txn-chip:hover,
    .pl-kpi-card:hover,
    .txn-qty-preset:active {
        transform: none;
    }
}
