/* ============================================================
   Voucher Management System — Main Stylesheet
   Bootstrap 3.3.7 base + custom overrides
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Source+Serif+4:wght@300;400;600&display=swap');

/* ── Variables ── */
:root {
    --primary:      #2c3e50;
    --accent:       #c0392b;
    --accent-light: #e74c3c;
    --sidebar-bg:   #1a252f;
    --sidebar-w:    220px;
    --topbar-h:     54px;
    --body-bg:      #f0f2f5;
    --card-bg:      #ffffff;
    --border:       #dee2e6;
    --text-main:    #2c3e50;
    --text-muted:   #7f8c8d;
    --success:      #27ae60;
    --warning:      #f39c12;
    --info:         #2980b9;
}

/* ── Reset / Base ── */
* { box-sizing: border-box; }

body {
    font-family: 'Source Serif 4', serif;
    background: var(--body-bg);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    font-size: 14px;
}

a { color: var(--accent); }
a:hover { color: var(--accent-light); text-decoration: none; }

/* ── TOP NAV ── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--primary);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.topbar .brand {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    flex: 1;
}
.topbar .brand span { color: var(--accent-light); }
.topbar .top-user {
    color: #bdc3c7;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar .top-user a {
    color: #e74c3c;
    font-size: 12px;
    border: 1px solid #e74c3c;
    padding: 3px 10px;
    border-radius: 3px;
}
.topbar .top-user a:hover { background: #e74c3c; color: #fff; }

/* ── SIDEBAR ── */
.sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: var(--sidebar-w);
    bottom: 0;
    background: var(--sidebar-bg);
    overflow-y: auto;
    z-index: 900;
    padding-bottom: 20px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: var(--sidebar-bg); }
.sidebar::-webkit-scrollbar-thumb { background: #34495e; }

.sidebar .nav-section {
    padding: 14px 16px 4px;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #566573;
    font-weight: 600;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #aab7b8;
    font-size: 13px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: rgba(255,255,255,0.07);
    color: #fff;
    border-left-color: var(--accent-light);
}
.sidebar ul li a .nav-icon {
    width: 18px;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

/* ── MAIN CONTENT ── */
.main-content {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-h));
}

/* ── PAGE HEADER ── */
.page-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.page-header-bar h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}
.page-header-bar .breadcrumb {
    background: none;
    margin: 0;
    padding: 0;
    font-size: 12px;
}

/* ── CARDS ── */
.card {
    background: var(--card-bg);
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-body { padding: 18px; }

/* ── DASHBOARD STAT CARDS ── */
.stat-card {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 18px 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card .stat-icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
    flex-shrink: 0;
}
.stat-card .stat-icon.red    { background: var(--accent); }
.stat-card .stat-icon.blue   { background: var(--info); }
.stat-card .stat-icon.green  { background: var(--success); }
.stat-card .stat-icon.orange { background: var(--warning); }
.stat-card .stat-value { font-size: 26px; font-weight: 600; line-height: 1; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ── FORMS ── */
.form-group label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 4px;
}
.form-control {
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 13px;
    height: 34px;
    font-family: 'Source Serif 4', serif;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(44,62,80,0.12);
}
textarea.form-control { height: auto; }

/* ── BUTTONS ── */
.btn {
    font-family: 'Source Serif 4', serif;
    font-size: 13px;
    border-radius: 4px;
    padding: 6px 16px;
    letter-spacing: 0.3px;
}
.btn-primary   { background: var(--primary);  border-color: var(--primary); }
.btn-primary:hover { background: #1a252f; border-color: #1a252f; }
.btn-danger    { background: var(--accent);   border-color: var(--accent); }
.btn-danger:hover  { background: #a93226; border-color: #a93226; }
.btn-success   { background: var(--success);  border-color: var(--success); }
.btn-warning   { background: var(--warning);  border-color: var(--warning); color: #fff; }
.btn-info      { background: var(--info);     border-color: var(--info); }

/* ── GRIDVIEW ── */
.grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.grid-table th {
    background: var(--primary);
    color: #fff;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.grid-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.grid-table tr:hover td { background: #f8f9fa; }
.grid-table .alt-row td { background: #fdfdfd; }

/* ── BADGES ── */
.badge-active   { background: #d5f5e3; color: #1e8449; padding: 3px 8px; border-radius: 10px; font-size: 11px; }
.badge-inactive { background: #fadbd8; color: #922b21; padding: 3px 8px; border-radius: 10px; font-size: 11px; }
.badge-payment  { background: #fde8d8; color: #a04000; padding: 3px 8px; border-radius: 10px; font-size: 11px; }
.badge-receipt  { background: #d5f5e3; color: #1e8449; padding: 3px 8px; border-radius: 10px; font-size: 11px; }
.badge-journal  { background: #d6eaf8; color: #154360; padding: 3px 8px; border-radius: 10px; font-size: 11px; }
.badge-contra   { background: #e8daef; color: #4a235a; padding: 3px 8px; border-radius: 10px; font-size: 11px; }

/* ── ALERTS ── */
.alert { border-radius: 4px; font-size: 13px; }

/* ── LOGIN PAGE ── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #1a252f 100%);
}
.login-box {
    background: #fff;
    width: 380px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    overflow: hidden;
}
.login-header {
    background: var(--accent);
    padding: 28px 30px;
    text-align: center;
    color: #fff;
}
.login-header h2 { margin: 0; font-size: 18px; font-weight: 600; }
.login-header p  { margin: 5px 0 0; font-size: 12px; opacity: 0.85; }
.login-body { padding: 28px 30px; }
.login-body .form-control { height: 40px; }
.login-btn {
    width: 100%; height: 40px;
    background: var(--primary);
    border: none; color: #fff;
    font-size: 14px; font-weight: 600;
    border-radius: 4px; cursor: pointer;
    font-family: 'Source Serif 4', serif;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}
.login-btn:hover { background: #1a252f; }

/* ── VOUCHER ENTRY ── */
.voucher-entry-header {
    background: var(--primary);
    color: #fff;
    padding: 14px 18px;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.voucher-no-display {
    background: var(--accent);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}
.amount-words-box {
    background: #fef9e7;
    border: 1px dashed #f39c12;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    color: #7d6608;
    font-style: italic;
    min-height: 36px;
}

/* ── REPORT ── */
.report-filter-bar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.report-totals {
    background: var(--primary);
    color: #fff;
    padding: 12px 18px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 10px;
}

/* ── CHART ── */
.chart-container {
    position: relative;
    height: 280px;
}

/* ── PRINT BUTTON on Report ── */
.btn-print {
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 7px 18px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Source Serif 4', serif;
}
.btn-print:hover { background: #1e8449; }

/* ── SETTINGS ── */
.settings-section {
    border-left: 3px solid var(--accent);
    padding-left: 14px;
    margin-bottom: 18px;
}
.settings-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}
.voucher-preview-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 5px 16px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    min-width: 100px;
    text-align: center;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
}
