:root {
    --blue: #1266f1;
    --blue-dark: #0b3f9f;
    --blue-soft: #eaf2ff;
    --black: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --white: #ffffff;
    --bg: #f5f8fc;
    --green: #118a55;
    --red: #d83a52;
    --orange: #d97706;
    --radius: 18px;
    --shadow: 0 14px 35px rgba(17, 24, 39, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Tahoma, Arial, sans-serif; background: var(--bg); color: var(--black); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { background: #08152f; color: var(--white); padding: 24px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 28px; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: #fff; box-shadow: inset 0 0 0 1px rgba(18,102,241,.18); overflow: hidden; }
.brand-mark img { width: 76%; height: 76%; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: 1px; }
.brand small { color: #9eb4de; margin-top: 4px; font-size: 11px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a, .logout-link { padding: 13px 15px; border-radius: 12px; color: #d9e5ff; transition: .2s; }
.sidebar nav a:hover, .logout-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.logout-link { margin-top: auto; }
.main-content { min-width: 0; padding: 28px; }
.topbar { display: flex; align-items: center; gap: 15px; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: 27px; }
.topbar p { margin: 5px 0 0; color: var(--muted); }
.menu-button { display: none; border: 0; background: var(--white); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 18px; }
.grid.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--white); border: 1px solid rgba(229,231,235,.8); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stat-card strong { display: block; font-size: 30px; margin-top: 10px; }
.stat-card span { color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-title h2 { margin: 0; font-size: 19px; }
.btn { border: 0; border-radius: 12px; padding: 11px 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-light { background: var(--blue-soft); color: var(--blue-dark); }
.btn-danger { background: #ffe8ec; color: var(--red); }
.btn-success { background: #dcfce7; color: var(--green); }
.btn-sm { padding: 8px 11px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; font-weight: 700; font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18,102,241,.12); }
textarea { min-height: 110px; resize: vertical; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: right; padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 13px; }
.badge { display: inline-flex; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; background: var(--blue-soft); color: var(--blue-dark); }
.badge.present, .badge.open { background: #dcfce7; color: var(--green); }
.badge.late { background: #fff3d6; color: var(--orange); }
.badge.absent, .badge.closed { background: #ffe8ec; color: var(--red); }
.badge.scheduled { background: #eef2ff; color: #5146a8; }
.alert { padding: 14px 16px; border-radius: 13px; margin-bottom: 18px; background: var(--blue-soft); color: var(--blue-dark); }
.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #ffe8ec; color: #9f1239; }
.empty { text-align: center; padding: 28px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.search-panel { max-width: 760px; margin: 35px auto; }
.search-box { position: relative; }
.search-box input { padding: 20px; font-size: 20px; border-width: 2px; }
.search-results { margin-top: 12px; display: grid; gap: 9px; }
.student-result { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 15px; padding: 15px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; text-align: right; }
.student-result:hover { border-color: var(--blue); background: var(--blue-soft); }
.student-result small { color: var(--muted); display: block; margin-top: 4px; }
.session-banner { display: flex; align-items: center; justify-content: space-between; gap: 15px; background: #08152f; color: #fff; padding: 20px; border-radius: var(--radius); }
.session-banner p { color: #b9caeb; margin: 6px 0 0; }
.attendance-message { margin-top: 15px; padding: 15px; border-radius: 13px; display: none; }
.attendance-message.show { display: block; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #061124, #1266f1); }
.login-card { width: min(440px, 100%); background: #fff; border-radius: 26px; padding: 34px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.login-card h1 { margin: 0 0 8px; font-size: 34px; }
.login-card > p { color: var(--muted); margin-bottom: 25px; }
.login-card form { display: grid; gap: 15px; }
.login-card .btn { width: 100%; padding: 14px; }
.notice-list { display: grid; gap: 10px; }
.notice-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; }
.notice-item p { margin: 0; }
.notice-item small { color: var(--muted); }
.kpi-note { font-size: 12px; color: var(--muted); margin-top: 7px; }
@media (max-width: 1050px) {
    .grid.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; right: -270px; z-index: 20; width: 250px; transition: .25s; }
    .sidebar.open { right: 0; }
    .main-content { padding: 18px; }
    .menu-button { display: inline-block; }
    .grid.two, .form-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: auto; }
    .session-banner, .notice-item { align-items: stretch; flex-direction: column; }
}
@media (max-width: 520px) {
    .grid.cards { grid-template-columns: 1fr; }
    .topbar h1 { font-size: 22px; }
    .card { padding: 17px; }
    .search-box input { font-size: 17px; padding: 16px; }
}

/* ==============================
   Public landing page
   ============================== */
html { scroll-behavior: smooth; }
.landing-page { background: #fff; color: #0d1728; overflow-x: hidden; }
.landing-container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.landing-header { position: absolute; inset: 0 0 auto; z-index: 10; padding: 22px 0; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.landing-brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; }
.landing-brand-mark { width: 43px; height: 43px; border-radius: 13px; display: grid; place-items: center; background: #fff; box-shadow: 0 10px 25px rgba(18,102,241,.18); overflow: hidden; }
.landing-brand-mark img { width: 80%; height: 80%; object-fit: contain; }
.landing-brand strong, .landing-brand small { display: block; }
.landing-brand strong { letter-spacing: 1.8px; font-size: 17px; }
.landing-brand small { color: #9eb1cf; margin-top: 3px; font-size: 9px; letter-spacing: .5px; }
.landing-links { display: flex; gap: 28px; color: #c8d5e8; font-size: 14px; }
.landing-links a { transition: .2s; }
.landing-links a:hover { color: #fff; }
.landing-login { min-width: 126px; }
.landing-hero { position: relative; min-height: 790px; display: flex; align-items: center; padding: 145px 0 90px; color: #fff; background:
    radial-gradient(circle at 78% 24%, rgba(18,102,241,.28), transparent 24%),
    linear-gradient(122deg, #061020 0%, #091a37 56%, #0b2d67 100%); }
.landing-hero::before { content: ""; position: absolute; inset: 0; opacity: .15; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 58px 58px; mask-image: linear-gradient(to bottom, #000, transparent 85%); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: 70px; }
.hero-copy { max-width: 620px; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; background: rgba(255,255,255,.06); color: #bdd2f6; font-size: 13px; }
.hero-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #54a0ff; box-shadow: 0 0 0 5px rgba(84,160,255,.13); }
.hero-copy h1 { margin: 25px 0 20px; font-size: clamp(43px, 5.2vw, 70px); line-height: 1.12; letter-spacing: -2.5px; }
.hero-copy h1 em { display: block; color: #5da0ff; font-style: normal; }
.hero-copy > p { max-width: 590px; margin: 0; color: #b8c7de; font-size: 18px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 31px; }
.btn-lg { padding: 15px 23px; border-radius: 14px; }
.btn-outline { color: #fff; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.04); }
.btn-outline:hover { background: rgba(255,255,255,.1); }
.hero-trust { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 28px; color: #a9bad2; font-size: 12px; }
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero-trust span::before { content: "✓"; color: #65a8ff; font-weight: 900; }
.hero-visual { position: relative; min-height: 510px; display: grid; place-items: center; }
.visual-glow { position: absolute; width: 430px; height: 430px; border-radius: 50%; background: rgba(18,102,241,.25); filter: blur(70px); }
.dashboard-preview { position: relative; z-index: 2; width: min(560px, 100%); border: 1px solid rgba(255,255,255,.15); border-radius: 24px; overflow: hidden; background: #f7f9fd; box-shadow: 0 40px 90px rgba(0,0,0,.45); transform: perspective(1200px) rotateY(-5deg) rotateX(2deg); }
.preview-topbar { height: 54px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid #e9edf3; color: #111827; }
.preview-logo { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 900; letter-spacing: .8px; }
.preview-logo span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(18,102,241,.18); }
.preview-logo span img { width: 78%; height: 78%; object-fit: contain; }
.preview-dot { width: 28px; height: 28px; border-radius: 50%; background: #e7edf6; }
.preview-body { min-height: 340px; display: grid; grid-template-columns: 76px 1fr; }
.preview-sidebar { background: #08152f; padding: 30px 18px; display: flex; flex-direction: column; gap: 18px; }
.preview-sidebar i { height: 8px; border-radius: 8px; background: rgba(255,255,255,.16); }
.preview-sidebar i:first-child { background: #1266f1; }
.preview-content { padding: 24px; color: #111827; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.preview-heading span { width: 110px; height: 13px; border-radius: 8px; background: #172033; }
.preview-heading b { width: 54px; height: 24px; border-radius: 8px; background: #e8f0ff; }
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.preview-stats article { padding: 13px; border: 1px solid #e8edf5; border-radius: 13px; background: #fff; }
.preview-stats small { display: block; color: #7b8494; font-size: 8px; }
.preview-stats strong { display: block; margin-top: 7px; font-size: 19px; }
.preview-panel { margin-top: 13px; border: 1px solid #e8edf5; border-radius: 14px; background: #fff; padding: 14px; }
.preview-panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.preview-panel-title b { width: 82px; height: 9px; background: #1a2333; border-radius: 7px; }
.preview-panel-title span { width: 40px; height: 17px; background: #e8f0ff; border-radius: 6px; }
.preview-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 9px; padding: 10px 0; border-top: 1px solid #eef1f5; }
.preview-row i { width: 22px; height: 22px; border-radius: 50%; background: #e5eaf2; }
.preview-row span { width: 70%; height: 7px; border-radius: 7px; background: #dfe5ed; }
.preview-row em { font-size: 8px; font-style: normal; font-weight: 800; color: #118a55; padding: 4px 7px; border-radius: 999px; background: #dcfce7; }
.preview-row em.late { color: #bd6800; background: #fff3d6; }
.floating-card { position: absolute; z-index: 3; border: 1px solid rgba(255,255,255,.17); border-radius: 16px; background: rgba(9,25,52,.88); backdrop-filter: blur(14px); box-shadow: 0 18px 45px rgba(0,0,0,.3); }
.floating-code { top: 45px; left: -15px; padding: 13px 18px; }
.floating-code small, .floating-status small { display: block; color: #9fb1cc; font-size: 10px; }
.floating-code strong { display: block; margin-top: 4px; color: #fff; font-size: 24px; letter-spacing: 3px; }
.floating-status { right: -15px; bottom: 58px; display: flex; align-items: center; gap: 11px; padding: 13px 15px; }
.floating-status > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #1266f1; font-weight: 900; }
.floating-status strong { display: block; font-size: 11px; margin-bottom: 4px; }
.landing-strip { background: #fff; border-bottom: 1px solid #e8edf5; }
.strip-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip-grid > div { min-height: 120px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; border-left: 1px solid #e8edf5; }
.strip-grid > div:last-child { border-left: 0; }
.strip-grid strong { font-size: 25px; color: #1266f1; }
.strip-grid span { color: #6e7786; font-size: 13px; }
.landing-section { padding: 105px 0; }
.landing-section-head { max-width: 740px; margin: 0 auto 55px; text-align: center; }
.landing-section-head > span, .workflow-copy > span { color: #1266f1; font-size: 13px; font-weight: 900; }
.landing-section-head h2, .workflow-copy h2 { margin: 13px 0 14px; font-size: clamp(31px, 4vw, 47px); line-height: 1.25; letter-spacing: -1.4px; }
.landing-section-head p, .workflow-copy p { margin: 0; color: #6b7483; font-size: 16px; line-height: 1.9; }
.landing-section-head.compact { margin-bottom: 42px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { position: relative; min-height: 280px; padding: 29px; border: 1px solid #e6ebf2; border-radius: 22px; background: #fff; transition: transform .25s, box-shadow .25s, border-color .25s; overflow: hidden; }
.feature-card:hover { transform: translateY(-5px); border-color: #cfe0ff; box-shadow: 0 20px 50px rgba(22,45,80,.1); }
.feature-card.featured { color: #fff; border-color: #1266f1; background: linear-gradient(145deg, #1266f1, #0c439f); }
.feature-number { position: absolute; top: 24px; left: 26px; color: #a5afbd; font-size: 12px; font-weight: 900; }
.feature-card.featured .feature-number { color: rgba(255,255,255,.55); }
.feature-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: #1266f1; background: #eaf2ff; font-size: 23px; font-weight: 900; }
.feature-card.featured .feature-icon { color: #fff; background: rgba(255,255,255,.15); }
.feature-card h3 { margin: 25px 0 12px; font-size: 19px; }
.feature-card p { margin: 0; color: #6d7685; line-height: 1.85; font-size: 14px; }
.feature-card.featured p { color: #d5e4ff; }
.workflow-section { background: #f5f8fc; }
.workflow-grid { display: grid; grid-template-columns: .85fr 1.15fr; align-items: center; gap: 90px; }
.workflow-copy h2 { max-width: 430px; }
.workflow-copy p { max-width: 460px; }
.text-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 27px; color: #1266f1; font-weight: 900; }
.workflow-steps { display: grid; gap: 12px; }
.workflow-steps article { display: grid; grid-template-columns: 52px 1fr; gap: 17px; align-items: start; padding: 23px; border: 1px solid #e3e9f1; border-radius: 18px; background: #fff; }
.workflow-steps article > strong { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: #1266f1; background: #eaf2ff; font-size: 16px; }
.workflow-steps h3 { margin: 1px 0 7px; font-size: 17px; }
.workflow-steps p { margin: 0; color: #717a89; font-size: 13px; line-height: 1.7; }
.roles-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.role-card { min-height: 420px; padding: 38px; border-radius: 25px; overflow: hidden; }
.admin-role { color: #fff; background: linear-gradient(145deg, #07152e, #0d2d63); }
.operator-role { border: 1px solid #dfe6ef; background: #f8faff; }
.role-label { display: inline-flex; padding: 7px 11px; border-radius: 999px; color: #1266f1; background: #eaf2ff; font-size: 12px; font-weight: 900; }
.admin-role .role-label { color: #c9ddff; background: rgba(255,255,255,.1); }
.role-card h3 { margin: 24px 0 12px; font-size: 28px; }
.role-card > p { max-width: 500px; margin: 0; color: #697381; line-height: 1.85; }
.admin-role > p { color: #b8c9e4; }
.role-card ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; list-style: none; padding: 0; margin: 30px 0 0; }
.role-card li { position: relative; padding-right: 20px; color: #d8e4f7; font-size: 13px; }
.role-card li::before { content: "✓"; position: absolute; right: 0; color: #57a0ff; font-weight: 900; }
.operator-search { margin-top: 38px; padding: 18px; display: flex; justify-content: space-between; align-items: center; border: 2px solid #1266f1; border-radius: 15px; background: #fff; color: #9aa3b1; font-size: 14px; }
.operator-search b { color: #1266f1; font-size: 22px; }
.operator-button { width: 100%; margin-top: 12px; padding: 16px; border: 0; border-radius: 14px; background: #1266f1; color: #fff; font-weight: 900; }
.landing-cta { padding: 0 0 105px; }
.cta-card { min-height: 225px; padding: 45px 55px; display: flex; align-items: center; justify-content: space-between; gap: 25px; border-radius: 28px; color: #fff; background: linear-gradient(125deg, #1266f1, #083985); box-shadow: 0 25px 60px rgba(18,102,241,.22); }
.cta-card span { color: #c6ddff; font-size: 13px; font-weight: 900; }
.cta-card h2 { max-width: 620px; margin: 11px 0 0; font-size: 32px; }
.btn-white { background: #fff; color: #0b3f9f; }
.landing-footer { padding: 40px 0; color: #99a9c2; background: #071225; }
.landing-footer .landing-container { display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.footer-brand { color: #fff; }
.landing-footer p { margin: 0; font-size: 13px; }
.landing-footer > div > span { font-size: 12px; }

/* ==============================
   Friendly system error pages
   ============================== */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background:
    radial-gradient(circle at 70% 20%, rgba(18,102,241,.2), transparent 30%),
    linear-gradient(135deg, #061020, #0a1d3f); color: #fff; }
.error-shell { width: min(640px, 100%); text-align: center; }
.error-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 24px; color: #fff; letter-spacing: 1px; }
.error-brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(18,102,241,.18); }
.error-brand-mark img { width: 78%; height: 78%; object-fit: contain; }
.error-card { padding: 48px 38px; border: 1px solid rgba(255,255,255,.12); border-radius: 27px; background: rgba(255,255,255,.07); backdrop-filter: blur(16px); box-shadow: 0 35px 90px rgba(0,0,0,.28); }
.error-code { display: block; color: #5fa2ff; font-size: clamp(74px, 15vw, 125px); font-weight: 900; line-height: .9; letter-spacing: -6px; }
.error-card h1 { margin: 24px 0 12px; font-size: 31px; }
.error-card > p { max-width: 480px; margin: 0 auto; color: #c2cfe2; line-height: 1.85; }
.error-hint { margin: 22px 0 0; padding: 13px 15px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; color: #aebed5; background: rgba(0,0,0,.15); font-size: 13px; line-height: 1.75; }
.error-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 27px; }
.error-footer { color: #7f93b0; font-size: 12px; margin: 18px 0 0; }

.login-home-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 22px; color: #0b3f9f; font-size: 13px; font-weight: 800; }
.login-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.login-brand-mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px rgba(18,102,241,.18); overflow: hidden; flex-shrink: 0; }
.login-brand-mark img { width: 82%; height: 82%; object-fit: contain; }
.login-brand h1 { margin: 0 0 6px; }
.login-brand-sub { margin: 0; color: #5e6b7f; font-size: 14px; }

@media (max-width: 980px) {
    .landing-links { display: none; }
    .hero-grid, .workflow-grid { grid-template-columns: 1fr; }
    .landing-hero { padding-top: 155px; }
    .hero-copy { max-width: none; text-align: center; margin-inline: auto; }
    .hero-copy > p { margin-inline: auto; }
    .hero-actions, .hero-trust { justify-content: center; }
    .hero-visual { margin-top: 15px; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .workflow-grid { gap: 50px; }
    .workflow-copy { text-align: center; }
    .workflow-copy h2, .workflow-copy p { margin-inline: auto; }
}
@media (max-width: 720px) {
    .landing-container { width: min(100% - 28px, 1180px); }
    .landing-header { padding: 16px 0; }
    .landing-brand small { display: none; }
    .landing-login { min-width: auto; padding: 10px 13px; font-size: 12px; }
    .landing-hero { min-height: auto; padding: 125px 0 70px; }
    .hero-copy h1 { font-size: 43px; letter-spacing: -1.6px; }
    .hero-copy > p { font-size: 15px; }
    .hero-actions .btn { flex: 1 1 150px; }
    .hero-trust { gap: 10px 16px; }
    .hero-visual { min-height: 370px; }
    .dashboard-preview { transform: none; }
    .preview-body { grid-template-columns: 55px 1fr; min-height: 275px; }
    .preview-sidebar { padding-inline: 12px; }
    .preview-content { padding: 15px; }
    .floating-code { left: -5px; top: 10px; }
    .floating-status { right: -4px; bottom: 18px; }
    .strip-grid { grid-template-columns: repeat(2, 1fr); }
    .strip-grid > div { min-height: 105px; border-bottom: 1px solid #e8edf5; }
    .landing-section { padding: 75px 0; }
    .feature-grid, .roles-grid { grid-template-columns: 1fr; }
    .role-card { min-height: auto; padding: 29px; }
    .role-card ul { grid-template-columns: 1fr; }
    .cta-card { padding: 38px 27px; flex-direction: column; text-align: center; }
    .cta-card h2 { font-size: 26px; }
    .landing-footer .landing-container { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .landing-brand-mark { width: 38px; height: 38px; }
    .hero-copy h1 { font-size: 37px; }
    .hero-trust { display: grid; justify-content: start; text-align: right; max-width: 250px; margin-inline: auto; }
    .hero-visual { min-height: 315px; }
    .floating-card { display: none; }
    .preview-stats article { padding: 9px; }
    .preview-stats strong { font-size: 16px; }
    .feature-card { min-height: auto; }
    .error-page { padding: 16px; }
    .error-card { padding: 38px 20px; }
    .error-code { letter-spacing: -3px; }
    .error-actions .btn { width: 100%; }
}

/* ==============================
   ELEVAT v5 — stages, filters and privacy
   ============================== */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.stage-filter-card { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.stage-filter-card > div:first-child { display:grid; gap:5px; }
.stage-filter-card small, .section-heading-row p, .security-settings-card .section-title p { color:var(--muted); margin:0; line-height:1.6; }
.stage-pills { display:flex; flex-wrap:wrap; gap:8px; }
.stage-pill { padding:9px 13px; border:1px solid var(--line); border-radius:999px; background:#fff; color:#475467; font-size:13px; font-weight:800; transition:.2s; }
.stage-pill:hover, .stage-pill.active { color:#fff; border-color:var(--blue); background:var(--blue); box-shadow:0 8px 20px rgba(18,102,241,.2); }

.stage-overview-section { margin-bottom:18px; }
.section-heading-row { display:flex; align-items:end; justify-content:space-between; gap:16px; margin-bottom:15px; }
.section-heading-row h2 { margin:0 0 5px; font-size:21px; }
.stage-overview-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.stage-overview-card { min-height:168px; position:relative; overflow:hidden; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-end; padding:20px; border-radius:20px; color:#fff; background:linear-gradient(145deg,#1266f1,#0b3f9f); box-shadow:0 16px 34px rgba(18,102,241,.18); transition:transform .2s,box-shadow .2s; }
.stage-overview-card:nth-child(2n) { background:linear-gradient(145deg,#7c3aed,#4c1d95); }
.stage-overview-card:nth-child(3n) { background:linear-gradient(145deg,#0f9f78,#075d49); }
.stage-overview-card:nth-child(4n) { background:linear-gradient(145deg,#f07a25,#9a3b0d); }
.stage-overview-card::after { content:""; position:absolute; width:130px; height:130px; border-radius:50%; top:-50px; left:-30px; background:rgba(255,255,255,.12); }
.stage-overview-card:hover { transform:translateY(-4px); box-shadow:0 22px 44px rgba(17,24,39,.2); }
.stage-overview-card.selected { outline:4px solid rgba(18,102,241,.18); outline-offset:3px; }
.stage-overview-card > span { position:absolute; top:16px; right:18px; font-weight:900; opacity:.65; }
.stage-overview-card strong { font-size:22px; position:relative; z-index:1; }
.stage-overview-card small { margin-top:6px; color:rgba(255,255,255,.78); position:relative; z-index:1; }
.stage-overview-card b { margin-top:16px; font-size:12px; position:relative; z-index:1; }
.stage-overview-card.add-stage-card { color:#1849a9; border:1px dashed #84adff; background:#eef4ff; box-shadow:none; }
.stage-overview-card.add-stage-card small { color:#667085; }
.stage-overview-card.add-stage-card::after { background:rgba(18,102,241,.08); }

.dashboard-context-bar { display:flex; align-items:center; justify-content:space-between; gap:15px; margin:18px 0; padding:14px 17px; border:1px solid #d6e4ff; border-radius:16px; background:#f4f8ff; }
.dashboard-context-bar > div:first-child { display:flex; align-items:center; gap:9px; }
.dashboard-context-bar span { color:var(--muted); font-size:13px; }

.alert-action-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.alert-action-card { width:100%; min-height:155px; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:17px; padding:22px; border:0; border-radius:22px; text-align:right; cursor:pointer; color:#fff; box-shadow:0 18px 42px rgba(17,24,39,.15); transition:.2s; }
.alert-action-card:hover { transform:translateY(-3px); }
.payment-alert-card { background:linear-gradient(135deg,#155eef,#073a93); }
.absence-alert-card { background:linear-gradient(135deg,#e34d68,#9c1736); }
.alert-action-icon { width:55px; height:55px; display:grid; place-items:center; border-radius:17px; background:rgba(255,255,255,.16); font-size:26px; font-weight:900; }
.alert-action-card small { color:rgba(255,255,255,.7); }
.alert-action-card strong { display:block; margin:5px 0; font-size:22px; }
.alert-action-card p { margin:0; color:rgba(255,255,255,.78); font-size:13px; }
.alert-action-card > b { min-width:50px; height:50px; display:grid; place-items:center; border-radius:16px; background:#fff; color:#101828; font-size:23px; }

.protected-revenue { min-height:130px; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:18px; border:1px solid #dbe5f2; border-radius:18px; background:linear-gradient(135deg,#f8fbff,#eef4ff); }
.protected-revenue > div { display:grid; gap:5px; }
.protected-revenue span, .protected-revenue small { color:var(--muted); }
.revenue-value { display:block; font-size:34px; letter-spacing:.5px; transition:filter .2s; }
.revenue-value.blurred { filter:blur(5px); user-select:none; }
.revenue-eye { width:52px; height:52px; display:grid; place-items:center; border:0; border-radius:16px; color:#fff; background:var(--blue); cursor:pointer; box-shadow:0 12px 25px rgba(18,102,241,.25); }
.revenue-eye svg { width:25px; fill:none; stroke:currentColor; stroke-width:1.8; }
.compact-session-list { display:grid; gap:10px; }
.compact-session-list > div { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; border:1px solid var(--line); border-radius:14px; }
.compact-session-list span { display:grid; gap:4px; }
.compact-session-list small { color:var(--muted); }

body.modal-open { overflow:hidden; }
.modal { display:none; position:fixed; inset:0; z-index:100; padding:20px; align-items:center; justify-content:center; }
.modal.open { display:flex; }
.modal-backdrop { position:absolute; inset:0; background:rgba(4,12,28,.68); backdrop-filter:blur(6px); }
.modal-panel { width:min(520px,100%); max-height:calc(100vh - 40px); overflow:auto; position:relative; z-index:1; padding:26px; border:1px solid rgba(255,255,255,.3); border-radius:24px; background:#fff; box-shadow:0 35px 90px rgba(0,0,0,.3); animation:modalIn .18s ease-out; }
.modal-panel.modal-wide { width:min(760px,100%); }
@keyframes modalIn { from{opacity:0;transform:translateY(14px) scale(.98)} to{opacity:1;transform:none} }
.modal-close { position:absolute; top:14px; left:14px; width:36px; height:36px; border:0; border-radius:11px; background:#f2f4f7; color:#344054; font-size:24px; cursor:pointer; }
.modal-head, .person-detail-head { display:flex; align-items:center; gap:13px; padding-left:40px; margin-bottom:20px; }
.modal-head h2, .person-detail-head h2 { margin:0 0 5px; font-size:21px; }
.modal-head p, .person-detail-head p { margin:0; color:var(--muted); }
.modal-icon, .person-avatar { width:50px; height:50px; flex:0 0 auto; display:grid; place-items:center; border-radius:16px; font-size:22px; font-weight:900; }
.modal-icon.payment { color:#155eef; background:#eaf2ff; }
.modal-icon.absence { color:#c1153e; background:#ffe8ec; }
.modal-icon.lock { color:#6840c6; background:#f1ebff; }
.person-avatar { color:#fff; background:var(--blue); }
.modal-person-list { display:grid; gap:9px; }
.modal-person { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px; border:1px solid var(--line); border-radius:15px; background:#fff; text-align:right; cursor:pointer; transition:.2s; }
.modal-person:hover { border-color:#9dbcf8; background:#f6f9ff; }
.modal-person span { display:grid; gap:5px; }
.modal-person small { color:var(--muted); }
.modal-person b { color:var(--blue); font-size:12px; white-space:nowrap; }
.person-meta-box { margin-bottom:14px; padding:13px; border-radius:13px; color:#344054; background:#f2f4f7; }
.modal-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:15px; }
.full-button { width:100%; margin-top:14px; }
.inline-message { min-height:20px; margin-top:10px; color:var(--green); font-size:13px; }
.inline-message.error { color:var(--red); }

.pattern-lock { width:250px; max-width:100%; aspect-ratio:1; position:relative; display:grid; grid-template-columns:repeat(3,1fr); gap:19px; margin:18px auto 8px; padding:18px; border-radius:24px; background:#f5f8fc; touch-action:none; user-select:none; }
.pattern-lock canvas { position:absolute; inset:0; z-index:1; pointer-events:none; }
.pattern-lock button { position:relative; z-index:2; display:grid; place-items:center; border:0; background:transparent; cursor:crosshair; }
.pattern-lock button span { width:24px; height:24px; border:4px solid #9aa9bd; border-radius:50%; background:#fff; transition:.15s; }
.pattern-lock button.active span { border-color:var(--blue); background:var(--blue); box-shadow:0 0 0 8px rgba(18,102,241,.13); }
.pattern-reset { display:block; margin:0 auto; border:0; background:transparent; color:var(--blue-dark); cursor:pointer; font-weight:800; }
.pattern-setup-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; text-align:center; }
.security-lock-form { display:grid; gap:17px; }
.lock-fields[hidden], [data-filter-field][hidden] { display:none !important; }

.analytics-filter-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; align-items:end; }
.analytics-submit { align-self:end; }
.period-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; padding:12px 16px; border-radius:13px; color:#1849a9; background:#eef4ff; }

.stage-management-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.stage-management-card { display:grid; gap:12px; padding:17px; border:1px solid var(--line); border-radius:17px; background:#fbfcfe; }
.stage-management-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.stage-management-head strong { color:var(--muted); font-size:12px; }
.account-disabled { opacity:.72; border-style:dashed; }
.session-picker { margin-bottom:18px; }
.stage-choice-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.session-choice { display:grid; gap:5px; padding:14px; border:1px solid var(--line); border-radius:15px; background:#fff; }
.session-choice span, .session-choice small { color:var(--muted); }
.session-choice.active { border-color:var(--blue); background:var(--blue-soft); box-shadow:0 0 0 3px rgba(18,102,241,.1); }

@media (max-width:1100px) {
    .stage-overview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .analytics-filter-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .stage-management-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:800px) {
    .stage-filter-card, .dashboard-context-bar, .section-heading-row { align-items:stretch; flex-direction:column; }
    .alert-action-grid { grid-template-columns:1fr; }
    .alert-action-card { min-height:130px; }
    .analytics-filter-grid, .pattern-setup-grid { grid-template-columns:1fr; }
    .stage-choice-grid { grid-template-columns:1fr; }
    .modal { padding:12px; }
    .modal-panel { max-height:calc(100vh - 24px); padding:22px 18px; }
}
@media (max-width:560px) {
    .stage-overview-grid, .stage-management-grid { grid-template-columns:1fr; }
    .stage-overview-card { min-height:145px; }
    .alert-action-card { grid-template-columns:auto 1fr; }
    .alert-action-card > b { grid-column:1/-1; width:100%; height:38px; }
    .protected-revenue, .compact-session-list > div { align-items:stretch; flex-direction:column; }
    .revenue-eye { width:100%; }
    .modal-person { align-items:stretch; flex-direction:column; }
    .modal-person b { align-self:flex-start; }
    .pattern-lock { width:225px; }
}

/* V6: فلاتر الفترة وصلاحيات موظف الحضور */
.analytics-range-grid { margin-top:14px; }
.analytics-quick-ranges { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:14px; color:var(--muted); font-size:13px; }
.analytics-quick-ranges a { padding:7px 11px; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--blue-dark); font-weight:800; }
.analytics-quick-ranges a:hover { border-color:#9dbcf8; background:var(--blue-soft); }
.analytics-kpis .stat-card strong { font-variant-numeric:tabular-nums; }
.operator-session-note { border-inline-start:4px solid var(--blue); background:#f8faff; }
.muted { color:var(--muted); font-size:13px; }

@media (max-width:800px) {
    .analytics-quick-ranges { align-items:stretch; flex-direction:column; }
    .analytics-quick-ranges a { width:100%; text-align:center; }
    .period-summary { align-items:flex-start; flex-direction:column; }
}

/* V7: تبسيط صفحة الإحصائيات وترتيب الطلاب */
.analytics-simple-title { margin-bottom:18px; }
.analytics-simple-title small { display:block; margin-top:6px; color:var(--muted); font-weight:400; }
.analytics-period-note { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px; padding-top:15px; border-top:1px solid var(--line); color:var(--muted); font-size:13px; }
.analytics-period-note strong { color:var(--black); }
.analytics-simple-kpis { margin-top:18px; }
.analytics-simple-kpis .stat-card { box-shadow:none; }
.analytics-simple-kpis .stat-card strong { margin-top:8px; }
.analytics-log-card { margin-top:18px; }
.analytics-ranking-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-top:18px; }
.ranking-card { padding:20px; }
.ranking-title { margin-bottom:12px; }
.ranking-title small { display:block; margin-top:5px; color:var(--muted); font-weight:400; }
.ranking-list { display:grid; }
.ranking-item { display:grid; grid-template-columns:38px minmax(0,1fr) auto; align-items:center; gap:12px; padding:13px 0; border-bottom:1px solid var(--line); }
.ranking-item:last-child { border-bottom:0; }
.ranking-number { width:32px; height:32px; display:grid; place-items:center; border-radius:10px; color:var(--blue-dark); background:var(--blue-soft); font-size:13px; font-weight:900; }
.ranking-number.absence-rank { color:var(--red); background:#ffe8ec; }
.ranking-person { min-width:0; }
.ranking-person strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.ranking-person small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:5px; color:var(--muted); font-size:12px; }
.ranking-value { white-space:nowrap; font-size:14px; }
.commitment-value { color:var(--green); }
.absence-value { color:var(--red); }
.ranking-empty { padding:24px 8px; }

@media (max-width:900px) {
    .analytics-ranking-grid { grid-template-columns:1fr; }
}
@media (max-width:800px) {
    .analytics-period-note { align-items:flex-start; flex-direction:column; }
}
@media (max-width:520px) {
    .ranking-card { padding:17px; }
    .ranking-item { grid-template-columns:34px minmax(0,1fr); gap:10px; }
    .ranking-value { grid-column:2; justify-self:start; margin-top:-2px; }
}
