/* ─────────────────────────────────────────────
   AttendPro — Premium CSS
   Theme: Deep slate sidebar + warm white content
   Fonts: Syne (headings) + Instrument Sans (body)
───────────────────────────────────────────── */

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

/* ── Variables ── */
:root {
    /* Sidebar */
    --sidebar-bg:      #0F1623;
    --sidebar-border:  #1E2A3A;
    --sidebar-text:    #8B9BB4;
    --sidebar-active:  #1E3A5F;
    --sidebar-hover:   #162030;
    --sidebar-accent:  #3B82F6;
    --sidebar-width:   240px;

    /* Content */
    --bg:              #F6F5F0;
    --surface:         #FFFFFF;
    --surface-2:       #F0EEE8;
    --border:          #E5E3DB;
    --border-dark:     #D0CEC4;

    /* Typography */
    --text:            #1A1915;
    --text-2:          #6B6860;
    --text-3:          #A8A69E;

    /* Accent */
    --blue:            #2563EB;
    --blue-light:      #EFF6FF;
    --blue-dark:       #1D4ED8;

    /* Status colors */
    --green:           #16A34A;
    --green-bg:        #F0FDF4;
    --green-border:    #BBF7D0;
    --green-text:      #15803D;

    --red:             #DC2626;
    --red-bg:          #FEF2F2;
    --red-border:      #FECACA;
    --red-text:        #B91C1C;

    --amber:           #D97706;
    --amber-bg:        #FFFBEB;
    --amber-border:    #FDE68A;
    --amber-text:      #B45309;

    /* Radius */
    --r-sm:  6px;
    --r-md:  10px;
    --r-lg:  14px;
    --r-xl:  20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Instrument Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── Layout: Sidebar + Content ── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-brand .brand-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-brand .brand-name {
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.3px;
}
.sidebar-brand .brand-sub {
    font-size: 10px;
    color: var(--sidebar-text);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}
.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 0.75rem 0.5rem 0.4rem;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: 'Instrument Sans', sans-serif;
}
.nav-item:hover { background: var(--sidebar-hover); color: #C8D3E8; }
.nav-item.active {
    background: var(--sidebar-active);
    color: #FFFFFF;
}
.nav-item.active .nav-icon { color: var(--sidebar-accent); }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--sidebar-border);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    margin-bottom: 8px;
}
.sidebar-user .user-avatar {
    width: 32px; height: 32px;
    background: var(--sidebar-active);
    border: 1px solid var(--sidebar-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--sidebar-accent);
    flex-shrink: 0;
}
.sidebar-user .user-name { font-size: 13px; color: #C8D3E8; font-weight: 500; }
.sidebar-user .user-role { font-size: 11px; color: var(--sidebar-text); }
.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px;
    border-radius: var(--r-sm);
    border: 1px solid #1E2A3A;
    background: transparent;
    color: #EF4444;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Instrument Sans', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-logout:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); }

/* ── Main Content Area ── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    
    background: var(--sidebar-hover);
    border-bottom: 1px solid var(--border);
    padding: 0 1.75rem;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-title {
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color:white;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date {
    font-size: 14px;
    color: black;
    font-family: 'JetBrains Mono', monospace;
    background: var(--surface-2);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.page-body { padding: 1.75rem; flex: 1; }

/* ── Page Header ── */
.page-header { margin-bottom: 1.75rem; }
.page-header h1 {
    font-family: 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.page-header p { font-size: 13.5px; color: var(--text-2); }

/* ── Stat Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 1.75rem;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.stat-card.blue::before  { background: linear-gradient(90deg, #2563EB, #3B82F6); }
.stat-card.green::before { background: linear-gradient(90deg, #16A34A, #22C55E); }
.stat-card.red::before   { background: linear-gradient(90deg, #DC2626, #EF4444); }
.stat-card.amber::before { background: linear-gradient(90deg, #D97706, #F59E0B); }

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}
.stat-value {
    font-family: 'Inter', sans-serif;
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.stat-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 6px;
}
.stat-icon {
    position: absolute;
    top: 1.25rem; right: 1.25rem;
    width: 36px; height: 36px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon.blue  { background: var(--blue-light); color: var(--blue); }
.stat-icon.green { background: var(--green-bg);   color: var(--green); }
.stat-icon.red   { background: var(--red-bg);     color: var(--red); }
.stat-icon.amber { background: var(--amber-bg);   color: var(--amber); }

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}
.card-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.card-title {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.card-body { padding: 1.5rem; }

/* ── Two Column Grid ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-dark);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-danger  { background: var(--red-bg); color: var(--red-text); border-color: var(--red-border); }
.btn-danger:hover  { background: #FEE2E2; }
.btn-success { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.btn-success:hover { background: #DCFCE7; }
.btn-amber   { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-border); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-xs { padding: 3px 9px; font-size: 12px; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.form-control {
    width: 100%;
    padding: 9px 12px;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 14px;
    border: 1px solid var(--border-dark);
    border-radius: var(--r-sm);
    background:rgba(224, 255, 255, 0.384);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}
.form-control.date-field { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

/* ── Tables ── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
    text-align: left;
    padding: 11px 16px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background:var(--blue-dark);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: #FAFAF7; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    border: 1px solid transparent;
}
.badge-green { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.badge-red   { background: var(--red-bg);   color: var(--red-text);   border-color: var(--red-border); }
.badge-amber { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-border); }
.badge-blue  { background: var(--blue-light); color: var(--blue-dark); border-color: #BFDBFE; }
.badge-gray  { background: var(--surface-2);  color: var(--text-2);   border-color: var(--border); }

/* ── Avatar ── */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--blue-light);
    color: var(--blue-dark);
}
.avatar-xs { width: 26px; height: 26px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 54px; height: 54px; font-size: 18px; }

/* ── Attendance Toggle Buttons ── */
.att-row { display: flex; gap: 4px; }
.att-btn {
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid var(--border-dark);
    background: var(--surface-2);
    color: var(--text-3);
    font-family: 'Inter', sans-serif;
    transition: all 0.12s;
    text-decoration: none;
}
.att-btn:hover { transform: scale(1.08); border-color: var(--border-dark); }
.att-btn.active-P { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.att-btn.active-A { background: var(--red-bg);   color: var(--red-text);   border-color: var(--red-border); }
.att-btn.active-L { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-border); }

/* ── Flash messages ── */
.flash {
    padding: 12px 16px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid;
}
.flash-success { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.flash-error   { background: var(--red-bg);   color: var(--red-text);   border-color: var(--red-border); }
.flash-info    { background: var(--blue-light); color: var(--blue-dark); border-color: #BFDBFE; }

/* ── Calendar ── */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-month-title { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 700; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-bottom: 4px; }
.cal-weekday { text-align: center; font-size: 10px; font-weight: 700; color: var(--text-3); padding: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    font-size: 11.5px;
    font-weight: 500;
    background: var(--surface-2);
    color: var(--text-3);
    text-decoration: none;
    transition: all 0.12s;
}
.cal-cell:hover { transform: scale(1.08); }
.cal-cell.today { outline: 2px solid var(--blue); outline-offset: 1px; color: var(--text); font-weight: 700; }
.cal-cell.att-P { background: var(--green-bg); color: var(--green-text); }
.cal-cell.att-A { background: var(--red-bg);   color: var(--red-text); }
.cal-cell.att-L { background: var(--amber-bg); color: var(--amber-text); }
.cal-legend { display: flex; gap: 12px; margin-top: 10px; font-size: 11.5px; color: var(--text-2); flex-wrap: wrap; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* ── Progress Bar ── */
.progress-track { height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.progress-fill.green { background: linear-gradient(90deg, #16A34A, #22C55E); }
.progress-fill.amber { background: linear-gradient(90deg, #D97706, #F59E0B); }
.progress-fill.red   { background: linear-gradient(90deg, #DC2626, #EF4444); }

/* ── Utility ── */
.flex-row     { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.mb-sm { margin-bottom: 0.75rem; }
.mb-md { margin-bottom: 1.25rem; }
.mb-lg { margin-bottom: 1.75rem; }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-amber { color: var(--amber); }
.text-muted { color: var(--text-2); }
.text-xs    { font-size: 12px; }
.fw-bold    { font-weight: 700; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-2); font-size: 14px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--sidebar-bg);
    position: relative;
    overflow: hidden;
}
.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    position: relative;
    z-index: 1;
}
.login-decoration {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}
.login-decoration::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,0.12) 0%, transparent 70%);
    top: -100px; left: -100px;
}
.login-decoration::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    bottom: 50px; left: 200px;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4rem;
}
.login-brand .icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-brand .name {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #FFFFFF;
}
.login-headline {
    font-family: 'Inter', sans-serif;
    font-size: 38px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.15;
    margin-bottom: 1rem;
}
.login-headline span { color: var(--sidebar-accent); }
.login-subtext { font-size: 15px; color: var(--sidebar-text); max-width: 340px; }
.login-features { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 12px; }
.login-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: #8B9BB4;
}
.login-feature .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--sidebar-accent);
    flex-shrink: 0;
}

/* ── Login Right Side - Premium Gradient Version ── */
.login-right {
    width: 440px;
    background: linear-gradient(145deg, #d4f0b1e2 0%, #F0EEE8 40%, #6290fa2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}


.login-card {
    width: 100%;
    max-width: 380px;
}
.login-card h2 {
    font-family: 'Inter', sans-serif;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 4px;
}
.login-card .sub { font-size: 13.5px; color: var(--text-2); margin-bottom: 1.75rem; text-align: center; }

.login-tabs {
    display: flex;
    background: var(--surface-2);
    border-radius: var(--r-sm);
    padding: 4px;
    gap: 4px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}
.login-tab {
    flex: 1;
    padding: 8px;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-2);
    border-radius: calc(var(--r-sm) - 2px);
    cursor: pointer;
    transition: all 0.15s;
}
.login-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.login-submit {
    width: 100%;
    padding: 11px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,0.35); }
.login-submit:active { transform: translateY(0); }
.login-hint { text-align: center; font-size: 11.5px; margin-top: 1rem; }
.login-hint code {
    font-family: 'JetBrains Mono', monospace;
    padding: 1px 6px;

}

/* ── Profile Header ── */
.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}
.profile-header .info h2 {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}
.profile-header .info p { font-size: 13px; color: var(--text-2); }

/* ── Hamburger Menu Button ── */
.hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-dark);
    background: var(--surface);
    cursor: pointer;
    flex-shrink: 0;
}
.hamburger:hover { background: var(--surface-2); }
.hamburger svg { pointer-events: none; }

/* ── Sidebar Overlay (mobile) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ── Responsive ── */

/* Fix: text aur page stretch hona band karo */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}
* {
    max-width: 100%;
}
/* Tables ko page stretch nahi karne dena */
.table-wrap {
    overflow-x: auto !important;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
table {
    min-width: 500px; /* table apne andar scroll karega, page nahi */
}
/* Long text wrap karo */
td, th {
    word-break: break-word;
    white-space: normal;
}
/* Mono text (IDs, dates) overflow fix */
.mono {
    word-break: break-all;
}

@media (max-width: 900px) {
    .hamburger { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 100;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .login-left { display: none; }
    .login-right { width: 100%; }
    .topbar { gap: 10px; padding: 0 1rem; }
    .page-body { padding: 1rem; }

    /* Profile header stack karo mobile pe */
    .profile-header { flex-wrap: wrap; }

    /* Buttons wrap karo */
    .flex-between { flex-wrap: wrap; }
    .flex-row { flex-wrap: wrap; }

    /* Card padding kam karo */
    .card-body { padding: 1rem; }
    .card-header { padding: 0.85rem 1rem; }

    /* Stat cards text size */
    .stat-value { font-size: 22px; }
}

@media (max-width: 500px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-body { padding: 0.75rem; }
    .topbar-date { display: none; }
    .topbar-title { font-size: 15px; }

    /* Table columns kam dikhao */
    table th:nth-child(5),
    table td:nth-child(5) { display: none; } /* 5th column hide on very small screens */

    /* Buttons chhote karo */
    .btn { padding: 6px 10px; font-size: 12px; }
    .btn-sm { padding: 4px 8px; font-size: 11px; }

    /* Stat cards aur compact */
    .stat-card { padding: 0.85rem; }
    .stat-value { font-size: 20px; }
    .stat-label { font-size: 10px; }

    /* Login card */
    .login-card h2 { font-size: 28px; }

    /* Page header */
    .page-header h1 { font-size: 18px; }
}