/* ===================================
   Aplikasi Laporan Keuangan Multi Unit Usaha
   CSS Styling
   =================================== */

:root {
    --primary-color: #2563eb;
    --secondary-color: #475569;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --background-color: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===================================
   Header / Navigation
   =================================== */

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #ffffff;
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.6rem 1.25rem;
    color: #ffffff;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
}

/* ===================================
   Main Container & Layout
   =================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

main {
    padding-top: 1rem;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

body.locked .navbar,
body.locked main {
    display: none !important;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-secondary);
}

/* ===================================
   Grid System
   =================================== */

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
    gap: 1.5rem;
}

.col-lg-6 {
    flex: 1;
    min-width: 0;
    width: calc(50% - 0.75rem);
}

.col-lg-12 {
    flex: 1;
    min-width: 0;
    width: 100%;
}

@media (max-width: 768px) {
    .col-lg-6 {
        width: 100%;
    }
}

/* ===================================
   Stats Grid
   =================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-change {
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* ===================================
   Cards
   =================================== */

.card {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

.d-flex {
    display: flex;
    gap: 1rem;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* ===================================
   Forms
   =================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group.inline {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.875rem;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: #ffffff;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.w-100 {
    width: 100%;
}

/* ===================================
   Buttons
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-icon {
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-success {
    background: var(--success-color);
    color: #ffffff;
}

.btn-success:hover {
    background: #15803d;
}

.btn-danger {
    background: var(--danger-color);
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===================================
   Tables
   =================================== */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: #f8fafc;
}

.table tbody tr {
    transition: background 0.15s;
}

.table tbody tr:hover {
    background: #f1f5f9;
}

.table .positive {
    color: var(--success-color);
    font-weight: 600;
}

.table .negative {
    color: var(--danger-color);
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
}

.report-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.report-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.report-group {
    margin-bottom: 1.5rem;
}

.report-section {
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.section-header {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.report-table {
    width: 100%;
}

.report-table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: #e2e8f0;
}

.report-table td {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.report-table tr:last-child td {
    border-bottom: none;
}

.report-table .subtotal td {
    font-style: italic;
    background: #f1f5f9;
}

.report-table .total td {
    font-weight: 700;
    background: #e0e7ff;
    font-size: 1rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #e0e7ff;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 0.5rem;
    margin: 0 0 1.5rem 0;
}

/* Kartu Unit Laba / Unit Rugi di Dashboard */
.unit-pl-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.unit-pl-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.unit-pl-profit { border-left: 5px solid #2e9e6b; }
.unit-pl-loss { border-left: 5px solid #d64545; }

.unit-pl-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.unit-pl-icon { font-size: 1.5rem; }
.unit-pl-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color, #1e293b);
}

.unit-pl-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.9rem;
    font-weight: 800;
    margin-left: 0.25rem;
}
.unit-pl-loss .unit-pl-count { background: #ffebee; color: #c62828; }

.unit-pl-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.unit-pl-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.25rem;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.92rem;
}
.unit-pl-list li:last-child { border-bottom: none; }
.unit-pl-empty { color: var(--text-secondary, #64748b); justify-content: center; }

.unit-pl-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unit-pl-value { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Tabel perbandingan unit di Laporan */
.comparison-empty {
    color: var(--text-secondary, #64748b);
    padding: 0.5rem 0;
}

.comparison-table th, .comparison-table td { padding: 0.55rem 0.75rem; }
.comparison-table tbody tr:nth-child(even) { background: #f8fafc; }
.comparison-total { background: #e0e7ff !important; }

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.badge-profit { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.badge-loss { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

.comparison-note {
    margin-top: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-secondary, #64748b);
    text-align: right;
}

.unit-pl-shell {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.unit-pl-shell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.unit-pl-shell-head h3 {
    font-size: 1.05rem;
    color: #0f172a;
    margin: 0;
}

.unit-pl-shell .unit-pl-row {
    margin-bottom: 0;
}

.print-only-cards { display: none; }

.unit-pl-print-head {
    grid-column: 1 / -1;
}

@media print {
    body.print-cards .print-only-cards {
        display: block !important;
    }
    body.print-cards .unit-pl-row .report-company {
        display: flex !important;
        margin-bottom: 0.75rem;
    }
}

.unit-pl-print-title {
    text-align: center;
    margin-bottom: 0.75rem;
}

.unit-pl-print-title h2 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.unit-pl-print-title p {
    font-size: 0.9rem;
    color: #475569;
}

/* Laporan tersusun rapi vertikal ke bawah */
.report-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    scroll-margin-top: 1rem;
}

.report-status {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.report-status.loading {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.report-status.success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.report-status.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.report-status.error pre {
    margin: 0.5rem 0 0;
    white-space: pre-wrap;
    font-weight: 400;
    font-size: 0.8rem;
    color: #7f1d1d;
}

.report-stack > .col-lg-12 {
    width: 100%;
    flex: none;
}

.report-stack .card {
    width: 100%;
    overflow: visible;
}

.report-stack .report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-stack .report-table th,
.report-stack .report-table td {
    white-space: normal;
    word-wrap: break-word;
}

/* Card laporan tidak terpotong dan tabel bisa digulir di layar sempit */
.report-stack .card-body {
    overflow-x: auto;
}

.report-stack .report-table {
    min-width: 520px;
}

/* ===================================
   Alerts & Report Checkboxes
   =================================== */

.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-warning {
    background: #fff7ed;
    border-left: 4px solid var(--warning-color);
    color: #92400e;
}

.alert-success {
    background: #ecfdf5;
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.report-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.report-filters .form-group.inline {
    margin-bottom: 0;
}

/* ===================================
   Income Statement Profit Summary
   =================================== */

.profit-summary {
    border: 2px solid;
}

.profit-summary h3 {
    text-transform: uppercase;
}

/* ===================================
   Print Styles
   =================================== */

@media print {
    .no-print,
    .navbar,
    .page-header,
    .report-filters,
    .report-status,
    #btn-preview,
    button {
        display: none !important;
    }

    /* Ekspor PDF hanya memuat halaman Laporan Keuangan. */
    .page {
        display: none !important;
    }
    #page-reports {
        display: block !important;
    }
    /* Dua kartu pengaturan (filter & kop) tidak ikut tercetak. */
    #page-reports > .row {
        display: none !important;
    }

    .report-stack {
        max-width: none;
        gap: 0;
    }
    .card {
        box-shadow: none;
        border: 1px solid #cbd5e1;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    .card-body {
        padding: 0.5rem;
    }
    .report-table {
        min-width: 0;
        font-size: 11px;
    }
    .report-table th,
    .report-table td {
        padding: 3px 6px;
    }
    @page {
        margin: 1.2cm;
    }

    .card-header {
        background: #e2e8f0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
/* Mode cetak khusus "Perbandingan Per Unit Usaha": hanya kartu perbandingan yang tampil di kertas */
@media print {
    body.print-compare .page,
    body.print-compare #page-reports > .row,
    body.print-compare #report-content {
        display: none !important;
    }
    body.print-compare #page-reports {
        display: block !important;
    }
    body.print-compare #page-reports > .row.print-keep,
    body.print-compare #unit-comparison-card {
        display: block !important;
    }
    body.print-compare .comparison-table {
        min-width: 0;
        font-size: 12px;
    }
    body.print-compare .comparison-table th,
    body.print-compare .comparison-table td {
        padding: 4px 8px;
    }
    body.print-compare .status-badge {
        border: 1px solid #94a3b8;
        color: #0f172a !important;
        background: #e2e8f0 !important;
    }
}

/* Mode cetak khusus "Ringkasan Laba / Rugi per Unit": hanya kartu yang tampil */
@media print {
    body.print-cards .page {
        display: none !important;
    }
    body.print-cards #page-dashboard {
        display: block !important;
    }
    body.print-cards #page-dashboard > *:not(.unit-pl-shell) {
        display: none !important;
    }
    body.print-cards .unit-pl-shell {
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
    body.print-cards .unit-pl-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    body.print-cards .unit-pl-card {
        break-inside: avoid;
        box-shadow: none;
    }
}


.print-only {
    display: none;
}

/* ===================================
   Login Admin
   =================================== */

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #38bdf8 100%);
}

.login-screen[hidden] {
    display: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.45);
    padding: 2rem;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
}

.login-logo .logo-icon {
    font-size: 1.5rem;
}

.login-logo .logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.35rem 0 1.5rem;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.85rem;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
}

.login-hint {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.session-user {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.9;
    padding: 0 0.25rem;
}

.session-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    line-height: 1;
}

.session-btn::after {
    content: " \2699";
    font-size: 0.75rem;
}

.session-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    opacity: 1;
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.55);
}

.admin-modal-card {
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface-primary, #ffffff);
    border-radius: 0.75rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
    overflow: hidden;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    background: #0f172a;
    color: #ffffff;
}

.admin-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.admin-modal-body {
    padding: 1.25rem;
}

.admin-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.admin-msg {
    margin: 0 0 0.75rem 0;
    padding: 0.6rem 0.75rem;
    border-radius: 0.4rem;
    font-size: 0.88rem;
}

.admin-msg-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.admin-msg-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.data-transfer-card {
    margin-bottom: 1.5rem;
}

.data-transfer-card code {
    padding: 0.05rem 0.3rem;
    border-radius: 0.25rem;
    background: #f1f5f9;
    overflow-wrap: anywhere;
}

.data-transfer-help,
.data-transfer-note {
    color: var(--text-secondary);
    margin-bottom: 0.85rem;
}

.data-transfer-note {
    margin: 0.85rem 0 0;
    font-size: 0.85rem;
}

.data-transfer-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.data-transfer-controls .form-group {
    margin-bottom: 0.5rem;
}

.data-transfer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.data-transfer-status {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    background: #f8fafc;
    overflow-wrap: anywhere;
}

.data-transfer-status.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.data-transfer-status.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.data-transfer-status.warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.data-transfer-status.sync-active {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.data-transfer-status ul {
    margin: 0.5rem 0 0 1.25rem;
    max-height: 10rem;
    overflow: auto;
}

@media print {
    .login-screen,
    .session-user,
    .btn-secondary,
    .admin-modal {
        display: none !important;
    }
}


/* Responsive navigation for expanded menu */
@media (max-width: 1100px) {
    .navbar .container { flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
    .nav-menu { flex-wrap: wrap; justify-content: center; }
    .nav-actions { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 640px) {
    .navbar .container { padding: 0 1rem; }
    .logo-text { font-size: 1.1rem; }
    .nav-menu { width: 100%; gap: 0.25rem; }
    .nav-link { padding: 0.45rem 0.7rem; font-size: 0.9rem; }
    .nav-actions { width: 100%; justify-content: center; }
}

.transaction-row-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}


/* Transaction page: prioritize the transaction list */
#page-transactions .transaction-form-column {
    flex: 0 0 calc(30% - 0.75rem);
    width: calc(30% - 0.75rem);
}
#page-transactions .transaction-list-column {
    flex: 1 1 calc(70% - 0.75rem);
    width: calc(70% - 0.75rem);
}
#page-transactions #all-transactions-table {
    table-layout: fixed;
}
#page-transactions #all-transactions-table th,
#page-transactions #all-transactions-table td {
    padding: 0.55rem 0.4rem;
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}
#page-transactions #all-transactions-table th:nth-child(1) { width: 9%; }
#page-transactions #all-transactions-table th:nth-child(2) { width: 8%; }
#page-transactions #all-transactions-table th:nth-child(3) { width: 8%; }
#page-transactions #all-transactions-table th:nth-child(4) { width: 12%; }
#page-transactions #all-transactions-table th:nth-child(5) { width: 20%; }
#page-transactions #all-transactions-table th:nth-child(6) { width: 9%; }
#page-transactions #all-transactions-table th:nth-child(7) { width: 10%; }
#page-transactions #all-transactions-table th:nth-child(8) { width: 10%; }
#page-transactions #all-transactions-table th:nth-child(9) { width: 14%; }
#page-transactions .transaction-row-actions .btn {
    padding: 0.35rem 0.45rem;
    font-size: 0.76rem;
    white-space: nowrap;
}
.transaction-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
@media (max-width: 980px) {
    #page-transactions .transaction-form-column,
    #page-transactions .transaction-list-column {
        flex: 0 0 100%;
        width: 100%;
    }
}
.admin-management {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}
.admin-management h4 {
    margin: 0 0 0.75rem;
    color: var(--text-primary);
}
.admin-management-note {
    color: var(--text-secondary);
    font-size: 0.88rem;
}
.admin-user-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.admin-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-color);
}
.admin-user-item:last-child { border-bottom: 0; }
.admin-user-name { font-weight: 600; }
.admin-user-group { color: var(--text-secondary); font-size: 0.85rem; }
@media (max-width: 520px) {
    .admin-modal { padding: 0.5rem; }
    .admin-user-item { align-items: flex-start; flex-direction: column; gap: 0.2rem; }
}
