/* ================================================================
   MIIT TUTOR PORTAL — Premium CSS
   Theme: Dark Navy + Teal Accent
================================================================ */

:root {
    --primary: #0f172a;
    --surface: #1e293b;
    --surface2: #263347;
    --accent: #14b8a6;
    --accent2: #0ea5e9;
    --accent-glow: rgba(20, 184, 166, 0.25);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(255,255,255,0.08);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --font: 'Inter', 'Poppins', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    background: var(--primary) !important;
    color: var(--text) !important;
    font-family: var(--font) !important;
    font-size: 14px;
    height: 100%;
}

/* ── SCROLLBAR ────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* ── LAYOUT STRUCTURE ─────────────────────── */
.wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--primary);
}

.content-wrapper {
    flex: 1;
    margin-left: 260px; /* Sidebar width */
    background: var(--primary) !important;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    padding-top: 60px; /* Header height */
}

/* Sidebar Collapsed State (AdminLTE compatibility) */
.sidebar-collapse .content-wrapper { margin-left: 0; }
.sidebar-collapse .main-sidebar { transform: translateX(-260px); }

/* ── HEADER / NAVBAR ──────────────────────── */
.main-header.hdr-nav {
    position: fixed;
    top: 0; right: 0;
    left: 260px;
    height: 60px;
    z-index: 1040;
    background: rgba(30, 41, 59, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border) !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px !important;
    transition: left 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important;
}
.sidebar-collapse .main-header.hdr-nav { left: 0; }

.hdr-left, .hdr-right { display: flex; align-items: center; gap: 12px; }

.hdr-icon-btn {
    background: transparent; border: none;
    color: var(--text-muted); font-size: 1.2rem;
    cursor: pointer; transition: all 0.2s;
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.hdr-icon-btn:hover { background: var(--surface2); color: var(--accent); }

.hdr-divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

.hdr-breadcrumb { display: flex; align-items: center; gap: 10px; }
.hdr-breadcrumb-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.85rem;
    box-shadow: 0 4px 12px var(--accent-glow);
}
.hdr-breadcrumb-text { font-size: 0.9rem; color: var(--text-muted); }
.hdr-breadcrumb-text strong { color: var(--text); font-weight: 600; }

/* ── SIDEBAR — Premium Version ──────────────── */
.main-sidebar {
    width: 260px;
    height: 100vh;
    background: var(--surface) !important;
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
}

.brand-link {
    height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px !important;
    background: var(--surface2) !important;
    border-bottom: 1px solid var(--border) !important;
    text-decoration: none !important;
}
.brand-link-icon {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1rem;
}
.brand-text { font-weight: 700; font-size: 1.1rem; color: var(--accent); letter-spacing: 0.5px; line-height: 1; }
.brand-text span { display: block; font-size: 0.65rem; color: var(--text-muted); font-weight: 400; text-transform: uppercase; margin-top: 2px; }

.sb-user-panel { padding: 20px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); }
.sb-user-avatar { position: relative; width: 44px; height: 44px; border-radius: 12px; background: var(--surface2); border: 2px solid var(--accent); overflow: hidden; }
.sb-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-avatar-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 1.3rem; }
.sb-user-status { position: absolute; bottom: -1px; right: -1px; width: 10px; height: 10px; background: var(--success); border-radius: 50%; border: 2px solid var(--surface); }

.sb-user-name { color: var(--text); font-weight: 600; font-size: 0.9rem; margin-bottom: 1px; }
.sb-user-role { color: var(--text-muted); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.5px; }

.sb-nav-container { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sb-nav-list { list-style: none; padding: 0; margin: 0; }
.sb-nav-header { padding: 16px 12px 8px; font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; opacity: 0.5; }
.sb-nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; color: var(--text-muted) !important; text-decoration: none !important; font-size: 0.9rem; font-weight: 500; transition: all 0.2s; }
.sb-nav-link i { width: 20px; text-align: center; font-size: 1rem; opacity: 0.7; }
.sb-nav-link:hover { background: rgba(255,255,255,0.04); color: var(--text) !important; }
.sb-nav-link.active { background: var(--accent-glow); color: var(--accent) !important; }
.sb-nav-link.active i { opacity: 1; }
.sb-nav-link.logout:hover { background: rgba(239,68,68,0.1); color: #fca5a5 !important; }

.sb-footer { padding: 16px; margin-top: auto; }
.sb-footer-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px; }
.sb-footer-icon { width: 30px; height: 30px; border-radius: 8px; background: rgba(34,197,94,0.1); color: var(--success); display: flex; align-items: center; justify-content: center; }
.sb-footer-text strong { display: block; font-size: 0.7rem; color: var(--text); }
.sb-footer-text span { font-size: 0.6rem; color: var(--text-muted); }

/* ── CARDS ────────────────────────────────── */
.card { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow) !important; overflow: hidden; margin-bottom: 24px; }
.card-header { background: var(--surface2) !important; border-bottom: 1px solid var(--border) !important; padding: 16px 20px; }
.card-title { color: var(--text) !important; font-weight: 700; font-size: 1rem; }

/* ── ATTENDANCE PAGE UTILS ─────────────────── */
.att-wrapper { padding: 32px; min-height: calc(100vh - 60px); animation: fadeIn 0.4s ease both; }
.att-filter-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.att-filter-grid { display: grid; grid-template-columns: 1fr 240px auto; gap: 20px; align-items: flex-end; }

.att-stu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.att-stu-card {
    background: var(--surface2); border: 1px solid var(--border); border-radius: 16px;
    padding: 20px; text-align: center; position: relative; transition: all 0.3s ease;
    animation: slideUp 0.5s ease both;
}
.att-stu-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 12px 30px rgba(0,0,0,0.5); }
.att-stu-card.present { border-color: var(--success); background: rgba(34,197,94,0.03); }
.att-stu-card.absent { border-color: var(--danger); background: rgba(239,68,68,0.03); }
.att-stu-card.leave { border-color: var(--warning); background: rgba(245,158,11,0.03); }

.att-stu-avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px; border: 3px solid var(--border); transition: border-color 0.3s; padding: 2px; }
.att-stu-card.present .att-stu-avatar { border-color: var(--success); }
.att-stu-card.absent .att-stu-avatar { border-color: var(--danger); }
.att-stu-card.leave .att-stu-avatar { border-color: var(--warning); }
.att-stu-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.att-stu-name { font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: 2px; }
.att-stu-id { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 16px; }

.att-toggles { display: flex; background: var(--surface); border-radius: 12px; padding: 4px; border: 1px solid var(--border); }
.att-toggle-btn {
    flex: 1; border: none; background: transparent; border-radius: 8px; padding: 10px;
    color: var(--text-muted); font-size: 0.9rem; cursor: pointer; transition: all 0.2s;
}
.att-toggle-btn.active.present { background: var(--success); color: #fff; box-shadow: 0 4px 12px rgba(34,197,94,0.3); }
.att-toggle-btn.active.absent { background: var(--danger); color: #fff; box-shadow: 0 4px 12px rgba(239,68,68,0.3); }
.att-toggle-btn.active.leave { background: var(--warning); color: #fff; box-shadow: 0 4px 12px rgba(245,158,11,0.3); }

.att-status-capsule {
    position: absolute; top: 12px; right: 12px;
    padding: 2px 8px; border-radius: 20px; font-size: 0.65rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    background: var(--surface); border: 1px solid var(--border);
}
.att-status-capsule.present { color: var(--success); border-color: var(--success); }
.att-status-capsule.absent { color: var(--danger); border-color: var(--danger); }
.att-status-capsule.leave { color: var(--warning); border-color: var(--warning); }

/* ── BUTTONS ──────────────────────────────── */
.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none; color: #fff; border-radius: 10px; padding: 12px 24px;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
    box-shadow: 0 6px 15px var(--accent-glow); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-accent:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px var(--accent-glow); }
.btn-accent:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
    background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 8px 16px;
    border-radius: 8px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.btn-outline:hover { background: var(--surface2); color: var(--text); border-color: var(--accent); }

/* ── FORM ELEMENTS ─────────────────────────── */
.tutor-select, .tutor-input {
    background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 16px; color: var(--text); font-family: var(--font); outline: none;
    transition: all 0.2s; width: 100%;
}
.tutor-select:focus, .tutor-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ── ANIMATIONS ───────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 991px) {
    .main-sidebar { transform: translateX(-260px); }
    .content-wrapper { margin-left: 0; }
    .main-header.hdr-nav { left: 0; }
    .sidebar-open .main-sidebar { transform: translateX(0); }
    .att-filter-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   DASHBOARD — Premium Redesign
================================================================ */

.db-wrapper { padding: 0 !important; }

/* ── HERO BANNER ──────────────────────────── */
.db-hero {
    position: relative; overflow: hidden; padding: 48px 32px;
    background: linear-gradient(135deg, #0d1f35 0%, #0f2744 40%, #142a35 100%);
    border-bottom: 1px solid var(--border);
}
.db-hero::before {
    content: ''; position: absolute; top: -80px; left: -80px;
    width: 340px; height: 340px; border-radius: 50%;
    background: radial-gradient(circle, rgba(20,184,166,0.18) 0%, transparent 70%);
    animation: db-orb 8s ease-in-out infinite alternate;
}
@keyframes db-orb { 0% { transform: translate(0,0) scale(1); opacity: 0.6; } 100% { transform: translate(25px, 20px) scale(1.1); opacity: 1; } }

.db-hero-content { position: relative; z-index: 1; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.db-hero-avatar { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--accent); box-shadow: 0 0 0 6px rgba(20,184,166,0.15); overflow: hidden; }
.db-hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.db-hero-avatar-dot { position: absolute; bottom: 6px; right: 6px; width: 14px; height: 14px; background: var(--success); border-radius: 50%; border: 3px solid #0d1f35; animation: db-pulse 2s infinite; }
@keyframes db-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); } 50% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } }

.db-hero-name { font-size: 2rem; font-weight: 800; color: #fff; margin: 4px 0 8px; letter-spacing: -0.5px; }
.db-hero-greeting { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.db-hero-meta { display: flex; align-items: center; gap: 15px; color: var(--text-muted); font-size: 0.9rem; }
.db-hero-meta i { color: var(--accent); }
.db-hero-badge-today { background: rgba(20,184,166,0.15); color: var(--accent); border: 1px solid rgba(20,184,166,0.3); border-radius: 20px; padding: 4px 14px; font-size: 0.8rem; font-weight: 700; }

.db-hero-cta {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff !important; border-radius: 14px; padding: 14px 28px;
    font-weight: 700; text-decoration: none !important;
    box-shadow: 0 10px 25px rgba(20,184,166,0.3); transition: all 0.3s;
    margin-left: auto;
}
.db-hero-cta:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(20,184,166,0.4); }

/* ── STAT CARDS ───────────────────────────── */
.db-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 32px; margin-top: -20px; }
.db-stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
    padding: 24px; position: relative; overflow: hidden; transition: all 0.3s;
}
.db-stat-card:hover { transform: translateY(-5px); border-color: var(--card-accent); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.db-stat-icon-wrap { position: relative; width: 60px; height: 60px; margin-bottom: 15px; }
.db-stat-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--card-accent); transition: transform 0.3s; }
.db-stat-card:hover .db-stat-icon { transform: scale(1.1); }
.db-stat-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }

.db-stat-num { font-size: 2.2rem; font-weight: 800; color: #fff; line-height: 1; margin-bottom: 4px; }
.db-stat-label { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.db-stat-sub { font-size: 0.75rem; color: var(--text-muted); }

/* ── MAIN GRID ────────────────────────────── */
.db-main-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; padding: 0 32px 32px; }

.db-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; height: 100%; }
.db-panel-header { padding: 20px 24px; border-bottom: 1px solid var(--border); background: var(--surface2); display: flex; justify-content: space-between; align-items: center; }
.db-panel-title-text { font-size: 1.1rem; font-weight: 700; color: #fff; }
.db-panel-body { padding: 24px; }

/* Timeline Items */
.db-schedule-item { display: flex; gap: 20px; margin-bottom: 20px; }
.db-schedule-time-col { display: flex; flex-direction: column; align-items: center; width: 16px; }
.db-schedule-time-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(20,184,166,0.1); }
.db-schedule-time-line { width: 2px; flex: 1; background: var(--border); margin: 6px 0; }

.db-schedule-card { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 16px; padding: 18px; transition: all 0.2s; }
.db-schedule-card:hover { border-color: var(--accent); background: rgba(255,255,255,0.02); }
.db-schedule-name { font-weight: 700; font-size: 1.05rem; color: #fff; margin-bottom: 4px; }
.db-schedule-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; gap: 15px; }

/* Quick Actions */
.db-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.db-action-tile {
    background: var(--surface2); border: 1px solid var(--border); border-radius: 18px;
    padding: 24px 15px; display: flex; flex-direction: column; align-items: center; gap: 12px;
    transition: all 0.3s; text-decoration: none !important;
}
.db-action-tile:hover { transform: translateY(-5px); border-color: #fff; background: var(--surface); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.db-action-tile-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff; }
.db-action-tile-label { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.db-action-tile:hover .db-action-tile-label { color: #fff; }

@media (max-width: 1200px) {
    .db-stats-row { grid-template-columns: 1fr 1fr; }
    .db-main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .db-hero { padding: 32px 20px; }
    .db-hero-content { flex-direction: column; text-align: center; }
    .db-hero-cta { margin: 20px 0 0 0; width: 100%; }
    .db-stats-row { padding: 20px; grid-template-columns: 1fr; }
    .db-main-grid { padding: 0 20px 20px; }
}

/* ── PROFILE PAGE ────────────────────────── */
.profile-wrapper { padding: 32px; }

/* ── MODERN LOGIN PAGE ─────────────────── */
.login-page-modern {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--primary);
}

/* Animated Background */
.login-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px; height: 400px;
    background: var(--accent);
    top: -100px; left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px; height: 300px;
    background: var(--accent2);
    bottom: -50px; right: -50px;
    animation-delay: 5s;
}

.orb-3 {
    width: 200px; height: 200px;
    background: #8b5cf6;
    top: 50%; left: 50%;
    animation-delay: 10s;
}

.bg-grid {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Login Container */
.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1100px;
    width: 100%;
    min-height: 600px;
    z-index: 1;
    position: relative;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Left Branding Panel */
.login-brand-panel {
    background: linear-gradient(135deg, rgba(20,184,166,0.15), rgba(14,165,233,0.15));
    border: 1px solid rgba(20,184,166,0.2);
    border-radius: 24px 0 0 24px;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(20px);
}

.brand-content { height: 100%; display: flex; flex-direction: column; }

.brand-logo { margin-bottom: 48px; }

.logo-icon {
    width: 70px; height: 70px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(20,184,166,0.3);
}

.brand-title {
    font-size: 2.2rem; font-weight: 800;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.brand-subtitle {
    font-size: 1.1rem; color: var(--text-muted);
    font-weight: 500;
}

/* Features */
.brand-features { flex: 1; display: flex; flex-direction: column; gap: 24px; }

.feature-item {
    display: flex; align-items: center; gap: 16px;
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    transition: all 0.3s;
}

.feature-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--accent);
    transform: translateX(5px);
}

.feature-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-text strong {
    display: block; font-size: 0.95rem;
    color: #fff; margin-bottom: 4px;
}

.feature-text span {
    font-size: 0.8rem; color: var(--text-muted);
}

.brand-footer {
    margin-top: auto; padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem; color: var(--text-muted);
}

/* Right Login Form */
.login-form-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 24px 24px 0;
    padding: 48px 40px;
    display: flex; align-items: center;
}

.login-card-modern { width: 100%; }

.login-header { margin-bottom: 36px; }

.login-header h2 {
    font-size: 1.8rem; font-weight: 700;
    color: #fff; margin-bottom: 8px;
}

.login-header p { color: var(--text-muted); font-size: 0.9rem; }

/* Alert */
.login-alert {
    padding: 14px 18px;
    border-radius: 12px;
    display: flex; align-items: center; gap: 12px;
    font-size: 0.85rem; font-weight: 500;
    margin-bottom: 24px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.login-alert.error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    color: var(--danger);
}

/* Form */
.login-form { display: flex; flex-direction: column; gap: 24px; }

.form-group-modern { display: flex; flex-direction: column; gap: 8px; }

.form-label {
    font-size: 0.85rem; font-weight: 600;
    color: var(--text); display: flex;
    align-items: center; gap: 8px;
}

.form-label i { color: var(--accent); }

.input-wrapper {
    position: relative;
    display: flex; align-items: center;
}

.form-input {
    width: 100%; height: 52px;
    padding: 0 20px 0 48px;
    background: var(--surface2);
    border: 2px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.3s;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(20,184,166,0.15);
    background: rgba(20,184,166,0.05);
}

.form-input::placeholder { color: var(--text-muted); }

.input-icon {
    position: absolute; left: 16px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.3s;
}

.input-wrapper:focus-within .input-icon { color: var(--accent); }

.input-wrapper .toggle-pass {
    left: auto; right: 16px;
    cursor: pointer; pointer-events: all;
}

.input-wrapper .toggle-pass:hover { color: var(--accent); }

/* Options */
.form-options {
    display: flex; justify-content: space-between;
    align-items: center;
}

.remember-me {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; color: var(--text-muted);
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--accent);
}

/* Login Button */
.btn-login-modern {
    width: 100%; height: 52px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none; border-radius: 14px;
    color: #fff; font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: all 0.3s;
    position: relative; overflow: hidden;
}

.btn-login-modern::before {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-login-modern:hover::before { left: 100%; }

.btn-login-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(20,184,166,0.4);
}

.btn-login-modern:disabled {
    opacity: 0.6; cursor: not-allowed;
    transform: none;
}

.btn-login-modern:disabled::before { display: none; }

.btn-content {
    display: flex; align-items: center;
    justify-content: center; gap: 10px;
}

/* Divider */
.login-divider {
    display: flex; align-items: center;
    gap: 16px; margin: 24px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1; height: 1px;
    background: var(--border);
}

.login-divider span {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Help */
.login-help {
    text-align: center;
    padding: 16px;
    background: rgba(20,184,166,0.05);
    border: 1px solid rgba(20,184,166,0.1);
    border-radius: 12px;
}

.login-help p {
    font-size: 0.85rem; color: var(--text-muted);
    margin: 0;
}

.login-help i { color: var(--accent); margin-right: 6px; }

/* Responsive */
@media (max-width: 968px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 440px;
    }
    .login-brand-panel {
        display: none;
    }
    .login-form-panel {
        border-left: 1px solid var(--border);
        border-radius: 24px;
    }
}

/* ── CALENDAR VIEW ───────────────────── */
.calendar-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.calendar-nav {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}

.calendar-nav:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.calendar-month-label {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.cal-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-day {
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: default;
    transition: all 0.2s;
    background: var(--surface2);
    border: 1px solid transparent;
}

.cal-day.empty {
    background: transparent;
    border: none;
}

.cal-day.has-class {
    background: rgba(20,184,166,0.08);
    border: 1px solid rgba(20,184,166,0.2);
    cursor: pointer;
}

.cal-day.has-attendance {
    background: rgba(34,197,94,0.12);
    border-color: rgba(34,197,94,0.3);
}

.cal-attendance-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    margin: 0 auto;
    box-shadow: 0 0 6px rgba(34,197,94,0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.cal-day.has-class:hover {
    border-color: var(--accent);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(20,184,166,0.2);
}

.cal-day.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.cal-day-num {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.cal-day.selected .cal-day-num {
    color: #fff;
}

.cal-day-batches {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
}

.cal-batch-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    transition: all 0.2s;
}

.cal-day.has-class:hover .cal-batch-dot {
    transform: scale(1.3);
}

/* Calendar Stats */
.calendar-stat {
    text-align: center;
    padding: 8px 16px;
    background: var(--surface2);
    border-radius: 10px;
}

.calendar-stat-num {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.calendar-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 24px;
    text-align: center;
    box-shadow: var(--shadow);
}

.profile-avatar-section { margin-bottom: 20px; }

.profile-avatar-xl {
    width: 120px; height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.profile-avatar-xl:hover {
    border-color: var(--accent2);
    box-shadow: 0 0 30px var(--accent-glow);
}

.profile-avatar-xl img { width: 100%; height: 100%; object-fit: cover; }

.avatar-upload-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 50%;
}

.profile-avatar-xl:hover .avatar-upload-overlay {
    opacity: 1;
}

.avatar-upload-overlay i {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.profile-avatar-fallback-xl {
    width: 120px; height: 120px;
    border-radius: 50%;
    background: var(--surface2);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--text-muted);
    margin: 0 auto 16px;
    border: 3px solid var(--accent);
}

.profile-name-xl { font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: 8px; }

.profile-role-badge {
    display: inline-block;
    background: rgba(20,184,166,0.15);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.profile-meta-xl { display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; color: var(--text-muted); }

.profile-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.profile-stat-item { text-align: center; }

.profile-stat-num { font-size: 1.5rem; font-weight: 800; color: var(--accent); line-height: 1; }

.profile-stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Edit Card */
.profile-edit-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.profile-edit-header { margin-bottom: 24px; }

.profile-edit-header h4 { font-size: 1.2rem; font-weight: 700; color: #fff; margin-bottom: 4px; }

/* Info Box */
.profile-info-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(14,165,233,0.08);
    border: 1px solid rgba(14,165,233,0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
}

.profile-info-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--accent2);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.1rem;
}

.profile-info-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.profile-info-value { font-size: 0.95rem; font-weight: 600; color: #fff; }

.profile-save-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }

.btn-lg { padding: 12px 32px; font-size: 1rem; }

.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.25); color: var(--success); }

.alert-danger { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); color: var(--danger); }

.alert-warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25); color: var(--warning); }

.gap-2 { gap: 8px; }
/* ============================================================
   HISTORY / CALENDAR
   ============================================================ */

.calendar-wrapper {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-month-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.calendar-nav {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-nav:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.calendar-grid {
    margin-bottom: 16px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.cal-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 0;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: var(--surface2);
}

.cal-day:hover {
    background: rgba(20, 184, 166, 0.1);
}

.cal-day.empty {
    background: transparent;
    cursor: default;
}

.cal-day.has-class {
    background: rgba(20, 184, 166, 0.08);
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.cal-day.has-attendance {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.cal-day.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.cal-day.selected .cal-day-num {
    color: white;
}

.cal-day-num {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.cal-attendance-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    position: absolute;
    bottom: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.cal-day-batches {
    display: flex;
    gap: 2px;
    position: absolute;
    bottom: 4px;
}

.cal-batch-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cal-batch-dot:hover {
    transform: scale(1.5);
}

.calendar-stat {
    text-align: center;
    padding: 8px 16px;
    background: var(--surface2);
    border-radius: 8px;
}

.calendar-stat-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.calendar-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Attendance status capsules */
.att-status-capsule {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.att-status-capsule.present {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.att-status-capsule.absent {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.att-status-capsule.leave {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

/* ============================================================
   MODALS
   ============================================================ */

.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}

.modal-container {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 9999;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

/* ============================================================
   STUDENT GRID VIEW
   ============================================================ */

.student-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 12px 0;
}

.student-card {
    background: var(--surface2);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.student-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.student-card.present {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.08);
}

.student-card.absent {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.student-card.leave {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.08);
}

.student-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 8px;
    border: 2px solid var(--border);
}

.student-card.present .student-avatar {
    border-color: var(--success);
}

.student-card.absent .student-avatar {
    border-color: var(--danger);
}

.student-card.leave .student-avatar {
    border-color: var(--warning);
}

.student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-info {
    margin-bottom: 8px;
}

.student-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-mobile {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.student-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.student-status.present {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.student-status.absent {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.student-status.leave {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

/* Responsive grid */
@media (max-width: 768px) {
    .student-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .student-grid {
        grid-template-columns: 1fr;
    }
}

.batch-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.batch-card:hover {
    background: rgba(20,184,166,0.08);
    border-color: rgba(20,184,166,0.3);
}

.batch-card.active {
    background: rgba(20,184,166,0.12);
    border-color: var(--accent);
}

/* Attendance status colors for batch cards */
.batch-card.attendance-yes {
    border-color: #eab308;  /* yellow-500 */
    background: rgba(234, 179, 8, 0.08);
}

.batch-card.attendance-no {
    border-color: #ef4444;  /* red-500 */
    background: rgba(239, 68, 68, 0.08);
}

.batch-card.attendance-yes:hover {
    border-color: #ca8a04;  /* yellow-600 */
    background: rgba(234, 179, 8, 0.12);
}

.batch-card.attendance-no:hover {
    border-color: #dc2626;  /* red-600 */
    background: rgba(239, 68, 68, 0.12);
}

.batch-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.batch-card-body {
    flex: 1;
}

.batch-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.batch-card-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.batch-card-meta i {
    margin-right: 4px;
}

.batch-card-status {
    flex-shrink: 0;
}
