/**
 * WON Financial Management System - Stylesheet
 * Won Sang Kim - Bangladesh Support
 */

/* ── Variables ──────────────────────────────────────────── */
:root {
    --brand-dark:    #0f3460;
    --brand-mid:     #1a6db5;
    --brand-light:   #e6f1fb;

    --sidebar-width: 240px;
    --navbar-h:      56px;

    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;

    --shadow-xs: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
    --shadow-md: 0 8px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);

    --green-bg:   #eaf3de; --green-text:  #3b6d11;
    --blue-bg:    #e6f1fb; --blue-text:   #185fa5;
    --red-bg:     #fcebeb; --red-text:    #a32d2d;
    --amber-bg:   #faeeda; --amber-text:  #854f0b;
    --teal-bg:    #e1f5ee; --teal-text:   #0f6e56;
    --purple-bg:  #eeedfe; --purple-text: #3c3489;
}

/* ── Base ───────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6fb;
    color: #212529;
    -webkit-font-smoothing: antialiased;
}

/* ── Login Page ─────────────────────────────────────────── */
.login-page {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
}

.login-page .card {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.login-page .card-header {
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    border-radius: 0 !important;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
}

.login-brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-mid));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.875rem;
}

.login-brand-icon i {
    font-size: 24px;
    color: #fff;
}

.login-page .card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.25rem;
}

.login-page .card-header small {
    font-size: 0.8rem;
    color: #6c757d;
}

.login-page .card-body {
    padding: 1.75rem;
    background: #fff;
}

.login-page .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.375rem;
}

.login-page .form-control {
    background: #f8f9fc;
    border-color: #e5e9f0;
    padding: 0.625rem 0.875rem;
}

.login-page .form-control:focus {
    background: #fff;
    border-color: var(--brand-mid);
    box-shadow: 0 0 0 3px rgba(26,109,181,.15);
}

.login-page .btn-primary {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 0.2s, transform 0.15s;
}

.login-page .btn-primary:hover {
    background: var(--brand-mid);
    border-color: var(--brand-mid);
    transform: translateY(-1px);
}

.login-hint {
    font-size: 0.75rem;
    color: #adb5bd;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    display: inline-block;
    margin-top: 0.75rem;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    box-shadow: var(--shadow-xs);
    border-bottom: 1px solid #eef0f3;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: var(--navbar-h);
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0,0,0,.07);
    overflow-y: auto;
    height: calc(100vh - var(--navbar-h));
    background: #fff;
}

.sidebar-content {
    padding: 1rem 0 3rem;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #adb5bd; }

.sidebar .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
    margin: 0.125rem 0.625rem;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.sidebar .nav-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

.sidebar .nav-link:hover {
    background-color: #f4f6fb;
    color: var(--brand-dark);
}

.sidebar .nav-link.active {
    background-color: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 600;
}

.sidebar-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #adb5bd;
    padding: 0.75rem 1.625rem 0.25rem;
}

/* ── Main Content ───────────────────────────────────────── */
main { padding-top: 1.5rem; }

.page-header {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eef0f3;
}

.page-header h1 {
    font-size: 1.375rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

/* ── Stat Cards ─────────────────────────────────────────── */
.stat-card {
    border: 1px solid #eef0f3;
    border-radius: var(--radius-md);
    background: #fff;
    padding: 1.25rem;
    box-shadow: var(--shadow-xs);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-icon-wrap i {
    font-size: 1.125rem;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.25rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.2;
}

.stat-card .stat-trend {
    font-size: 0.75rem;
    margin-top: 0.375rem;
    color: #adb5bd;
}

.stat-card .stat-trend.up   { color: var(--green-text); }
.stat-card .stat-trend.down { color: var(--red-text); }

/* icon colour helpers */
.ic-green  { background: var(--green-bg);  color: var(--green-text); }
.ic-blue   { background: var(--blue-bg);   color: var(--blue-text); }
.ic-red    { background: var(--red-bg);    color: var(--red-text); }
.ic-amber  { background: var(--amber-bg);  color: var(--amber-text); }
.ic-teal   { background: var(--teal-bg);   color: var(--teal-text); }
.ic-purple { background: var(--purple-bg); color: var(--purple-text); }

/* ── Cards ──────────────────────────────────────────────── */
.card {
    border: 1px solid #eef0f3;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s;
    background: #fff;
}

.card:hover { box-shadow: var(--shadow-sm); }

.card-header {
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    padding: 0.875rem 1.25rem;
}

.card-header h5,
.card-header .card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

/* ── Quick Actions ──────────────────────────────────────── */
.quick-action-btn {
    border: 1px solid #eef0f3;
    border-radius: var(--radius-md);
    background: #f8f9fc;
    padding: 1rem 0.5rem;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    color: #495057;
    font-size: 0.8125rem;
    font-weight: 500;
}

.quick-action-btn:hover {
    background: #fff;
    border-color: var(--brand-mid);
    color: var(--brand-dark);
    transform: translateY(-2px);
}

.quick-action-btn i { font-size: 1.375rem; display: block; margin-bottom: 0.375rem; }

/* ── Tables ─────────────────────────────────────────────── */
.table { font-size: 0.875rem; }

.table thead th {
    background-color: #EFF2F5;
    color: black;
    border-top: 0;
    border-bottom: 0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.6px;
    padding: 0.75rem 0.875rem;
}
.table tbody td {
    padding: 0.75rem 0.875rem;
    vertical-align: middle;
    color: #495057;
    border-color: #f4f6fb;
}

.table-hover tbody tr:hover {
    background-color: var(--brand-light);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #fafbff;
}

/* ── Forms ──────────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid #dde1ea;
    padding: 0.5625rem 0.875rem;
    font-size: 0.875rem;
    background: #f8f9fc;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus {
    background: #fff;
    border-color: var(--brand-mid);
    box-shadow: 0 0 0 3px rgba(26,109,181,.15);
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.375rem;
}

.form-text { font-size: 0.75rem; color: #adb5bd; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.15s;
}

.btn-lg { padding: 0.6875rem 1.5rem; font-size: 0.9375rem; }
.btn-sm { padding: 0.3125rem 0.75rem; font-size: 0.8125rem; }

.btn-primary {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--brand-mid);
    border-color: var(--brand-mid);
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    padding: 0.875rem 1rem;
}

.alert-danger  { background: var(--red-bg);   color: var(--red-text); }
.alert-success { background: var(--green-bg); color: var(--green-text); }
.alert-info    { background: var(--blue-bg);  color: var(--blue-text); }
.alert-warning { background: var(--amber-bg); color: var(--amber-text); }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.3em 0.65em;
    border-radius: 6px;
    letter-spacing: 0.2px;
}

.badge.bg-primary   { background: var(--brand-light) !important; color: var(--brand-dark) !important; }
.badge.bg-success   { background: var(--green-bg)  !important; color: var(--green-text)  !important; }
.badge.bg-danger    { background: var(--red-bg)    !important; color: var(--red-text)    !important; }
.badge.bg-warning   { background: var(--amber-bg)  !important; color: var(--amber-text)  !important; }
.badge.bg-info      { background: var(--teal-bg)   !important; color: var(--teal-text)   !important; }
.badge.bg-secondary { background: #f0f1f3          !important; color: #495057            !important; }

/* ── Action Buttons ─────────────────────────────────────── */
.action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    margin: 0 0.125rem;
    border-radius: 6px;
}

/* ── Pagination ─────────────────────────────────────────── */
.pagination .page-link {
    border-radius: var(--radius-sm);
    margin: 0 0.125rem;
    color: var(--brand-dark);
    border-color: #eef0f3;
    font-size: 0.875rem;
}

.pagination .page-item.active .page-link {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #adb5bd;
}

.empty-state i {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p { font-size: 0.9375rem; margin: 0; }

/* ── Invoice ────────────────────────────────────────────── */
.invoice-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
}

.invoice-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    color: #fff;
    padding: 2rem;
    margin: -2.5rem -2.5rem 2rem;
    text-align: center;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.invoice-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.375rem; }

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.invoice-table th {
    background: var(--brand-dark);
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eef0f3;
    text-align: center;
}

.invoice-table .total-row {
    background: var(--brand-light);
    font-weight: 600;
    color: var(--brand-dark);
}

.invoice-amount-words {
    font-style: italic;
    margin: 1rem 0;
    padding: 0.875rem 1rem;
    background: var(--green-bg);
    color: var(--green-text);
    border-left: 3px solid #639922;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.875rem;
}

/* ── Mission Sheet ──────────────────────────────────────── */
.mission-sheet { border: 2px solid #343a40; margin: 1rem 0; }
.mission-sheet-header { text-align: center; padding: 1rem; border-bottom: 2px solid #343a40; }
.mission-sheet-header h3 { margin: 0; font-weight: 700; text-transform: uppercase; }
.mission-sheet-header .subtitle { font-size: 0.875rem; color: #6c757d; }
.mission-sheet-header .total-display { font-size: 1.1rem; font-weight: 700; margin-top: 0.5rem; }

.mission-table { width: 100%; border-collapse: collapse; }
.mission-table th {
    background: #ffc107;
    color: #1a1a2e;
    padding: 0.5rem;
    border: 1px solid #343a40;
    font-weight: 700;
    font-size: 0.8125rem;
}
.mission-table td { padding: 0.5rem; border: 1px solid #343a40; font-size: 0.875rem; }
.mission-table .total-row { background: #f8f9fa; font-weight: 700; }

/* ── Sponsorship Table ──────────────────────────────────── */
.sponsorship-table { font-size: 0.75rem; }
.sponsorship-table th {
    font-size: 0.6875rem;
    padding: 0.4rem;
    background: var(--teal-bg);
    color: var(--teal-text);
    font-weight: 700;
}
.sponsorship-table td { padding: 0.4rem; text-align: center; }

/* ── Summary Sheet ──────────────────────────────────────── */
.summary-sheet { background: #fff; padding: 2rem; box-shadow: var(--shadow-sm); border-radius: var(--radius-md); }
.summary-header { text-align: center; margin-bottom: 2rem; }
.summary-header h2 { font-weight: 700; text-transform: uppercase; margin-bottom: 0.5rem; }

.summary-table th {
    background: var(--brand-dark);
    color: #fff;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.summary-table .income-row  { background: var(--blue-bg); }
.summary-table .expense-row { background: var(--red-bg); }

/* ── Custom Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0b2d82; }
::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #adb5bd; }

/* ── Print ──────────────────────────────────────────────── */
@media print {
    .sidebar, .navbar, .btn, .no-print { display: none !important; }
    .invoice-container { box-shadow: none; max-width: 100%; border-radius: 0; }
    main { margin-left: 0 !important; width: 100% !important; }
    .container-fluid { width: 100% !important; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .sidebar { top: 4rem; }
    .stat-card .stat-value { font-size: 1.25rem; }
    .invoice-container { padding: 1.25rem; }
    .invoice-header { margin: -1.25rem -1.25rem 1.25rem; padding: 1.25rem; }
}