/* =====================================================
   RENT BILLING MANAGER - STYLESHEET
   ===================================================== */
:root {
    --primary: #1a56db;
    --primary-dark: #1342b0;
    --primary-light: #e8f0fe;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #fff;
    --sidebar-active-bg: #1a56db;
    --sidebar-width: 250px;
    --topbar-h: 64px;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    font-size: 14px;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand i { font-size: 1.4rem; color: #60a5fa; }

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav .nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #475569;
    padding: 14px 20px 4px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0;
    font-weight: 500;
    transition: all .2s;
    margin: 1px 8px;
    border-radius: 7px;
}

.sidebar-nav .nav-link i { font-size: 1rem; min-width: 18px; }
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-nav .nav-link.active { color: var(--sidebar-active); background: var(--sidebar-active-bg); }

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

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: .875rem;
    padding: 8px 12px;
    border-radius: 7px;
    transition: all .2s;
}
.btn-logout:hover { color: #fff; background: rgba(220,38,38,.2); }

/* ── Main Content ── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left .3s ease;
}

.topbar {
    height: var(--topbar-h);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: none;
}
.sidebar-toggle:hover { background: var(--bg); }

.topbar-title {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
    color: var(--text);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 500;
}
.topbar-user i { font-size: 1.1rem; color: var(--primary); }

.page-content { padding: 24px; }

/* ── Cards ── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: none;
}

.card-header .card-title {
    font-weight: 600;
    font-size: .95rem;
    margin: 0;
}

.card-body { padding: 20px; }

/* ── Stat Cards ── */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon.green  { background: #dcfce7; color: #15803d; }
.stat-icon.orange { background: #ffedd5; color: #c2410c; }
.stat-icon.purple { background: #ede9fe; color: #6d28d9; }
.stat-icon.red    { background: #fee2e2; color: #b91c1c; }

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.stat-label {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ── Tables ── */
.table { font-size: .875rem; }
.table th {
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
}
.table td { padding: 11px 14px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Buttons ── */
.btn { font-weight: 500; border-radius: 7px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { font-size: .8rem; padding: 4px 10px; }

/* ── Forms ── */
.form-label { font-weight: 500; font-size: .875rem; margin-bottom: 5px; }
.form-control, .form-select {
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: .875rem;
    padding: 8px 12px;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

.form-section-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 6px;
    margin-bottom: 14px;
    margin-top: 8px;
}

/* ── Auth Pages ── */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

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

.auth-logo i { font-size: 2.5rem; color: var(--primary); }
.auth-logo h1 { font-size: 1.3rem; font-weight: 700; margin: 8px 0 0; color: var(--text); }
.auth-logo p { font-size: .82rem; color: var(--text-muted); margin: 4px 0 0; }

/* ── Badges ── */
.badge-home { background: #dbeafe; color: #1d4ed8; }
.badge-shop { background: #dcfce7; color: #15803d; }

/* ── Print ── */
.invoice-print {
    max-width: 750px;
    margin: 0 auto;
    background: #fff;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.invoice-title { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.invoice-number { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }

.invoice-table td, .invoice-table th { padding: 8px 14px; }
.invoice-total-row td { font-weight: 700; font-size: 1rem; background: var(--primary-light) !important; }

@media print {
    .sidebar, .topbar, .no-print, .btn { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .invoice-print { border: none; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: flex; }
    .main-content { margin-left: 0; }
}
