/* ============================================================
   Bisshogram Invoice System — Main Stylesheet
   ============================================================ */

:root {
    --btt-primary:   #1a2942;
    --btt-secondary: #f0a500;
    --btt-accent:    #e67e22;
    --btt-light:     #f8f9fa;
    --btt-dark:      #121929;
    --sidebar-width: 240px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #2d3436;
    min-height: 100vh;
    margin: 0;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--btt-primary);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

#page-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.3s ease;
}

.sidebar-logo {
    background: var(--btt-dark);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 2px;
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(240,165,0,0.15);
    color: var(--btt-secondary);
}

.sidebar .nav-link.active {
    font-weight: 600;
    border-left: 3px solid var(--btt-secondary);
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
}

.avatar-circle {
    width: 34px;
    height: 34px;
    background: var(--btt-secondary);
    color: var(--btt-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

/* ── Top Bar ──────────────────────────────────────────────── */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    height: 58px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--btt-primary);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: #6c757d;
    margin-top: 4px;
}

/* ── Tables ───────────────────────────────────────────────── */
.table-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    overflow: hidden;
}

.table-card .table {
    margin: 0;
    font-size: 14px;
}

.table-card .table thead th {
    background: var(--btt-primary);
    color: #fff;
    font-weight: 600;
    border: none;
    padding: 12px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.table-card .table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: #f0f0f0;
}

.table-card .table tbody tr:hover {
    background: #fafbfc;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    font-size: 14px;
    padding: 9px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--btt-secondary);
    box-shadow: 0 0 0 3px rgba(240,165,0,.15);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
    background: var(--btt-primary);
    border-color: var(--btt-primary);
}
.btn-primary:hover {
    background: var(--btt-dark);
    border-color: var(--btt-dark);
}
.btn-warning {
    background: var(--btt-secondary);
    border-color: var(--btt-secondary);
    color: var(--btt-dark);
    font-weight: 600;
}

/* ── Invoice Preview ──────────────────────────────────────── */
.invoice-preview {
    background: #fff;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    box-shadow: 0 2px 20px rgba(0,0,0,.1);
    border-radius: 8px;
}

.invoice-header-bg {
    background: var(--btt-primary);
    color: #fff;
    padding: 24px 28px;
    border-radius: 8px 8px 0 0;
    margin: -40px -40px 28px;
}

.invoice-table thead th {
    background: var(--btt-primary) !important;
    color: #fff !important;
}

.invoice-totals {
    border-top: 2px solid var(--btt-primary);
    padding-top: 12px;
}

.invoice-footer-bar {
    background: var(--btt-primary);
    color: #fff;
    padding: 12px 28px;
    margin: 28px -40px -40px;
    border-radius: 0 0 8px 8px;
    font-size: 13px;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 6px;
}

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

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

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

.login-logo .brand-name {
    color: var(--btt-primary);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
}

/* ── Item row (invoice form) ──────────────────────────────── */
.item-row {
    background: #fafbfc;
    border: 1.5px solid #e9ecef;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.remove-item {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.show {
        transform: translateX(0);
    }
    #page-content {
        margin-left: 0;
    }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
    #sidebar, .topbar, .no-print { display: none !important; }
    #page-content { margin-left: 0 !important; }
    .invoice-preview { box-shadow: none !important; }
}
