/* VDF NGO Management System - Main Stylesheet */
:root {
    --navy:        #1B2A4A;
    --navy-dark:   #0D1929;
    --navy-light:  #253660;
    --orange:      #F47B20;
    --orange-dark: #D4620D;
    --orange-light:#FF9A3C;
    --white:       #FFFFFF;
    --gray-50:     #F8F9FA;
    --gray-100:    #F1F3F5;
    --gray-200:    #E9ECEF;
    --gray-300:    #DEE2E6;
    --gray-500:    #ADB5BD;
    --gray-600:    #6C757D;
    --gray-700:    #495057;
    --gray-800:    #343A40;
    --green:       #28A745;
    --red:         #DC3545;
    --yellow:      #FFC107;
    --sidebar-w:   260px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    font-size: 15px;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--navy-dark);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--navy);
}

.brand-logo {
    width: 44px; height: 44px;
    background: var(--orange);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 900; color: #fff;
    flex-shrink: 0;
}

.brand-text h4 {
    font-size: 16px; font-weight: 700; color: #fff;
    line-height: 1.2;
}

.brand-text span {
    font-size: 10px; color: var(--orange-light);
    letter-spacing: .5px; text-transform: uppercase;
}

.sidebar-nav { padding: 14px 0; flex: 1; }

.nav-section-label {
    padding: 10px 22px 4px;
    font-size: 12px; font-weight: 600;
    color: var(--gray-500);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-item { margin: 2px 10px; }

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: rgba(255,255,255,.72);
    font-size: 15px;
    transition: all .2s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(244,123,32,.15);
    color: var(--orange-light);
}

.nav-link.active {
    background: rgba(244,123,32,.22);
    color: var(--orange);
    font-weight: 600;
}

.nav-link .nav-icon {
    width: 20px; text-align: center;
    font-size: 15px;
    opacity: .85;
}

.sidebar-footer {
    padding: 14px 22px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.15);
}

.sidebar-user {
    display: flex; align-items: center; gap: 10px;
}

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

.user-info .user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-info .user-role {
    font-size: 10px; color: var(--gray-500);
    text-transform: capitalize;
}

.btn-logout {
    margin-top: 10px;
    width: 100%;
    padding: 8px;
    background: rgba(220,53,69,.2);
    border: 1px solid rgba(220,53,69,.3);
    color: #ff8a94;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    transition: all .2s;
    display: block;
}

.btn-logout:hover {
    background: rgba(220,53,69,.35);
    color: #fff;
}

/* ── Main Content ── */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top Bar ── */
.topbar {
    background: var(--white);
    border-bottom: 2px solid var(--orange);
    padding: 0 28px;
    height: 62px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 900;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.topbar-title {
    font-size: 18px; font-weight: 700; color: var(--navy);
}

.topbar-title span { color: var(--orange); }

.topbar-right {
    display: flex; align-items: center; gap: 16px;
}

.topbar-badge {
    background: var(--navy); color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px; font-weight: 600;
    letter-spacing: .3px;
}

.topbar-date { font-size: 12px; color: var(--gray-600); }

/* ── Page Content ── */
.page-content { padding: 28px; flex: 1; }

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px; font-weight: 700; color: var(--navy);
}

.page-header p { font-size: 13px; color: var(--gray-600); margin-top: 2px; }

/* ── Cards ── */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--gray-50);
}

.card-header h5 {
    font-size: 15px; font-weight: 700; color: var(--navy);
    display: flex; align-items: center; gap: 8px;
}

.card-body { padding: 22px; }

/* ── Stat Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    display: flex; align-items: flex-start; justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--navy);
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.09); }

.stat-card.orange { border-left-color: var(--orange); }
.stat-card.green  { border-left-color: var(--green); }
.stat-card.red    { border-left-color: var(--red); }

.stat-info .stat-label {
    font-size: 12px; text-transform: uppercase;
    letter-spacing: .6px; color: var(--gray-600); font-weight: 600;
}

.stat-info .stat-value {
    font-size: 26px; font-weight: 800; color: var(--navy);
    line-height: 1.2; margin-top: 4px;
}

.stat-info .stat-sub {
    font-size: 13px; color: var(--gray-600); margin-top: 4px;
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    background: var(--gray-100);
    flex-shrink: 0;
}

.stat-card .stat-icon { background: rgba(27,42,74,.08); color: var(--navy); }
.stat-card.orange .stat-icon { background: rgba(244,123,32,.1); color: var(--orange); }
.stat-card.green  .stat-icon { background: rgba(40,167,69,.1);  color: var(--green); }
.stat-card.red    .stat-icon { background: rgba(220,53,69,.1);  color: var(--red); }

/* ── Grid Layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; }

/* ── Tables ── */
.table-responsive { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead tr { background: var(--navy); }
thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
    letter-spacing: .3px;
    text-transform: uppercase;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: background .15s;
}

tbody tr:hover { background: var(--gray-50); }

tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--gray-700);
}

tbody tr:last-child { border-bottom: none; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-success  { background: rgba(40,167,69,.12);  color: #1a7a35; }
.badge-danger   { background: rgba(220,53,69,.12);  color: #b02030; }
.badge-warning  { background: rgba(255,193,7,.18);  color: #856404; }
.badge-info     { background: rgba(23,162,184,.12); color: #117a8b; }
.badge-primary  { background: rgba(27,42,74,.1);    color: var(--navy); }
.badge-orange   { background: rgba(244,123,32,.12); color: var(--orange-dark); }
.badge-secondary{ background: var(--gray-200);      color: var(--gray-700); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px; font-weight: 600;
    border: none; cursor: pointer;
    text-decoration: none;
    transition: opacity .2s;
    white-space: nowrap;
}
.btn:hover { opacity: .88; }
.btn svg { width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:2; flex-shrink:0; }

.btn-primary  { background: var(--navy);    color: #fff; }
.btn-orange   { background: #E8820C;        color: #fff; }
.btn-green    { background: #3B6D11;        color: #fff; }
.btn-darkred  { background: #8B1A1A;        color: #fff; }
.btn-navy     { background: #1A3A6B;        color: #fff; }
.btn-whatsapp { background: #25D366;        color: #fff; }
.btn-success  { background: var(--green);   color: #fff; }
.btn-danger   { background: var(--red);     color: #fff; }

.btn-outline {
    background: #fff;
    border: 1px solid #1A3A6B;
    color: #1A3A6B;
}
.btn-outline:hover { background: #f0f4ff; opacity: 1; }

.btn-sm { padding: 5px 11px; font-size: 11px; }
.btn-xs { padding: 3px 8px;  font-size: 11px; border-radius: 6px; }

/* ── Inline action buttons (table rows) ── */
.act-btn {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; border: none;
    text-decoration: none;
    transition: opacity .2s;
    flex-shrink: 0;
}
.act-btn:hover { opacity: .80; }
.act-btn svg { width:13px; height:13px; stroke:currentColor; fill:none; stroke-width:2; }
.ab-view  { background: #1A3A6B; color: #fff; }
.ab-edit  { background: #E8820C; color: #fff; }
.ab-print { background: #3B6D11; color: #fff; }
.ab-wa    { background: #25D366; color: #fff; }
.ab-del   { background: #8B1A1A; color: #fff; }
.ab-navy  { background: #253660; color: #fff; }
.ab-teal  { background: #0D7D6B; color: #fff; }
.ab-amber { background: #E8A020; color: #fff; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px; font-weight: 600; color: var(--gray-700);
}

.form-label .required { color: var(--red); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(244,123,32,.15);
}

select.form-control { cursor: pointer; }

textarea.form-control { resize: vertical; min-height: 90px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

.form-actions {
    display: flex; gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-200);
    margin-top: 6px;
}

/* ── Alerts ── */
.alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 13.5px;
    display: flex; align-items: flex-start; gap: 10px;
}

.alert-success { background: #d4edda; border-left: 4px solid var(--green); color: #155724; }
.alert-danger  { background: #f8d7da; border-left: 4px solid var(--red);   color: #721c24; }
.alert-warning { background: #fff3cd; border-left: 4px solid var(--yellow); color: #856404; }
.alert-info    { background: #d1ecf1; border-left: 4px solid #17a2b8;      color: #0c5460; }

/* ── Progress Bar ── */
.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    background: var(--orange);
    transition: width .4s;
}

/* ── Recent Activity ── */
.activity-list { list-style: none; }

.activity-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--orange);
    margin-top: 5px;
    flex-shrink: 0;
}

.activity-text { font-size: 13px; color: var(--gray-700); }
.activity-time { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* ── Pagination ── */
.pagination {
    display: flex; align-items: center; gap: 6px;
    padding: 16px 0 0;
    justify-content: flex-end;
}

.page-link {
    padding: 6px 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px; color: var(--gray-700);
    cursor: pointer;
    transition: all .2s;
}

.page-link:hover, .page-link.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

/* ── Action Buttons in Tables ── */
.action-btns { display: flex; gap: 6px; }

/* ── Search & Filters ── */
.table-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap; gap: 12px;
}

.search-box {
    position: relative; display: inline-block;
}

.search-box input {
    padding-left: 36px;
    width: 240px;
}

.search-box .search-icon {
    position: absolute; left: 11px; top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500); font-size: 14px;
    pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-wrapper { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Dashboard Charts Placeholder ── */
.chart-placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 200px;
    background: var(--gray-50);
    border-radius: 8px;
    color: var(--gray-500);
    font-size: 13px;
    border: 2px dashed var(--gray-300);
}

/* ── Number formatting ── */
.amount { font-weight: 700; color: var(--navy); font-family: 'Courier New', monospace; }
.amount-credit { color: var(--green); }
.amount-debit  { color: var(--red); }

/* ── Empty state ── */
.empty-state {
    text-align: center; padding: 48px 20px;
    color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%; max-width: 440px;
}

.login-logo {
    text-align: center; margin-bottom: 28px;
}

.login-logo-icon {
    width: 76px; height: 76px;
    background: var(--orange);
    border-radius: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 900; color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(244,123,32,.4);
}

.login-logo h2 { color: #fff; font-size: 24px; font-weight: 800; }
.login-logo p  { color: rgba(255,255,255,.6); font-size: 12px; margin-top: 4px; letter-spacing: .5px; }

.login-card {
    background: rgba(255,255,255,.97);
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-card h3 {
    font-size: 20px; font-weight: 700; color: var(--navy);
    margin-bottom: 6px;
}

.login-card .login-sub {
    font-size: 13px; color: var(--gray-600);
    margin-bottom: 26px;
}

.login-card .form-control { padding: 12px 16px; font-size: 14px; }

.btn-login {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
    color: #fff; border: none; border-radius: 8px;
    font-size: 15px; font-weight: 700; cursor: pointer;
    transition: all .2s;
    letter-spacing: .3px;
    margin-top: 6px;
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--orange-dark) 0%, #b55208 100%);
    box-shadow: 0 6px 20px rgba(244,123,32,.4);
    transform: translateY(-1px);
}

.login-footer {
    text-align: center; margin-top: 24px;
    font-size: 12px; color: rgba(255,255,255,.5);
}

/* ── Divider ── */
.divider {
    border: none; border-top: 1px solid var(--gray-200);
    margin: 18px 0;
}

/* ── Info Box ── */
.info-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 14px;
}

.info-row {
    display: flex;
    margin-bottom: 8px;
    font-size: 13.5px;
}

.info-row:last-child { margin-bottom: 0; }

.info-label {
    width: 150px; min-width: 150px;
    color: var(--gray-600); font-weight: 600;
}

.info-value { color: var(--gray-800); }

/* ── Dashboard quick-links ── */
.quick-link-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.quick-link {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 22px 14px;
    border-radius: 10px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    cursor: pointer;
    transition: all .2s;
    text-align: center;
    color: var(--gray-700);
}

.quick-link:hover {
    border-color: var(--orange);
    background: rgba(244,123,32,.04);
    color: var(--orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.quick-link .ql-icon {
    font-size: 28px; margin-bottom: 8px;
}

.quick-link .ql-label {
    font-size: 12px; font-weight: 600;
}
