@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Gujarati:wght@300;400;500;600;700&display=swap');

/* ========== HARI LEGACY GUJARATI FONT ========== */
@font-face {
    font-family: 'HARI';
    src: url('Fonts/HARI.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.font-hari {
    font-family: 'HARI', 'Noto Sans Gujarati', 'Shruti', 'Arial Unicode MS', sans-serif !important;
}

/* ========== CSS VARIABLES ========== */
:root {
    --primary: #4F46E5;        /* Premium Indigo */
    --primary-dark: #4338CA;   /* Darker Indigo */
    --primary-light: #EEF2F6;  /* Softest Light Slate/Blue */
    --accent: #F97316;         /* Vibrant Orange */
    --bg-dark: #F8FAFC;        /* Premium Slate-50 Background */
    --bg-card: #FFFFFF;        /* Pure White Card */
    --bg-sidebar: #FFFFFF;     /* Pure White Sidebar */
    --text-primary: #0F172A;   /* Slate-900 Primary Text */
    --text-secondary: #475569; /* Slate-600 Secondary Text */
    --border-color: #E2E8F0;   /* Slate-200 Border Color */
    --success: #10B981;        /* Emerald Success */
    --warning: #F59E0B;        /* Amber Warning */
    --danger: #EF4444;         /* Rose Danger */
    --info: #3B82F6;           /* Blue Info */
    --shadow: 0 4px 20px rgba(15, 23, 42, 0.05); /* Soft, premium shadow */
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Noto Sans Gujarati', 'Shruti', 'Arial Unicode MS', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

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

/* ========== LAYOUT ========== */
.layout-wrapper { display: flex; min-height: 100vh; }

/* ========== SIDEBAR ========== */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.sidebar-brand h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-brand small {
    color: var(--primary-light);
    font-size: 11px;
    display: block;
    margin-top: 4px;
}

.nav-section {
    padding: 12px 0;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(63, 81, 181, 0.1);
    color: var(--text-primary);
    border-left-color: var(--primary);
}

.nav-link.active {
    background: rgba(63, 81, 181, 0.15);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-link i {
    margin-right: 10px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========== TOPBAR ========== */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar .page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar .date-display {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-dark);
    padding: 6px 12px;
    border-radius: 20px;
}

.btn-logout {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

/* ========== PAGE CONTENT ========== */
.page-content {
    padding: 24px;
    flex: 1;
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

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

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* ========== STAT CARDS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.blue::before { background: var(--info); }
.stat-card.green::before { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before { background: var(--danger); }
.stat-card.purple::before { background: #9C27B0; }

.stat-card .stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label, .form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', 'Noto Sans Gujarati', 'Shruti', 'Arial Unicode MS', sans-serif;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    background: #ffffff;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a3ab' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

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

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', 'Noto Sans Gujarati', 'Shruti', 'Arial Unicode MS', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 15px rgba(63,81,181,0.4); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #388E3C; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d32f2f; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #F57C00; }

.btn-secondary { background: var(--border-color); color: var(--text-primary); }
.btn-secondary:hover { background: #3a3f48; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-group { display: flex; gap: 10px; margin-top: 16px; }

/* ========== TABLES / GRIDVIEW ========== */
.table-responsive { overflow-x: auto; }

.grid-view, .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.grid-view th, .data-table th {
    background: var(--primary);
    color: #fff;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    white-space: nowrap;
}

.grid-view td, .data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.grid-view tr:hover td {
    background: rgba(63, 81, 181, 0.05);
}

.grid-view .pager td {
    background: var(--bg-card);
    padding: 12px;
    text-align: center;
}

.grid-view .pager a, .grid-view .pager span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.grid-view .pager a {
    background: var(--bg-dark);
    color: var(--text-secondary);
}

.grid-view .pager a:hover {
    background: var(--primary);
    color: #fff;
}

.grid-view .pager span {
    background: var(--primary);
    color: #fff;
}

/* ========== ALERTS ========== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: rgba(76, 175, 80, 0.15); color: var(--success); border: 1px solid rgba(76, 175, 80, 0.3); }
.alert-danger { background: rgba(244, 67, 54, 0.15); color: var(--danger); border: 1px solid rgba(244, 67, 54, 0.3); }
.alert-warning { background: rgba(255, 152, 0, 0.15); color: var(--warning); border: 1px solid rgba(255, 152, 0, 0.3); }
.alert-info { background: rgba(33, 150, 243, 0.15); color: var(--info); border: 1px solid rgba(33, 150, 243, 0.3); }

/* ========== LOGIN PAGE ========== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.06) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    position: relative;
    z-index: 1;
}

.login-card h1 {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 32px;
}

.login-card .form-group { margin-bottom: 20px; }

.login-card .form-control {
    padding: 12px 16px;
    font-size: 14px;
}

.login-card .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 14px;
    margin-top: 8px;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 12px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========== UTILITIES ========== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.d-none { display: none; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
}

/* ========== PREMIUM LIGHT THEME ENHANCEMENTS & OVERRIDES ========== */
html {
    scroll-behavior: smooth;
}

/* Clean up custom scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Global support for ReadOnly & Disabled inputs */
.form-control[readonly], .form-control[disabled] {
    background-color: var(--bg-dark) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

/* Details Section Box Override */
.details-section {
    background-color: var(--bg-dark) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.01) !important;
}

/* Action menus and dropdowns globally */
.action-btn {
    background: var(--primary-light) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
}
.action-btn:hover {
    background: var(--border-color) !important;
}
.action-menu {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow) !important;
}
.action-menu a {
    color: var(--text-primary) !important;
    transition: var(--transition);
}
.action-menu a:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

/* Sleek Badge Overrides */
.badge-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: var(--danger) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}
.badge-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: var(--success) !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

/* Beautiful modern GridView styling */
.grid-view {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--bg-card);
    box-shadow: var(--shadow);
}
.grid-view th {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
    border-bottom: 2px solid var(--border-color) !important;
    padding: 12px 14px !important;
}
.grid-view td {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 12px 14px !important;
}
.grid-view tr:hover td {
    background-color: var(--primary-light) !important;
}

/* Sidebar soft shadow */
.sidebar {
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.03);
}

/* Topbar soft shadow & glass effect */
.topbar {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
    backdrop-filter: blur(8px);
}
