/* SafeInvoice Enterprise Custom CSS - High Density, Multi-Device Optimized Suite */

:root {
    --si-primary: #1e3a8a;       /* Deep Navy */
    --si-primary-light: #3b82f6; /* Modern Azure Blue */
    --si-secondary: #0f766e;     /* Emerald Teal */
    --si-accent: #f59e0b;        /* Indian Saffron Gold */
    --si-dark: #0f172a;          /* Slate 900 */
    --si-sidebar-bg: #111827;    /* Slate Dark for Sidebar */
    --si-body-bg: #f8fafc;       /* Clean Light Background */
    --si-card-bg: #ffffff;
    --si-border: #e2e8f0;
}

html {
    font-size: 15px; /* Clean, balanced base scale */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--si-body-bg);
    color: #1e293b;
    font-size: 0.88rem; /* ~13.2px - crisp, comfortably readable without horizontal overflow */
    line-height: 1.5;
    overflow-x: hidden;
}

/* Scaled Typography for Professional Accounting / ERP Density */
h1, .h1 { font-family: 'Outfit', sans-serif; font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; }
h2, .h2 { font-family: 'Outfit', sans-serif; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
h3, .h3 { font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
h4, .h4 { font-family: 'Outfit', sans-serif; font-size: 1.08rem; font-weight: 600; }
h5, .h5 { font-family: 'Outfit', sans-serif; font-size: 0.98rem; font-weight: 600; }
h6, .h6 { font-family: 'Outfit', sans-serif; font-size: 0.88rem; font-weight: 600; }
.brand-font { font-family: 'Outfit', sans-serif; }

p {
    margin-bottom: 0.6rem;
}

/* Master Wrapper & Responsive Sidebar */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 245px;
    background: #0f172a;
    color: #94a3b8;
    flex-shrink: 0;
    transition: all 0.25s ease-in-out;
    display: flex;
    flex-direction: column;
    z-index: 1040;
}

.sidebar-header {
    padding: 0.95rem 1.15rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.65rem;
}

.nav-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.65rem 0.75rem 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.75rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 0.45rem;
    transition: all 0.15s;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-link i {
    width: 20px;
    font-size: 0.95rem;
    text-align: center;
    color: #64748b;
    transition: color 0.15s;
    flex-shrink: 0;
}

.sidebar-link:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-link:hover i {
    color: #38bdf8;
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(14, 165, 233, 0.95) 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.sidebar-link.active i {
    color: #ffffff;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--si-body-bg);
}

/* Modern Top Navbar */
.app-topbar {
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.4rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Content Area */
.app-content {
    flex: 1;
    padding: 1.2rem 1.4rem;
}

/* Card Styling */
.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

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

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.stat-card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.table-card .card-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.15rem;
    font-size: 0.9rem;
}

.table-responsive {
    margin-bottom: 0;
}

/* High-Density Compact Table */
.table {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.6rem 0.75rem;
    background-color: #f8fafc;
    color: #475569;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
}

/* Compact Forms & Controls */
.form-control, .form-select {
    font-size: 0.85rem !important;
    padding: 0.42rem 0.75rem !important;
    border-radius: 0.45rem;
    border-color: #cbd5e1;
}

.form-control:focus, .form-select:focus {
    border-color: var(--si-primary-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.form-control-sm, .form-select-sm {
    font-size: 0.8rem !important;
    padding: 0.32rem 0.6rem !important;
}

.form-label {
    font-size: 0.82rem !important;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.25rem;
}

.input-group-text {
    font-size: 0.85rem;
    padding: 0.42rem 0.75rem;
}

.input-group-sm > .form-control,
.input-group-sm > .input-group-text {
    font-size: 0.8rem;
    padding: 0.32rem 0.6rem;
}

/* Buttons */
.btn {
    font-size: 0.85rem !important;
    padding: 0.42rem 0.85rem !important;
    border-radius: 0.45rem;
    font-weight: 500;
}

.btn-sm {
    font-size: 0.8rem !important;
    padding: 0.3rem 0.65rem !important;
}

.btn-xs {
    font-size: 0.75rem !important;
    padding: 0.2rem 0.5rem !important;
    border-radius: 0.3rem;
}

/* Badges */
.badge {
    font-size: 0.75rem !important;
    font-weight: 600;
    padding: 0.32em 0.6em;
    border-radius: 0.4rem;
}

.badge-gst {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.28em 0.55em;
    border-radius: 0.4rem;
}

/* Utilities */
.text-xs {
    font-size: 0.75rem !important;
}

.small, small {
    font-size: 0.8rem !important;
}

/* Indian GST Tax Invoice Print Styling */
@media print {
    .no-print, .app-sidebar, .app-topbar, .btn, .card-header-actions {
        display: none !important;
    }
    .app-main, .app-content {
        padding: 0 !important;
        background: #ffffff !important;
    }
    .print-container {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.65rem !important;
    }
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12px !important;
    }
    .table {
        font-size: 11px !important;
    }
    .table td, .table th {
        padding: 4px 6px !important;
    }
}

/* Offline Sync Status Bar */
.offline-sync-bar {
    background: #fef3c7;
    border-bottom: 1px solid #fde68a;
    padding: 0.42rem 1.25rem;
    font-size: 0.82rem;
    color: #92400e;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.offline-sync-bar.online {
    background: #ecfdf5;
    border-bottom: 1px solid #a7f3d0;
    color: #065f46;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -255px;
    }
    .app-sidebar.show {
        left: 0;
    }
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        z-index: 1030;
    }
    .app-content {
        padding: 0.9rem;
    }
}
