/* GST Billing & Accounting SaaS - Modern Premium Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0f172a;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    --bg-body: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-blue: #2563eb;
    --accent-indigo: #4f46e5;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;
    --border-color: #e2e8f0;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 270px;
    background-color: var(--bg-sidebar);
    color: #f1f5f9;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.sidebar-header {
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
}

.brand-icon-wrapper {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(124, 58, 237, 0.25) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #38bdf8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.menu-icon {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    color: #64748b;
    transition: all 0.2s ease;
}

.menu-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(2px);
}

.menu-link:hover .menu-icon {
    color: #38bdf8;
    transform: scale(1.1);
}

.menu-link.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.menu-link.active .menu-icon {
    color: #ffffff;
}

.dropdown-toggle {
    justify-content: space-between;
    cursor: pointer;
}

.dropdown-arrow {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
    color: #64748b;
}

.has-dropdown.open .dropdown-toggle .dropdown-arrow {
    transform: rotate(90deg);
    color: #ffffff;
}

.has-dropdown.open .dropdown-toggle {
    color: #ffffff;
}

.submenu {
    list-style: none;
    padding-left: 8px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.submenu .menu-link {
    padding: 9px 16px 9px 30px;
    font-size: 0.84rem;
}

/* Main Content Layout */
.main-wrapper {
    margin-left: 270px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-navbar {
    height: 70px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.content-body {
    padding: 28px;
    flex: 1;
}

/* Dashboard Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    margin-top: 10px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.stat-value.green { color: var(--accent-green); }
.stat-value.red { color: var(--accent-red); }
.stat-value.blue { color: var(--accent-blue); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #334155;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }

/* Buttons & Controls */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-primary { 
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); 
    color: #fff; 
}
.btn-primary:hover { 
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); 
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-success { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%); 
    color: #fff; 
}
.btn-success:hover { 
    background: linear-gradient(135deg, #059669 0%, #047857 100%); 
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-outline { 
    background-color: #ffffff; 
    border: 1px solid #cbd5e1; 
    color: var(--text-primary); 
}
.btn-outline:hover { 
    background-color: #f8fafc; 
    border-color: #94a3b8;
}

/* Tables */
.card-table {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.custom-table th, .custom-table td {
    padding: 13px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.custom-table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-table tr:hover {
    background-color: #f8fafc;
}

/* Ultra-Clean Modern Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    transform: scale(0.96);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    padding: 18px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.modal-close:hover { 
    background: #e2e8f0; 
    color: #0f172a; 
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
    border-radius: 0 0 16px 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.15s ease;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Print Utilities */
@media print {
    .no-print, .sidebar, .top-navbar, #gemini-chat-box {
        display: none !important;
    }
    .main-wrapper {
        margin-left: 0 !important;
    }
    .content-body {
        padding: 0 !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 70px; }
    .sidebar-brand, .menu-link span:not(:first-child) { display: none; }
    .main-wrapper { margin-left: 70px; }
    .form-row { grid-template-columns: 1fr; }
}
