* { margin:0; padding:0; box-sizing:border-box; }

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/webfonts/Vazirmatn-Thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/webfonts/Vazirmatn-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/webfonts/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/webfonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/webfonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/webfonts/Vazirmatn-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/webfonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #FF6B6B;
    --accent: #A29BFE;
    --info: #54A0FF;
    --warning: #FFE66D;
    --success: #00B894;
    --danger: #FF4757;
    --gray: #8892B0;
}

body { font-family: 'Vazirmatn', Vazirmatn, Tahoma, 'Segoe UI', sans-serif; background:#F0F0FF; color:#2D3436; min-height:100vh; overflow-x:hidden; }

/* ===== ANIMATED BG ===== */
.animated-bg {
    position: fixed; top:0; left:0; width:100%; height:100%;
    z-index: -1; overflow: hidden;
}
.animated-bg .orb {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.25;
    animation: float 20s infinite ease-in-out;
}
.animated-bg .orb-1 {
    width:400px;height:400px;
    background: linear-gradient(135deg,#FF6B6B,#FD79A8);
    top:-100px; right:-100px;
}
.animated-bg .orb-2 {
    width:300px;height:300px;
    background: linear-gradient(135deg,#4ECDC4,#54A0FF);
    bottom:-50px; left:-50px;
    animation-delay: -7s;
}
.animated-bg .orb-3 {
    width:200px;height:200px;
    background: linear-gradient(135deg,#FFE66D,#FF9F43);
    top:50%; left:50%;
    animation-delay: -14s;
}
@keyframes float {
    0%,100%{transform:translate(0,0) scale(1)}
    25%{transform:translate(60px,-40px) scale(1.1)}
    50%{transform:translate(-30px,30px) scale(0.9)}
    75%{transform:translate(20px,50px) scale(1.05)}
}

/* ===== PARTICLES ===== */
.particles {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: -1; overflow: hidden;
}
.particle {
    position: absolute; border-radius: 50%;
    background: rgba(255,107,107,0.1);
    animation: float 20s infinite ease-in-out;
}

/* ===== LOGIN ===== */
.login-container { display:flex; justify-content:center; align-items:flex-start; min-height:100vh; position:relative; overflow-x:hidden; overflow-y:auto; padding:24px 12px; }
.login-container > .login-box, .login-container > .login-stack { margin:auto; }
.login-stack { display:flex; flex-direction:column; width:95%; max-width:480px; gap:14px; position:relative; z-index:10; }
.login-stack > .login-box { width:100%; max-width:100%; }
.app-download-box {
    width:100%; background:rgba(255,255,255,0.95); backdrop-filter:blur(20px);
    border-radius:20px; padding:18px 20px; display:flex; align-items:center; gap:14px;
    box-shadow:0 12px 32px rgba(255,107,107,0.18), 0 0 0 1px rgba(255,255,255,0.5);
    animation:slideUp 0.7s ease-out 0.15s backwards;
}
.app-download-icon {
    width:52px; height:52px; flex-shrink:0; border-radius:14px;
    background:linear-gradient(135deg,#0F9D58,#0B7A43);
    display:flex; align-items:center; justify-content:center; font-size:26px;
    box-shadow:0 6px 16px rgba(15,157,88,0.35);
}
.app-download-info { flex:1; min-width:0; }
.app-download-info h3 { margin:0 0 3px; font-size:15px; font-weight:700; color:#2D3436; }
.app-download-info p { margin:0; font-size:12px; color:#8892b0; line-height:1.7; }
.app-download-btn {
    display:inline-flex; align-items:center; gap:7px; flex-shrink:0;
    padding:11px 18px; border-radius:12px; background:linear-gradient(135deg,#0F9D58,#0B7A43);
    color:#fff; font-size:13px; font-weight:700; text-decoration:none; white-space:nowrap;
    box-shadow:0 6px 16px rgba(15,157,88,0.3); transition:transform 0.2s, box-shadow 0.2s;
}
.app-download-btn:hover { transform:translateY(-2px); box-shadow:0 10px 22px rgba(15,157,88,0.4); color:#fff; }
.app-download-btn.is-disabled {
    background:#dfe4ea; color:#8892b0; box-shadow:none; cursor:not-allowed; pointer-events:none;
}
@media (max-width:480px) {
    .app-download-box { flex-wrap:wrap; padding:16px; }
    .app-download-btn { width:100%; justify-content:center; }
}
.login-box {
    background:rgba(255,255,255,0.95); backdrop-filter:blur(20px);
    border-radius:28px; padding:55px 45px; width:480px; max-width:95%;
    box-shadow:0 24px 64px rgba(255,107,107,0.25), 0 0 0 1px rgba(255,255,255,0.5);
    position:relative; z-index:10; animation:slideUp 0.7s ease-out;
}
@keyframes slideUp { from{opacity:0;transform:translateY(40px)} to{opacity:1;transform:translateY(0)} }
.login-logo {
    width:80px; height:80px; margin:0 auto 20px;
    background:linear-gradient(135deg,#FF6B6B,#FD79A8,#A29BFE,#54A0FF,#4ECDC4,#FFE66D);
    background-size:300% 300%; border-radius:50%; display:flex;
    align-items:center; justify-content:center; font-size:40px;
    box-shadow:0 8px 24px rgba(255,107,107,0.3); animation:bounce 2s infinite;
}
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.login-header { text-align:center; margin-bottom:20px; }
.login-header h1 {
    font-size:28px; font-weight:800; margin-bottom:6px;
    background:linear-gradient(135deg,#FF6B6B,#FD79A8,#A29BFE,#54A0FF,#4ECDC4,#FFE66D);
    background-size:300% 300%; -webkit-background-clip:text; -webkit-text-fill-color:transparent;
    background-clip:text; animation:gradientFlow 5s ease infinite;
}
@keyframes gradientFlow { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
.login-header p { color:#8892B0; font-size:14px; margin-bottom:16px; }

/* ===== LOGIN FEATURES ===== */
.login-features { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:24px; }
.login-feature { display:flex; align-items:center; gap:8px; padding:10px 14px;
    background:linear-gradient(135deg,rgba(255,107,107,0.06),rgba(162,155,254,0.06));
    border:1px solid rgba(0,0,0,0.04); border-radius:12px; font-size:13px; color:#555;
    transition:all 0.3s; cursor:default; }
.login-feature:hover { border-color:rgba(255,107,107,0.2); transform:translateY(-2px);
    box-shadow:0 4px 12px rgba(255,107,107,0.1); }
.login-feature-icon { font-size:18px; }

/* Login features on small screens - stack to 1 column */
@media (max-width:480px) {
    .login-features { grid-template-columns: 1fr; }
}

/* Voc hero on mobile */
@media (max-width:768px) {
    .voc-hero {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 12px;
    }
    .voc-hero-icon { width: 50px; height: 50px; font-size: 32px; }
    .voc-hero-title { font-size: 16px; }
    .voc-hero-desc { font-size: 12px; }
    .voc-hero-arrow { margin-right: 0; margin-top: 8px; }
}

/* ===== TOGGLE PASSWORD ===== */
.toggle-pass { position:absolute; left:14px; top:50%; transform:translateY(-50%); z-index:5; cursor:pointer; font-size:18px; opacity:0.7; transition:opacity 0.3s, color 0.3s; user-select:none; }
.toggle-pass:hover { opacity:1; color:#FF6B6B; }
.pass-toggle-btn { position:absolute; left:14px; top:50%; transform:translateY(-50%); z-index:5; background:transparent; border:none; cursor:pointer; padding:2px 6px; color:#7C70DC; transition:color 0.3s; display:flex; align-items:center; justify-content:center; font-size:18px; }
.pass-toggle-btn:hover { color:#FF6B6B; }
.pass-toggle-btn .eye-icon { stroke:currentColor; }

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

/* ===== SIDEBAR ===== */
.sidebar {
    width:280px;
    background:linear-gradient(180deg,#FFFFFF 0%,#F8F9FA 30%,#FFFFFF 60%,#F1F3F5 100%);
    color:#2D3436; position:fixed; right:0; top:0; height:100vh; height:100dvh; overflow:hidden; z-index:100;
    box-shadow:-6px 0 24px rgba(0,0,0,0.08); border-left:1px solid rgba(0,0,0,0.04);
    display:flex; flex-direction:column;
}
.sidebar-header { padding:30px 25px; border-bottom:1px solid rgba(0,0,0,0.04); text-align:center; position:relative; flex-shrink:0; }
.sidebar-logo { width:65px; height:65px; margin:0 auto 12px;
    background:linear-gradient(135deg,#FF6B6B,#FD79A8,#A29BFE,#54A0FF,#4ECDC4,#FFE66D);
    background-size:300% 300%; border-radius:50%; display:inline-flex;
    align-items:center; justify-content:center; font-size:30px;
    box-shadow:0 4px 20px rgba(255,107,107,0.2); animation:gradientFlow 4s ease infinite;
}
.sidebar-header h2 { font-size:20px; font-weight:700; color:#2D3436; }
.sidebar-header p { font-size:11px; color:#8892B0; margin-top:4px; }
.sidebar-nav { padding:15px 0; flex:1; overflow-y:auto; overscroll-behavior:contain; }
.sidebar-nav a {
    display:flex; align-items:center; gap:14px; padding:14px 25px;
    color:rgba(45,52,54,0.85); text-decoration:none; font-size:14px; font-weight:500;
    transition:all 0.3s cubic-bezier(0.4,0,0.2,1); border-left:3px solid transparent;
    position:relative; overflow:hidden;
}
.sidebar-nav a::before {
    content:''; position:absolute; right:0; top:0; width:0; height:100%;
    background:linear-gradient(90deg,rgba(255,107,107,0.08),transparent);
    transition:width 0.3s ease; z-index:0;
}
.sidebar-nav a:hover::before, .sidebar-nav a.active::before { width:100%; }
.sidebar-nav a>* { position:relative; z-index:1; }
.sidebar-nav a:hover { color:#FF6B6B; border-left-color:#FF6B6B; }
.sidebar-nav a.active { color:#FF6B6B; border-left-color:#FF6B6B; background:rgba(255,107,107,0.05); }
.sidebar-nav a .nav-icon { width:38px; height:38px; border-radius:12px;
    background:rgba(255,107,107,0.05); display:flex; align-items:center;
    justify-content:center; font-size:18px; transition:all 0.3s; color:#2D3436; }
.sidebar-nav a:hover .nav-icon, .sidebar-nav a.active .nav-icon {
    background:linear-gradient(135deg,#FF6B6B,#FD79A8,#A29BFE);
    box-shadow:0 4px 16px rgba(255,107,107,0.3); font-size:20px; color:#fff;
}
.sidebar-nav a.sidebar-search-link,
.sidebar-nav a.sidebar-messages-link {
    margin-top:8px;
    border-top:1px solid rgba(0,0,0,0.05);
}
.sidebar-nav a.logout { margin-top:30px; color:rgba(255,71,87,0.8); }
.sidebar-nav a.logout:hover { color:#FF4757; border-left-color:#FF4757; }

/* ===== NOTIFICATIONS ===== */
.notification-container { position:relative; margin-top:10px; }
.notification-btn {
    background:rgba(255,107,107,0.05);
    border:1px solid rgba(255,107,107,0.1);
    border-radius:12px;
    width:42px;
    height:42px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:20px;
    cursor:pointer;
    transition:all 0.2s;
    position:absolute;
    top:5px;
    left:10px;
    z-index:10;
}
.notification-btn:hover {
    background:rgba(255,107,107,0.15);
    transform:scale(1.1);
}
.notification-badge {
    position:absolute;
    top:-2px;
    right:-2px;
    background:#FF4757;
    color:#fff;
    font-size:10px;
    font-weight:700;
    border-radius:50%;
    width:20px;
    height:20px;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 2px 8px rgba(255,71,87,0.3);
}
.notification-dropdown {
    position:absolute;
    top:50px;
    left:0;
    right:0;
    background:#fff;
    border:1px solid rgba(0,0,0,0.1);
    border-radius:16px;
    box-shadow:0 10px 40px rgba(0,0,0,0.15);
    max-height:400px;
    overflow:hidden;
    display:none;
    direction:rtl;
    z-index:100;
}
.notification-container.open .notification-dropdown { display:block; }
.notification-header {
    padding:12px 16px;
    border-bottom:1px solid rgba(0,0,0,0.05);
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-size:13px;
}
.notification-mark-all {
    color:#FF6B6B;
    cursor:pointer;
    font-weight:500;
}
.notification-list { max-height:300px; overflow-y:auto; }
.notification-item {
    padding:12px 16px;
    border-bottom:1px solid rgba(0,0,0,0.03);
    cursor:pointer;
    transition:background 0.2s;
}
.notification-item:hover { background:rgba(255,107,107,0.03); }
.notification-title {
    font-size:13px;
    font-weight:600;
    color:#2D3436;
    margin-bottom:4px;
}
.notification-text {
    font-size:12px;
    color:#636E72;
    line-height:1.4;
}
.notification-time {
    font-size:11px;
    color:#B2BEC3;
    margin-top:4px;
}
.notification-empty {
    padding:20px;
    text-align:center;
    color:#B2BEC3;
    font-size:13px;
}
.notification-footer {
    padding:10px 16px;
    border-top:1px solid rgba(0,0,0,0.05);
    text-align:center;
}
.notification-footer a {
    color:#FF6B6B;
    text-decoration:none;
    font-size:13px;
    font-weight:500;
}

.sidebar-toggle {
    display:none;
    position:fixed;
    top:20px;
    left:20px;
    width:44px;
    height:44px;
    border-radius:14px;
    background:rgba(255,255,255,0.95);
    border:1px solid rgba(0,0,0,0.04);
    box-shadow:0 4px 16px rgba(255,107,107,0.2);
    z-index:100;
    align-items:center;
    justify-content:center;
    font-size:20px;
    cursor:pointer;
    backdrop-filter:blur(10px);
    transition:all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-toggle:hover {
    background:rgba(255,255,255,1);
    box-shadow:0 6px 20px rgba(255,107,107,0.3);
    transform:scale(1.05);
}
/* دکمه منو داخل هدر: سمت راست کنار تیتر، ثابت در جریان صفحه (نه شناور) */
.topbar .sidebar-toggle {
    position:static;
    width:42px;
    height:42px;
    flex-shrink:0;
    box-shadow:0 2px 8px rgba(255,107,107,0.15);
}
.sidebar-overlay {
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.5);
    z-index:99;
}
.sidebar-close {
    display:none;
    position:absolute;
    top:20px;
    left:20px;
    background:transparent;
    border:none;
    font-size:24px;
    cursor:pointer;
    color:#8892B0;
    z-index:101;
    transition:color 0.3s;
}
.sidebar-close:hover { color:#FF6B6B; }

/* Sidebar expanded state (icon-only -> full sidebar) */
.sidebar-expanded .sidebar { width:260px; }
.sidebar-expanded .sidebar-header h2,
.sidebar-expanded .sidebar-header p,
.sidebar-expanded .sidebar-nav a span:not(.nav-icon) { display:inline; }
.sidebar-expanded .sidebar-nav a { justify-content:flex-start; padding:14px 25px; }
.sidebar-expanded .sidebar-nav a .nav-icon { margin-left:14px; }
.sidebar-expanded .sidebar-close { display:block; }
.sidebar-expanded .sidebar-overlay { display:block; }
.sidebar-expanded .sidebar-toggle { display:none; }
.sidebar-expanded .main-content { margin-right:260px !important; }

/* ===== MAIN ===== */
.main-content { flex:1; margin-right:280px; min-height:100vh; }

/* ===== TOPBAR ===== */
.topbar {
    background:linear-gradient(135deg,rgba(255,255,255,0.95),rgba(255,240,245,0.85),rgba(240,255,250,0.9));
    backdrop-filter:blur(12px); padding:18px 30px; display:flex;
    justify-content:space-between; align-items:center; position:sticky; top:0;
    z-index:50; border-bottom:2px solid rgba(255,107,107,0.12);
}
.topbar h1 { font-size:22px; font-weight:800;
    background:linear-gradient(135deg,#FF6B6B,#FD79A8,#A29BFE,#54A0FF);
    background-size:200% 200%; -webkit-background-clip:text; -webkit-text-fill-color:transparent;
    background-clip:text; animation:gradientFlow 6s ease infinite;
}

/* ===== USER CHIP ===== */
.user-chip { display:flex; align-items:center; gap:12px;
    background:linear-gradient(135deg,rgba(255,107,107,0.1),rgba(78,205,196,0.08),rgba(255,230,109,0.06));
    padding:8px 16px 8px 8px; border-radius:50px; border:1px solid rgba(255,107,107,0.12);
}
.user-chip-avatar { width:38px; height:38px; border-radius:50%;
    background:linear-gradient(135deg,#FF6B6B,#FD79A8,#A29BFE);
    display:flex; align-items:center; justify-content:center;
    color:#fff; font-weight:700; font-size:15px;
    box-shadow:0 2px 8px rgba(255,107,107,0.2); }
.user-chip-info { display:flex; flex-direction:column; }
.user-chip-name { font-size:13px; font-weight:600; color:#2D3436; }
.user-chip-role { font-size:11px; color:#FF6B6B; font-weight:500; }

.content { padding:30px; }

/* ===== TOOLBAR ===== */
.toolbar { padding:20px 30px; background:rgba(255,255,255,0.95); border-bottom:1px solid rgba(0,0,0,0.04); flex-wrap:wrap; gap:15px; }

/* ===== LOGIN SPECIFIC ===== */
.login-container { background: linear-gradient(135deg, #FF6B6B20, #FD79A820, #A29BFE20); }

/* ===== STATS ===== */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:20px; margin-bottom:30px; }
.stat-card { background:#fff; border-radius:20px; padding:24px; display:flex;
    align-items:center; gap:18px; box-shadow:0 4px 12px rgba(255,107,107,0.1);
    transition:all 0.4s cubic-bezier(0.4,0,0.2,1); position:relative;
    overflow:hidden; border:1px solid rgba(0,0,0,0.04); cursor:pointer; }
.stat-card::before { content:''; position:absolute; top:0; left:0; width:4px; height:100%;
    border-radius:0 4px 4px 0; transition:width 0.3s; }
.stat-card:hover { transform:translateY(-8px); box-shadow:0 16px 40px rgba(255,107,107,0.2); }
.stat-card:hover::before { width:6px; }
.stat-icon-wrap { width:60px; height:60px; border-radius:14px; display:flex;
    align-items:center; justify-content:center; font-size:26px; flex-shrink:0; }
.stat-info h3 { font-size:26px; font-weight:800; line-height:1; margin-bottom:4px; color:#2D3436; }
.stat-info p { color:#8892B0; font-size:12px; font-weight:500; }
.stat-card.total .stat-icon-wrap { background:linear-gradient(135deg,#FF6B6B,#FD79A8,#A29BFE); box-shadow:0 4px 16px rgba(255,107,107,0.2); }
.stat-card.total::before { background:linear-gradient(180deg,#FF6B6B,#FD79A8); }
.stat-card.students .stat-icon-wrap { background:linear-gradient(135deg,#00B894,#00CEC9,#4ECDC4); box-shadow:0 4px 16px rgba(0,184,148,0.2); }
.stat-card.students::before { background:linear-gradient(180deg,#00B894,#00CEC9); }
.stat-card.teachers .stat-icon-wrap { background:linear-gradient(135deg,#54A0FF,#A29BFE,#FD79A8); box-shadow:0 4px 16px rgba(84,160,255,0.2); }
.stat-card.teachers::before { background:linear-gradient(180deg,#54A0FF,#A29BFE); }
    .stat-card.admins .stat-icon-wrap { background:linear-gradient(135deg,#FFE66D,#FF9F43,#E17055); box-shadow:0 4px 16px rgba(253,203,110,0.2); }
    .stat-card.admins::before { background:linear-gradient(180deg,#FFE66D,#FF9F43); }
    .stat-card.managers .stat-icon-wrap { background:linear-gradient(135deg,#6366f1,#8b5cf6,#a855f7); box-shadow:0 4px 16px rgba(168,85,247,0.2); }
    .stat-card.managers::before { background:linear-gradient(180deg,#6366f1,#8b5cf6); }
.stat-card.present .stat-icon-wrap { background:linear-gradient(135deg,#00B894,#4ECDC4,#FFE66D); box-shadow:0 4px 16px rgba(0,184,148,0.2); }
.stat-card.present::before { background:linear-gradient(180deg,#00B894,#4ECDC4); }
.stat-card.absent .stat-icon-wrap { background:linear-gradient(135deg,#FF4757,#FF6B6B,#FD79A8); box-shadow:0 4px 16px rgba(255,71,87,0.2); }
    .stat-card.absent::before { background:linear-gradient(180deg,#FF4757,#FF6B6B); }
    .stat-card.late { background:linear-gradient(135deg,#FFE66D,#FF9F43,#E17055); box-shadow:0 4px 16px rgba(255,159,67,0.2); }
    .stat-card.late .stat-icon-wrap { background:linear-gradient(135deg,#FFE66D,#FF9F43); box-shadow:0 4px 16px rgba(255,159,67,0.2); }
    .stat-card.late::before { background:linear-gradient(180deg,#FFE66D,#FF9F43); }

/* ===== CARDS ===== */
.card { background:#fff; border-radius:20px; padding:28px; margin-bottom:25px;
    box-shadow:0 4px 12px rgba(255,107,107,0.1); border:1px solid rgba(0,0,0,0.04);
    transition:box-shadow 0.3s; }
.card:hover { box-shadow:0 8px 24px rgba(255,107,107,0.15); }
.card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; }
.card-header h3 { font-size:18px; font-weight:700; color:#2D3436; display:flex; align-items:center; gap:10px; }
.card-icon { width:42px; height:42px; border-radius:12px; display:flex; align-items:center;
    justify-content:center; font-size:22px;
    background:linear-gradient(135deg,rgba(255,107,107,0.15),rgba(78,205,196,0.08)); }

/* ===== FORMS ===== */
.form-row { display:flex; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.form-group { flex:1; min-width:200px; position:relative; }
.form-group label { display:block; margin-bottom:6px; font-weight:600; color:#555; font-size:13px; }
.form-group input, .form-group select, .form-group textarea,
.form-input {
    width:100%; padding:12px 16px; border:2px solid #E8ECF1; border-radius:14px;
    font-size:14px; font-family:'Vazirmatn', Tahoma; transition:all 0.3s cubic-bezier(0.4,0,0.2,1);
    background:#FAFBFC; color:#2D3436; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.form-input:focus {
    outline:none; border-color:#FF6B6B; background:#fff;
    box-shadow:0 0 0 4px rgba(255,107,107,0.1); }
.form-group input::placeholder,
.form-input::placeholder { color:#B0B8C4; }

/* ===== BUTTONS ===== */
.btn { padding:12px 28px; border:none; border-radius:14px; font-size:14px; font-family:'Vazirmatn', Tahoma;
    cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:8px;
    transition:all 0.3s cubic-bezier(0.4,0,0.2,1); font-weight:600; position:relative; overflow:hidden; }
.btn::after { content:''; position:absolute; inset:0; background:rgba(255,255,255,0); transition:background 0.3s; }
.btn:hover::after { background:rgba(255,255,255,0.12); }
.btn:active { transform:scale(0.97); }
.btn-primary { background:linear-gradient(135deg,#FF6B6B,#FD79A8,#A29BFE,#54A0FF,#4ECDC4,#FFE66D);
    background-size:300% 300%; color:#fff; box-shadow:0 4px 16px rgba(255,107,107,0.3); animation:gradientFlow 4s ease infinite; }
.btn-primary:hover { box-shadow:0 8px 24px rgba(255,107,107,0.4); transform:translateY(-2px); }
.btn-success { background:linear-gradient(135deg,#00B894,#00CEC9,#55EFC4); color:#fff; box-shadow:0 4px 16px rgba(0,184,148,0.3); }
.btn-success:hover { box-shadow:0 8px 24px rgba(0,184,148,0.4); transform:translateY(-2px); }
.btn-warning { background:linear-gradient(135deg,#FF9F43,#FDCB6E,#FFE66D); color:#fff; box-shadow:0 4px 16px rgba(255,159,67,0.3); }
.btn-warning:hover { box-shadow:0 8px 24px rgba(255,159,67,0.4); transform:translateY(-2px); }
.btn-late { background:linear-gradient(135deg,#FFE66D,#FF9F43,#E17055); color:#fff; box-shadow:0 4px 16px rgba(255,159,67,0.3); }
.btn-late:hover { box-shadow:0 8px 24px rgba(255,159,67,0.4); transform:translateY(-2px); }
.btn-danger { background:linear-gradient(135deg,#FF4757,#FF6B6B,#FD79A8); color:#fff; box-shadow:0 4px 16px rgba(255,71,87,0.3); }
.btn-secondary { background:linear-gradient(135deg,#8892B0,#A29BFE); color:#fff; }
.btn-sm { padding:6px 14px; font-size:12px; border-radius:8px; }
.btn-block { display:flex; justify-content:center; align-items:center; width:100%; padding:16px; font-size:16px;
    background:linear-gradient(135deg,#FF6B6B,#FD79A8,#A29BFE,#54A0FF,#4ECDC4,#FFE66D);
    background-size:300% 300%; color:#fff; box-shadow:0 4px 16px rgba(255,107,107,0.3); animation:gradientFlow 4s ease infinite; }
.btn-group { display:flex; gap:10px; flex-wrap:wrap; }

.search-toolbar { margin-bottom:16px; }
.search-toolbar form { display:flex; gap:10px; align-items:center; }
.search-toolbar input[type="text"] { flex:1; padding:10px 14px; border:2px solid #E1E4EA; border-radius:8px; font-size:14px; background:rgba(255,255,255,0.05); }

.password-cell {
    font-family: monospace;
    font-size: 12px;
    color: var(--info);
    cursor: pointer;
    background: rgba(84,160,255,0.1);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== ALERTS ===== */
.alert { padding:16px 20px; border-radius:14px; margin-bottom:20px; font-size:14px; display:flex; align-items:center; gap:10px; animation:fadeIn 0.4s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:translateY(0)} }
.alert-success { background:linear-gradient(135deg,rgba(0,184,148,0.12),rgba(0,206,201,0.06)); color:#00796b; border:1px solid rgba(0,184,148,0.2); }
.alert-danger { background:linear-gradient(135deg,rgba(255,71,87,0.12),rgba(255,118,117,0.06)); color:#c0392b; border:1px solid rgba(255,71,87,0.2); }

/* ===== TABS ===== */
.tabs { display:flex; gap:8px; margin-bottom:20px; background:#fff; border-radius:14px; padding:4px; box-shadow:0 2px 8px rgba(0,0,0,0.05); border:1px solid rgba(0,0,0,0.06); }
.tab-btn { flex:1; padding:12px 16px; border:none; background:transparent; font-size:14px; font-weight:600; color:#8892B0; cursor:pointer; border-radius:10px; transition:all 0.3s; display:flex; align-items:center; justify-content:center; gap:6px; }
.tab-btn:hover { color:#FF6B6B; background:rgba(255,107,107,0.05); }
.tab-btn.active { background:linear-gradient(135deg,var(--primary),var(--accent)); color:#fff; box-shadow:0 4px 12px rgba(255,107,107,0.2); }
.tab-content { display:none; }
.tab-content.active { display:block; animation:fadeIn 0.3s ease; }

/* ===== DYNAMIC FIELDS ===== */
.dynamic-fields {
    background:linear-gradient(135deg,rgba(255,107,107,0.06),rgba(78,205,196,0.04),rgba(255,230,109,0.03));
    padding:24px; border-radius:14px; margin-bottom:20px;
    border:2px dashed rgba(255,107,107,0.2); position:relative; }
.dynamic-fields::before { content:'✨'; position:absolute; top:-14px; right:20px; background:#fff; padding:2px 10px;
    border-radius:20px; font-size:14px; box-shadow:0 2px 8px rgba(0,0,0,0.1); }
.dynamic-fields h4 { color:#FF6B6B; margin-bottom:16px; font-size:15px; font-weight:700; }

/* ===== TABLES ===== */
.table-responsive { overflow-x:auto; border-radius:14px; border:1px solid rgba(0,0,0,0.06); }
.data-table { width:100%; border-collapse:collapse; background:#fff; }
.data-table th, .data-table td { padding:14px 16px; text-align:right; border-bottom:1px solid #F1F3F5; font-size:13px; transition:all 0.2s; }
.data-table th { background:linear-gradient(135deg,#F8F9FE,#F1F3F5); color:#2D3436; font-weight:700; font-size:13px; padding-top:16px; padding-bottom:16px; }
.data-table tbody tr:hover { background:linear-gradient(90deg,rgba(255,107,107,0.03),transparent); }
.data-table tbody tr:last-child td { border-bottom:none; }

/* ===== BADGES ===== */
.badge { padding:5px 14px; border-radius:50px; font-size:12px; font-weight:600; display:inline-flex; align-items:center; gap:5px; }
.badge-student { background:linear-gradient(135deg,#00B894,#00CEC9); color:#fff; }
.badge-teacher { background:linear-gradient(135deg,#A29BFE,#6C5CE7,#FD79A8); color:#fff; }
.badge-manager { background:linear-gradient(135deg,#6366f1,#8b5cf6,#a855f7); color:#fff; }
.badge-admin { background:linear-gradient(135deg,#FFE66D,#FF9F43,#E17055); color:#fff; }
.badge-present { background:linear-gradient(135deg,#00B894,#4ECDC4); color:#fff; }
.badge-absent { background:linear-gradient(135deg,#FF4757,#FF6B6B); color:#fff; }
.badge-late { background:linear-gradient(135deg,#FFE66D,#FF9F43); color:#fff; }
.badge-warning { background:linear-gradient(135deg,#FFE66D,#FF9F43); color:#fff; }
.badge-danger { background:linear-gradient(135deg,#FF4757,#FF6B6B); color:#fff; }
.badge-info { background:linear-gradient(135deg,#54A0FF,#A29BFE); color:#fff; }

/* ===== TEXT MUTED ===== */
.text-muted { color:#8892B0 !important; font-size:12px; }

/* ===== SEARCH ===== */
.search-box { position:relative; margin-bottom:20px; }
.search-box input { width:100%; padding:14px 20px 14px 50px; border:2px solid #E8ECF1; border-radius:50px;
    font-size:15px; font-family:'Vazirmatn', Tahoma; background:#fff; transition:all 0.3s; }
.search-box input:focus { outline:none; border-color:#FF6B6B; box-shadow:0 0 0 4px rgba(255,107,107,0.1); }
.search-box .search-icon { position:absolute; left:18px; top:50%; transform:translateY(-50%); font-size:20px; opacity:0.4; }

/* ===== HELP TEXT ===== */
.help-text { color:#8892B0; font-size:13px; margin-bottom:15px; line-height:1.8; padding:12px 16px;
    background:rgba(255,107,107,0.04); border-radius:8px; border-right:3px solid #FF6B6B; }

/* ===== LOGIN FOOTER ===== */
.login-footer { text-align:center; margin-top:20px; padding-top:16px; border-top:1px solid rgba(0,0,0,0.06); }
.login-footer a { color:#7C70DC; font-size:14px; text-decoration:none; transition:all 0.3s; }
.login-footer a:hover { color:#FF6B6B; }

/* ===== VOCATIONAL DIVIDER ===== */
.voc-divider { display:flex; align-items:center; margin:22px 0; text-align:center; }
.voc-divider::before, .voc-divider::after { content:''; flex:1; height:1px; background:linear-gradient(90deg,transparent,rgba(162,155,254,0.3),transparent); }
.voc-divider span { padding:0 14px; color:#8892B0; font-size:13px; font-weight:500; }

/* ===== VOCATIONAL HERO ===== */
.voc-hero { display:flex; align-items:center; gap:16px; padding:24px; margin-top:8px;
    background:linear-gradient(135deg,rgba(255,107,107,0.08),rgba(162,155,254,0.1),rgba(78,205,196,0.05));
    border:2px solid rgba(162,155,254,0.2); border-radius:18px; cursor:pointer;
    transition:all 0.3s cubic-bezier(0.4,0,0.2,1); text-decoration:none; position:relative; overflow:hidden; }
.voc-hero::before { content:''; position:absolute; inset:0; background:linear-gradient(90deg,rgba(255,107,107,0.1),rgba(162,155,254,0.08));
    opacity:0; transition:opacity 0.3s; }
.voc-hero:hover { border-color:rgba(162,155,254,0.5); transform:translateY(-3px); box-shadow:0 12px 32px rgba(162,155,254,0.2); }
.voc-hero:hover::before { opacity:1; }
.voc-hero>* { position:relative; z-index:1; }
.voc-hero-icon { font-size:42px; width:60px; height:60px; display:flex; align-items:center; justify-content:center;
    background:linear-gradient(135deg,#FF6B6B,#FD79A8,#A29BFE); border-radius:16px; flex-shrink:0; box-shadow:0 4px 16px rgba(255,107,107,0.25); }
.voc-hero-title { font-size:18px; font-weight:800; color:#2D3436; margin-bottom:2px; }
.voc-hero-desc { font-size:12px; color:#8892B0; margin-bottom:0; }
.voc-hero-arrow { font-size:24px; color:#A29BFE; font-weight:700; margin-right:auto; transition:transform 0.3s; }
.voc-hero:hover .voc-hero-arrow { transform:translateX(-4px); }

/* ===== VOCATIONAL HERO ===== */
.vocational-hero { text-align:center; margin-bottom:35px; padding:30px;
    background:linear-gradient(135deg,rgba(255,107,107,0.08),rgba(162,155,254,0.08));
    border-radius:20px; border:2px solid rgba(162,155,254,0.15); position:relative; overflow:hidden; }
.vocational-hero::before { content:'🎓'; position:absolute; top:-20px; left:-10px; font-size:80px; opacity:0.06; }
.vocational-hero::after { content:'📚'; position:absolute; bottom:-20px; right:-10px; font-size:80px; opacity:0.06; }
.vocational-hero .voc-icon { font-size:48px; margin-bottom:12px; animation:bounce 2s infinite; }
.vocational-hero h2 { font-size:22px; font-weight:800;
    background:linear-gradient(135deg,#FF6B6B,#FD79A8,#A29BFE,#54A0FF);
    background-size:200% 200%; -webkit-background-clip:text; -webkit-text-fill-color:transparent;
    background-clip:text; animation:gradientFlow 6s ease infinite; margin-bottom:6px; }
.vocational-hero p { color:#8892B0; font-size:13px; }

/* ===== NO RESULTS ===== */
.no-results { text-align:center; color:#8892B0; padding:60px 20px; font-size:16px; }
.no-results .big-icon { font-size:60px; margin-bottom:15px; opacity:0.5; }

/* ===== DASHBOARD CHARTS ===== */
.visual-stats { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:25px; }
.viz-card { background:#fff; border-radius:20px; padding:24px;
    box-shadow:0 4px 12px rgba(255,107,107,0.1); border:1px solid rgba(0,0,0,0.04); }
.viz-card h3 { font-size:16px; font-weight:700; color:#2D3436; margin-bottom:16px; }
.donut-chart { width:180px; height:180px; border-radius:50%; display:flex;
    align-items:center; justify-content:center; margin:0 auto 16px; position:relative; }
.donut-center { text-align:center; background:#fff; padding:20px; border-radius:50%;
    width:100px; height:100px; display:flex; flex-direction:column;
    align-items:center; justify-content:center; }
.donut-center h4 { font-size:24px; font-weight:800; color:#2D3436; margin:0; }
.donut-center span { font-size:12px; color:#8892B0; }
.legend { display:flex; justify-content:center; gap:20px; }
.legend-item { display:flex; align-items:center; gap:6px; font-size:13px; color:#555; }
.legend-dot { width:10px; height:10px; border-radius:50%; }

/* ===== RESPONSIVE ===== */
@media (max-width:1200px) {
    .card-page { grid-template-columns: repeat(4, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width:1024px) {
    .sidebar-toggle { display: flex; }
    .sidebar { width:260px; }
    .main-content { margin-right:260px; }
    .card-page { grid-template-columns: repeat(3, 1fr); }
    .topbar { padding: 15px 20px; }
    .content { padding: 20px; }
}
@media (max-width:900px) {
    .card-page { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .user-card { height: 160px; padding: 12px; }
}
@media (max-width:768px) {
    .sidebar-toggle { display: flex; }
    .sidebar {
        width:80px;
        position:fixed;
    }
    .sidebar-header { padding:18px 8px; }
    .sidebar-header h2, .sidebar-header p, .sidebar-nav a span:not(.nav-icon) { display:none; }
    .sidebar-logo { width:48px; height:48px; font-size:24px; margin-bottom:0; }
    .sidebar-nav a { justify-content:center; padding:12px 5px; }
    .sidebar-nav a .nav-icon { margin:0; }
    .sidebar-close { display:none; }
    .main-content { margin-right:80px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { flex-direction:column; }
    .form-group { min-width:auto; }
    .topbar h1 { font-size:18px; }
    .user-chip-info { display:none; }
    .card-page { grid-template-columns: repeat(2, 1fr); }
    .user-card { height: 150px; }
    .toolbar { padding: 15px; }
    .toolbar .btn { margin-left: 4px; margin-bottom: 4px; }
    .search-box { width: 100%; }
    .table-responsive { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 6px; }
}
@media (max-width:600px) {
    .card-page { grid-template-columns: 1fr; }
    .card-page-a5 { grid-template-columns: 1fr; }
    .user-card { height: auto; min-height: 140px; }
    .btn { padding: 10px 16px; font-size: 13px; }
    .btn-sm { padding: 5px 10px; font-size: 11px; }
    .topbar { padding: 12px 15px; flex-wrap: wrap; gap: 10px; }
    .topbar h1 { font-size: 16px; }
    .content { padding: 12px; }
    .card { padding: 16px; }
    .stat-card { padding: 16px; }
    .stat-icon-wrap { width: 50px; height: 50px; font-size: 20px; }
    .stat-info h3 { font-size: 20px; }
    .visual-stats { grid-template-columns: 1fr; }
    .donut-chart { width: 150px; height: 150px; }
    .donut-center { width: 80px; height: 80px; }
    .donut-center h4 { font-size: 18px; }
    .login-box { padding: 30px 20px; width: 95%; }
    .login-header h1 { font-size: 22px; }
    .form-group input, .form-group select, .form-group textarea { padding: 10px 12px; font-size: 14px; }
    .btn-block { padding: 12px; font-size: 14px; }
}
@media (max-width:480px) {
    .sidebar-toggle { display: flex; }
    .sidebar {
        width:260px;
        position:fixed;
        right:-260px;
        transition:right 0.3s cubic-bezier(0.4,0,0.2,1);
    }
    .sidebar-header { padding:30px 25px; }
    .sidebar-logo { width:65px; height:65px; font-size:30px; margin-bottom:12px; }
    .sidebar-header h2, .sidebar-header p, .sidebar-nav a span:not(.nav-icon) { display:inline; }
    .sidebar-nav a { justify-content:flex-start; padding:14px 25px; }
    .sidebar-nav a .nav-icon { margin-left:14px; }
    .sidebar-close { display:block; }
    body.sidebar-expanded { overflow:hidden; }
    .main-content { margin-right:0 !important; }
    .stats-grid { grid-template-columns: 1fr; }
    .content { padding: 10px; }
    .card-page { gap: 8px; }
    .user-card { padding: 10px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar > div > div { flex-wrap: wrap; justify-content: center; }
    .form-group label { font-size: 12px; }
    .data-table { font-size: 11px; }
    .data-table th, .data-table td { padding: 6px 4px; }
    .badge { padding: 4px 10px; font-size: 10px; }
    .user-chip-avatar { width: 32px; height: 32px; font-size: 12px; }
    .sidebar-nav a .nav-icon { width: 32px; height: 32px; font-size: 16px; }
}

/* Landscape mobile - sidebar stays full in landscape mode */
@media (max-width:768px) and (orientation: landscape) {
    .sidebar { width: 240px; }
    .sidebar-header h2, .sidebar-header p, .sidebar-nav a span:not(.nav-icon) { display: inline; }
    .sidebar-nav a { justify-content: flex-start; padding: 14px 20px; }
    .sidebar-nav a .nav-icon { margin-left: 14px; }
    .main-content { margin-right: 240px; }
    .card-page { grid-template-columns: repeat(3, 1fr); }
}

/* Print optimizations */
@media print {
    .sidebar, .topbar, .toolbar, .animated-bg, .no-print { display: none !important; }
    .main-content { margin: 0; }
    .content { padding: 0; }
    body { background: white; }
}

/* Touch friendly */
@media (hover: none) and (pointer: coarse) {
    .btn { min-height: 44px; }
    .form-group input, .form-group select, .form-group textarea { min-height: 44px; }
    .sidebar-nav a { min-height: 44px; }
    .data-table th, .data-table td { min-height: 44px; }
    .nav-icon { min-width: 44px; min-height: 44px; }
}

/* RTL fixes for small screens */
@media (max-width:768px) {
    .form-row { flex-direction: column; }
    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; justify-content: center; }
    .search-toolbar > div[style*="flex"],
    .search-toolbar form[style*="flex"],
    .search-toolbar div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .search-toolbar input[type="text"] { width: 100% !important; }
}

/* Sidebar expanded on phone - overlay mode (sidebar covers content) */
@media (max-width:480px) {
    .sidebar-expanded .sidebar { right: 0; }
    .sidebar-expanded .main-content { margin-right: 0 !important; }
}

/* Table responsive scroll */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table {
    min-width: 600px;
}
@media (max-width:768px) {
    .data-table {
        min-width: 500px;
        font-size: 11px;
    }
    .data-table thead th { font-size: 10px; }
    .data-table td { padding: 6px 4px; }
    .data-table img { width: 30px; height: 30px; }
    /* btn-group inside table cells - stack vertically on mobile */
    .data-table td .btn-group {
        flex-direction: column;
        gap: 2px;
    }
    .data-table td .btn-group .btn {
        width: 100%;
        padding: 4px 6px;
        font-size: 9px;
    }
}
@media (max-width:480px) {
    .data-table { min-width: 400px; }
}

/* Modal responsive */
.modal-overlay {
    padding: 10px;
}
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}
@media (max-width:480px) {
    .modal-content {
        margin: 10px;
        padding: 15px;
        border-radius: 12px;
    }
}

/* Utility classes */
.hidden-mobile { display: none; }
@media (min-width: 769px) {
    .hidden-mobile { display: block; }
}
.hidden-desktop { display: block; }
@media (min-width: 769px) {
    .hidden-desktop { display: none; }
}

/* ===== PERSIAN DATE PICKER ===== */
.pdp-container {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}
.pdp-container input.pdp-year,
.pdp-container select.pdp-month,
.pdp-container select.pdp-day {
    padding: 8px 10px;
    border: 2px solid #E1E4EA;
    border-radius: 8px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 14px;
    background: rgba(255,255,255,0.9);
    text-align: center;
}
.pdp-container input.pdp-year { width: 70px; }
.pdp-container select.pdp-month { min-width: 110px; }
.pdp-container select.pdp-day { min-width: 60px; }

/* ===== DATE PICKER RESPONSIVE ===== */
@media (max-width:768px) {
    .pdp-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .pdp-container input.pdp-year,
    .pdp-container select.pdp-month,
    .pdp-container select.pdp-day {
        width: 100%;
        max-width: 100%;
    }
}

/* ===== PASSWORD INPUT PADDING ===== */
.form-group:has(.pass-toggle-btn) input[type="password"],
.form-group:has(.toggle-pass) input[type="password"] {
    padding-left: 44px;
}
@media (max-width:480px) {
    .form-group:has(.pass-toggle-btn) input[type="password"],
    .form-group:has(.toggle-pass) input[type="password"] {
        padding-left: 42px;
    }
}

    /* ===== EXTRA SMALL SCREENS (under 360px) ===== */
@media (max-width:360px) {
    .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
    .topbar h1 { font-size: 14px; }
    .content { padding: 8px; }
    .card { padding: 12px; }
    .stat-card { padding: 12px; }
    .stat-icon-wrap { width: 45px; height: 45px; font-size: 16px; }
    .stat-info h3 { font-size: 18px; }
    .stat-info p { font-size: 10px; }
    .badge { padding: 3px 8px; font-size: 9px; }
    .btn { padding: 8px 12px; font-size: 12px; }
    .btn-block { font-size: 13px; }
    .login-box { padding: 20px 15px; }
    .login-header h1 { font-size: 20px; }
    .data-table { font-size: 10px; }
    .data-table th, .data-table td { padding: 4px 2px; }
    .form-group label { font-size: 11px; }
}

/* ===== MODAL RESPONSIVE ===== */
.modal-overlay {
    display: flex;
    padding: 10px;
    align-items: center;
    justify-content: center;
}
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}
.modal-content .login-box {
    width: 90vw !important;
    max-width: 500px;
    padding: 24px !important;
}

/* Generic modal overlay - responsive */
[id*="Modal"] > div[style*="width:100%"] {
    width: 100% !important;
    max-width: 95vw !important;
    margin: 10px auto !important;
}
@media (max-width: 480px) {
    [id*="Modal"] > div[style*="max-width:600px"],
    [id*="Modal"] > div[style*="max-width:700px"] {
        max-width: 95vw !important;
        padding: 16px !important;
        border-radius: 14px !important;
    }
    [id*="Modal"] > div > h3,
    [id*="Modal"] > div .login-header h3 {
        font-size: 17px !important;
    }
    [id*="Modal"] > div .form-row {
        flex-direction: column !important;
    }
    [id*="Modal"] > div .form-group {
        min-width: 100% !important;
    }
    [id*="Modal"] > div .btn-group {
        flex-direction: column !important;
        gap: 8px !important;
    }
    [id*="Modal"] > div .btn-group .btn {
        width: 100% !important;
    }
}

/* ===== STUDENT SEARCH WRAPPER ===== */
.student-search-wrapper {
    position: relative;
}
.student-search-wrapper .suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #E1E4EA;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.student-search-wrapper .suggestions-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 4px;
}
.student-search-wrapper .suggestions-dropdown li {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
}
.student-search-wrapper .suggestions-dropdown li:hover {
    background: rgba(0,184,148,0.08);
}
@media (max-width:480px) {
    .modal-content { margin: 10px; padding: 15px; border-radius: 12px; }
    .modal-content .login-box { width: 95vw !important; padding: 20px !important; }
    .login-header h3 { font-size: 18px; }
}

/* ===== TOUCH FRIENDLY ===== */
@media (hover: none) and (pointer: coarse) {
    .btn { min-height: 44px; }
    .btn-sm { min-height: 44px; }
    .form-group input, .form-group select, .form-group textarea { min-height: 44px; }
    .sidebar-nav a { min-height: 44px; }
    .data-table th, .data-table td { min-height: 44px; }
    .nav-icon { min-width: 44px; min-height: 44px; }
    .sidebar-toggle { min-width: 48px; min-height: 48px; font-size: 22px; }
    .tab-btn { min-height: 44px; }
    .btn-group { flex-direction: column; gap: 8px; }
    .btn-group .btn { width: 100%; }
}

/* ===== ANIMATED BG RESPONSIVE ORBS ===== */
@media (max-width: 768px) {
    .animated-bg .orb-1 { width: 250px; height: 250px; }
    .animated-bg .orb-2 { width: 180px; height: 180px; }
    .animated-bg .orb-3 { width: 120px; height: 120px; }
}
@media (max-width: 480px) {
    .animated-bg .orb-1 { width: 180px; height: 180px; }
    .animated-bg .orb-2 { width: 140px; height: 140px; }
    .animated-bg .orb-3 { width: 100px; height: 100px; }
    .animated-bg .orb { filter: blur(40px); }
}

/* Ensure btn-block is full width and readable on mobile */
@media (max-width: 480px) {
    .btn-block {
        padding: 14px 20px !important;
        font-size: 15px !important;
    }
}

/* Form select responsiveness */
@media (max-width: 768px) {
    .form-group select {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
}

/* Ensure all cards are full width on mobile */
@media (max-width: 768px) {
    .card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px !important;
    }
}

/* ===== ENSURE NO HORIZONTAL SCROLL ON MOBILE ===== */
@media (max-width: 480px) {
    body { overflow-x: hidden !important; }
    .layout { overflow-x: hidden !important; }
    .main-content { overflow-x: hidden !important; }
    
    /* Fix for elements with fixed widths */
    * {
        max-width: 100vw !important;
    }
}

/* ===== COMPLETE RESPONSIVE FIXES ===== */

/* Content page - override inline styles */
@media (max-width: 768px) {
    /* Content card grid - allow single column on small screens */
    .content > .card > div[style*="display:grid"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Content type icon - scale down */
    .content .card div[style*="width:45px"] {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
    }
    
    /* Content card min-height */
    .content .card[style*="min-height:250px"] {
        min-height: 180px !important;
    }
    
    /* Content card padding on mobile */
    .content .card {
        padding: 16px !important;
    }
}
@media (max-width: 480px) {
    /* Content card grid - single column */
    .content > .card > div[style*="display:grid"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    /* Font sizes in content cards */
    .content .card strong { font-size: 13px !important; }
    .content .card small { font-size: 10px !important; }
    .content .card p { font-size: 11px !important; }
}

/* Date picker and input overrides */
@media (max-width: 768px) {
    /* Date inputs with fixed width */
    input[type="date"][style*="width:150px"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* PDP date picker inputs */
    input.pdp-year[style*="width:70px"],
    select.pdp-month[style*="width:140px"],
    select.pdp-day[style*="width:70px"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Form inputs with fixed widths */
    input[style*="width:80px"],
    input[style*="width:70px"],
    input[style*="width:120px"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    select[style*="width:140px"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    th[style*="width:120px"],
    th[style*="width:100px"],
    th[style*="width:80px"] {
        width: auto !important;
    }
}

/* Table responsiveness - force horizontal scroll */
@media (max-width: 768px) {
    .data-table[style*="min-width:900px"] {
        min-width: 600px !important;
    }
    .data-table[style*="min-width:600px"] {
        min-width: 400px !important;
    }
    
    /* Profile card - stack on mobile */
    .profile-card {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }
    
    .avatar-preview,
    .avatar-big {
        width: 100px !important;
        height: 100px !important;
    }
    
    .form-row .form-group {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }
}

/* Modal overrides on mobile */
@media (max-width: 480px) {
    .login-box[style*="max-width:700px"] {
        max-width: 95vw !important;
        padding: 20px 15px !important;
    }
    
    .login-box[style*="max-width:600px"] {
        max-width: 95vw !important;
        padding: 20px 15px !important;
    }
    
    .login-box[style*="max-width:500px"] {
        max-width: 95vw !important;
        padding: 20px 15px !important;
    }
    
    .report-container[style*="max-width:900px"] {
        max-width: 100% !important;
        padding: 10px !important;
    }
}

/* Student card image overrides */
@media (max-width: 480px) {
    img[style*="width:40px"] {
        width: 32px !important;
        height: 32px !important;
    }
    
    img[style*="width:18px"] {
        width: 15px !important;
        height: 15px !important;
    }
}

/* Form group with fixed min-width */
@media (max-width: 768px) {
    .form-group[style*="min-width:200px"],
    .form-group[style*="flex:1;min-width:200px"] {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }
    
    /* Homework feedback inputs */
    input[style*="width:70px"][name*="feedback"],
    input[placeholder="بازخورد"] {
        width: 100% !important;
    }
}

/* Print cards responsiveness */
@media (max-width: 768px) {
    .print-container[style*="padding: 15px"] {
        padding: 10px !important;
    }
    
    .print-card {
        font-size: 11px !important;
    }
    
    .print-header {
        font-size: 12px !important;
    }
}

/* Attendance table column widths */
@media (max-width: 600px) {
    th[style*="width:120px"] { display: none !important; }
    th[style*="width:100px"] { display: none !important; }
}

/* ===== ENSURE NO HORIZONTAL SCROLL ===== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
    }
    /* Ensure cards don't overflow */
    .card {
        width: 100% !important;
        max-width: 100% !important;
    }
    /* Ensure alert boxes are full width */
    .alert {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Stats grid single column only on very small screens (tablet can use 2 cols) */

/* Very small screens */
@media (max-width: 380px) {
    .topbar {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px 12px !important;
    }
    
    .topbar h1 {
        font-size: 14px !important;
    }
    
    .user-chip {
        flex: 1 1 auto !important;
        min-width: 120px !important;
    }
    
    .content {
        padding: 8px !important;
    }
    
    .stat-card {
        padding: 12px !important;
        min-height: 80px !important;
    }
    
    .stat-info h3 {
        font-size: 16px !important;
    }
    
    .stat-icon-wrap {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
}

/* ===== FLEXBOX FIXES FOR MOBILE ===== */
@media (max-width: 768px) {
    /* Login features already handled */
    
    /* Form rows should stack */
    .form-row {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    /* Button groups should stack */
    .btn-group {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .btn-group .btn {
        width: 100% !important;
    }
    
    /* Toolbar buttons stack */
    .toolbar {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    .toolbar > * {
        width: 100% !important;
    }
}

/* ===== ENSURE SCROLLABLE CONTENT ON MOBILE ===== */
@media (max-width: 480px) {
    .content {
        padding: 8px !important;
    }
    
    .card {
        padding: 14px !important;
    }
    
    .card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .card-header h3 {
        font-size: 16px !important;
    }
    
    /* Card icon */
    .card-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }
}

/* ===== VISUAL STATS ON MOBILE ===== */
@media (max-width: 600px) {
    .visual-stats {
        grid-template-columns: 1fr !important;
    }
    
    .viz-card {
        padding: 16px !important;
    }
    
    .viz-card h3 {
        font-size: 14px !important;
    }
}

/* ===== ENSURE TABLES SCROLL PROPERLY ===== */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.data-table {
    width: 100%;
    box-sizing: border-box;
}

/* ===== HIDDEN UTILITY CLASSES ===== */
.hide-on-mobile { display: block; }
@media (max-width: 768px) {
    .hide-on-mobile { display: none !important; }
}

.show-on-mobile { display: none; }
@media (max-width: 768px) {
    .show-on-mobile { display: block !important; }
}

/* ===== LOADING / NO CONTENT STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}
.empty-state .big-icon {
    font-size: 50px;
    margin-bottom: 15px;
    opacity: 0.5;
}
@media (max-width: 480px) {
    .empty-state .big-icon {
        font-size: 40px;
    }
}

/* ===== TABLET (768px-1024px) ===== */
@media (min-width:769px) and (max-width:1024px) {
    .sidebar {
        width:220px;
    }
    .sidebar-header {
        padding:20px 16px;
    }
    .sidebar-header h2 {
        font-size:17px;
    }
    .sidebar-nav a {
        padding:12px 20px;
        font-size:13px;
    }
    .main-content {
        margin-right:220px;
    }
    .sidebar-toggle {
        display:flex;
    }
    .stats-grid {
        grid-template-columns:repeat(3,1fr);
        gap:15px;
    }
    .card {
        padding:22px;
    }
    .card-header h3 {
        font-size:16px;
    }
    .topbar {
        padding:15px 24px;
    }
    .topbar h1 {
        font-size:19px;
    }
    .content {
        padding:24px;
    }
    .data-table th,
    .data-table td {
        padding:10px 12px;
        font-size:12px;
    }
    .btn {
        padding:10px 20px;
        font-size:13px;
    }
    .btn-sm {
        padding:5px 10px;
        font-size:11px;
    }
}

/* ===== TABLET LANDSCAPE ===== */
@media (min-width:769px) and (max-width:1024px) and (orientation:landscape) {
    .stats-grid {
        grid-template-columns:repeat(4,1fr);
    }
    .visual-stats {
        grid-template-columns:1fr 1fr;
    }
    .card {
        padding:20px;
    }
    .content {
        padding:20px;
    }
    .sidebar-nav a {
        padding:10px 16px;
    }
}

/* ===== MESSAGES PAGE RESPONSIVE ===== */
@media (max-width:768px) {
    .send-mode-tabs {
        gap:4px;
    }
    .send-mode-tab {
        flex:1;
        padding:8px 10px;
        font-size:12px;
    }
    .class-select-grid {
        grid-template-columns:repeat(auto-fill,minmax(120px,1fr)) !important;
        gap:8px;
    }
    .users-checkbox-list {
        max-height:250px;
    }
}
@media (max-width:480px) {
    .users-checkbox-list {
        max-height:200px;
    }
    .send-mode-tab {
        font-size:11px;
        padding:6px 8px;
    }
    .role-option {
        font-size:12px;
        padding:7px 10px;
    }
}

/* ===== SEARCH PAGE RESPONSIVE ===== */
@media (max-width:768px) {
    .search-filters {
        flex-direction:column !important;
    }
}



/* ===== نوار زنگ‌ها (حضور و غیاب) ===== */
.bell-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 0 16px;
    border-bottom: 2px dashed #E1E4EA;
    margin-bottom: 14px;
}
.bell-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 78px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f5f7fa;
    border: 2px solid #E1E4EA;
    color: #57606f;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    transition: all .18s;
}
.bell-tab:hover { border-color: #54A0FF; color: #54A0FF; }
.bell-tab.active {
    background: linear-gradient(135deg, #54A0FF, #4ECDC4);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(84,160,255,.35);
}
.bell-tab-num { font-size: 17px; font-weight: 900; }
.bell-tab-count { font-size: 10px; font-weight: 600; opacity: .75; }
.bell-tab-count.ok { opacity: 1; }
.bell-tab.active .bell-tab-count { color: #eafff8; }

/* ===== ثبت حضور و غیاب زنگی (موبایل‌فرندلی) ===== */
.att-quick {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.att-quick .btn { flex: 1 1 auto; min-height: 46px; font-size: 14px; }
.btn-ghost {
    background: #eef1f7;
    color: #57606f;
    box-shadow: none;
}
.btn-ghost:hover { background: #e2e6ee; }

.att-list { list-style: none; margin: 0; padding: 0; }
.att-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.1fr) minmax(230px, 1fr);
    gap: 10px 14px;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 16px;
    background: #fbfcfe;
    border: 2px solid #EDF0F5;
    transition: border-color .18s, background .18s, box-shadow .18s;
}
.att-row.is-saved { background: #f6fdfa; border-color: #d6f5ea; }
.att-row.is-touched { border-color: #cfd8e6; box-shadow: 0 3px 12px rgba(52,152,219,.10); }

.att-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.att-avatar {
    flex: 0 0 40px;
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #54A0FF, #4ECDC4);
    color: #fff; font-weight: 800; font-size: 17px;
}
.att-names { display: flex; flex-direction: column; min-width: 0; }
.att-names b { font-size: 14px; color: #2D3436; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-names small { font-size: 11px; color: #98A2B3; }

.att-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.att-choice {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    min-height: 52px;
    padding: 6px 4px;
    border: 2px solid #E1E4EA;
    border-radius: 12px;
    background: #fff;
    color: #6b7684;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}
.att-choice:active { transform: scale(.96); }
.att-choice-ico { font-size: 18px; line-height: 1; }
.att-choice.is-present.is-active { background: linear-gradient(135deg,#00B894,#4ECDC4); border-color: transparent; color: #fff; }
.att-choice.is-absent.is-active  { background: linear-gradient(135deg,#FF4757,#FF6B6B); border-color: transparent; color: #fff; }
.att-choice.is-late.is-active    { background: linear-gradient(135deg,#FF9F43,#FDCB6E); border-color: transparent; color: #fff; }

.att-late-box {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff8ec;
    border: 1px dashed #FFCF87;
}
.att-late-label { font-size: 12px; font-weight: 700; color: #b46b12; }
.att-late-picks { display: flex; gap: 5px; flex-wrap: wrap; }
.att-late-pick {
    min-width: 42px; min-height: 34px;
    padding: 4px 8px;
    border-radius: 9px;
    border: 2px solid #FFE0B2;
    background: #fff;
    color: #b46b12;
    font-family: inherit; font-size: 12px; font-weight: 800;
    cursor: pointer;
}
.att-late-pick.is-active { background: linear-gradient(135deg,#FF9F43,#FDCB6E); border-color: transparent; color: #fff; }
.att-late-input {
    width: 78px; padding: 6px 8px;
    border: 2px solid #FFE0B2; border-radius: 9px;
    font-family: inherit; font-size: 13px;
}

/* ===== عکس دانش‌آموز در فهرست حضور و غیاب ===== */
.att-avatar { overflow: hidden; padding: 0; }
.att-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}
.att-avatar .avatar-initial { line-height: 1; }

.avatar-link {
    flex: 0 0 auto;
    display: inline-flex;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.avatar-link:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(45, 52, 54, 0.22);
}
.avatar-link:focus-visible { outline: 3px solid #54A0FF; outline-offset: 2px; }

.att-name-link {
    color: inherit; text-decoration: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 100%;
}
.att-name-link:hover b { color: #0984E3; text-decoration: underline; }
.att-name-link:focus-visible { outline: 2px solid #54A0FF; outline-offset: 2px; border-radius: 4px; }

/* ===== فیلتر کلاس در «حضور امروز / غیاب امروز» ===== */
.att-class-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 2px solid #E1E4EA;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(84, 160, 255, .07), rgba(78, 205, 196, .05));
}
.att-class-filter__label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-inline-end: 12px;
    margin-inline-end: 4px;
    border-inline-end: 2px solid #E1E4EA;
    font-size: 13px;
    font-weight: 800;
    color: #57606f;
    white-space: nowrap;
}
.att-class-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 2px solid #E1E4EA;
    border-radius: 30px;
    background: #fff;
    color: #57606f;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.7;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s, background .15s, color .15s;
}
.att-class-chip:hover {
    border-color: #54A0FF;
    background: rgba(84, 160, 255, .08);
    color: #0b6fc4;
    transform: translateY(-1px);
}
.att-class-chip:active { transform: translateY(0); }
.att-class-chip.is-active {
    background: linear-gradient(135deg, #54A0FF, #4ECDC4);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(84, 160, 255, .32);
}
.att-class-chip:focus-visible {
    outline: 3px solid rgba(84, 160, 255, .35);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .att-class-filter { padding: 10px; gap: 6px; }
    .att-class-filter__label {
        width: 100%;
        border-inline-end: 0;
        border-bottom: 2px solid #E1E4EA;
        padding-inline-end: 0;
        margin-bottom: 4px;
        padding-bottom: 6px;
    }
    .att-class-chip { padding: 6px 11px; font-size: 12px; }
}

/* ===== انتقال وضعیت از زنگ قبلی ===== */
.att-carry-note {
    margin: 10px 0 4px;
    padding: 10px 14px;
    border: 2px dashed #54A0FF;
    border-radius: 12px;
    background: rgba(84, 160, 255, 0.07);
    color: #2D3436;
    font-size: 13px;
    line-height: 1.9;
}
.att-row.is-carried {
    border-style: dashed;
    border-color: #54A0FF;
    background: rgba(84, 160, 255, 0.045);
}
.att-carried-tag {
    display: inline-block;
    margin-top: 3px;
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(84, 160, 255, 0.14);
    color: #0b6fc4 !important;
    font-size: 10.5px;
    font-weight: 700;
    cursor: help;
}

/* پیش‌نمایش عکس در بخش انضباط */
.stu-photo-box {
    display: flex; align-items: center; gap: 12px;
    margin-top: 10px; padding: 12px;
    border: 2px solid #E1E4EA; border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
}
.stu-photo-box[hidden] { display: none; }
.stu-photo-box .avatar {
    flex: 0 0 64px; width: 64px; height: 64px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #54A0FF, #4ECDC4);
    color: #fff; font-weight: 800; font-size: 26px; overflow: hidden;
}
.stu-photo-box .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stu-photo-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stu-photo-info b { font-size: 15px; color: #2D3436; }
.stu-photo-info small { font-size: 12px; color: #8892b0; }

/* بندانگشتی عکس در نتایج جستجوی Select2 */
.select2-results__option .student-option-photo {
    width: 34px; height: 34px; border-radius: 9px;
    object-fit: cover; float: right; margin-left: 8px;
    background: linear-gradient(135deg, #54A0FF, #4ECDC4);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 14px; vertical-align: middle;
    overflow: hidden;
}
.select2-results__option--highlighted .student-option-photo { border-color: rgba(255,255,255,0.7); }
.select2-selection__rendered .student-option-photo { margin-left: 6px; vertical-align: middle; }

.att-savebar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(84,160,255,.10), rgba(78,205,196,.10));
    border: 2px dashed #cfd8e6;
}
.att-savebar-info { font-size: 13px; font-weight: 700; color: #2D3436; }
.att-savebar-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
.att-savebar-btns .btn { min-height: 48px; font-size: 14px; }

/* نوار بازیابی وضعیت‌های ذخیره‌نشده (بعد از رفتن به پروفایل و بازگشت) */
.att-draft-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 12px; padding: 11px 14px;
    border-radius: 12px; font-size: 13px; font-weight: 700; color: #8a5a00;
    background: linear-gradient(135deg, rgba(255,159,67,.18), rgba(255,71,87,.10));
    border: 1px solid rgba(255,159,67,.45);
}
.att-draft-bar[hidden] { display: none; }
.att-draft-bar .btn { margin-inline-start: auto; min-height: 38px; }

/* ===== موبایل: حضور و غیاب ساده و چسبان ===== */
@media (max-width: 768px) {
    .bell-tabs {
        position: sticky;
        top: 0;
        z-index: 40;
        margin: 0 -12px 12px;
        padding: 10px 12px;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(6px);
        border-bottom: 2px solid #E1E4EA;
    }
    .bell-tab { min-width: 66px; padding: 6px 8px; }
    .bell-tab-num { font-size: 15px; }
    .bell-tab.complete::after {
        content: '✔';
        position: absolute;
        top: 3px; inset-inline-end: 5px;
        font-size: 10px;
        color: #00B894;
    }
    .bell-tab { position: relative; }

    .att-quick { position: sticky; top: 62px; z-index: 39; margin: 0 -12px 12px; padding: 8px 12px; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); }
    .att-quick .btn { min-height: 44px; padding: 8px 10px; font-size: 13px; }

    .att-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
        margin-bottom: 10px;
    }
    .att-choice { min-height: 56px; font-size: 12px; }
    .att-choice-ico { font-size: 20px; }
    .att-late-pick { min-width: 46px; min-height: 40px; }
    .att-late-input { width: 100%; min-height: 42px; }

    .att-savebar {
        position: sticky;
        bottom: 0;
        z-index: 45;
        margin: 14px -12px -12px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        border-radius: 18px 18px 0 0;
        border: none;
        border-top: 2px solid #E1E4EA;
        box-shadow: 0 -6px 20px rgba(0,0,0,.08);
        background: rgba(255,255,255,.98);
        backdrop-filter: blur(8px);
    }
    .att-savebar-info { width: 100%; font-size: 12px; }
    .att-savebar-btns { width: 100%; margin-inline-start: 0; }
    .att-savebar-btns .btn { flex: 1 1 auto; min-height: 50px; font-size: 13px; padding: 8px 10px; }
}

/* ===== کارت آماری قابل کلیک (داشبورد) ===== */
.stat-card-link {
    text-decoration: none;
    color: inherit;
    /* جا برای برچسب راهنمای گوشهٔ کارت (که مطلق روی کارت می‌نشیند) */
    padding-bottom: 44px;
}
.stat-card-link .stat-info h3,
.stat-card-link .stat-info p { color: inherit; }
.stat-card-link .stat-card-hint {
    position: absolute;
    bottom: 10px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(84,160,255,.12);
    color: #0984e3;
    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    transform: translateY(6px);
    transition: all .25s;
    pointer-events: none;
}
.stat-card-link:hover .stat-card-hint,
.stat-card-link:focus-visible .stat-card-hint { opacity: 1; transform: translateY(0); }
@media (hover: none) {
    .stat-card-link .stat-card-hint { opacity: 1; transform: none; }
}

/* ===== ACADEMIC YEAR ALERT ===== */
.sidebar-year-alert {
    margin: 12px 10px 4px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,159,67,0.18), rgba(255,71,87,0.12));
    border: 1px solid rgba(255,159,67,0.45);
    color: #8a5a00;
    font-size: 12px;
    line-height: 1.9;
    text-align: right;
}
.sidebar-year-alert b { color: #d35400; }
.sidebar-year-alert-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 7px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, #FF9F43, #FF6B6B);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(255,107,107,0.3);
}
.sidebar-year-alert-btn:hover { filter: brightness(1.05); }
.sidebar-year-alert-form { margin: 0; }
.sidebar-year-alert-form .sidebar-year-alert-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
}
