/* سامانه مدیریت رویدادهای مدارس — نسخهٔ آنلاین */
:root{
  --primary:#6d28d9; --primary-2:#8b5cf6; --primary-soft:#f3efff;
  --bg:#f6f5fb; --card:#ffffff; --line:#e6e4f0;
  --text:#1e293b; --muted:#64748b; --muted-2:#94a3b8;
  --danger:#dc2626; --danger-soft:#fee2e2;
  --ok:#16a34a; --ok-soft:#dcfce7; --warn:#d97706; --warn-soft:#fef3c7;
  --radius:14px; --shadow:0 2px 10px rgba(30,20,60,.06);
  --shadow-lg:0 14px 40px rgba(30,20,60,.18);
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
html,body{margin:0; padding:0}
body{font-family:Vazirmatn, Vazir, Tahoma, 'Segoe UI', sans-serif; background:var(--bg); color:var(--text); font-size:14.5px; line-height:1.75}
a{color:inherit; text-decoration:none}
.container{max-width:1100px; margin:0 auto; padding:0 16px}
.narrow{max-width:860px}
.narrow2{max-width:760px}
.ic{vertical-align:-3px}

/* ---------- هدر ---------- */
.topbar{background:#fff; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:50}
.topbar-in{display:flex; align-items:center; justify-content:space-between; gap:12px; height:58px}
.brand{display:flex; align-items:center; gap:9px; font-weight:800; font-size:15px; white-space:nowrap}
.brand b{color:var(--primary)}
.brand-badge{width:34px; height:34px; border-radius:10px; background:linear-gradient(135deg,var(--primary),var(--primary-2)); color:#fff; display:grid; place-items:center; flex-shrink:0}
.nav{display:flex; align-items:center; gap:2px; flex-wrap:wrap}
.nav-a{padding:7px 10px; border-radius:9px; font-size:12.8px; color:var(--muted); display:inline-flex; align-items:center; gap:5px}
.nav-a:hover{background:var(--primary-soft); color:var(--primary)}
.nav-a.active{background:var(--primary-soft); color:var(--primary); font-weight:700}
.nav-danger{color:var(--danger)}
.nav-danger:hover{background:var(--danger-soft); color:var(--danger)}
.badge{background:var(--danger); color:#fff; border-radius:99px; font-size:10.5px; padding:1px 7px; font-weight:700}
@media (max-width:860px){ .topbar-in{flex-direction:column; height:auto; padding:8px 0} .nav{justify-content:center} }

/* ---------- هیرو ---------- */
.hero{background:linear-gradient(120deg,#5b21b6,#8b5cf6 55%,#a78bfa); color:#fff; padding:34px 0 44px; border-radius:0 0 26px 26px}
.hero h1{margin:0 0 6px; font-size:clamp(19px,3.4vw,26px)}
.hero p{margin:0; opacity:.92; font-size:14px}
@media (max-width:640px){ .hero{padding:26px 0 32px; border-radius:0 0 18px 18px} }

/* ---------- کارت‌ها و پنل ---------- */
.section{padding:22px 0 40px}
.cards{display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px}
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow); display:flex; align-items:center; gap:13px}
.card-link{transition:.15s}
.card-link:hover{border-color:var(--primary-2); transform:translateY(-2px); box-shadow:var(--shadow-lg)}
.card-ic{width:46px; height:46px; border-radius:12px; background:var(--primary-soft); color:var(--primary); display:grid; place-items:center; flex-shrink:0}
.card-body{display:flex; flex-direction:column; gap:2px; flex:1; min-width:0}
.card-body small{color:var(--muted); font-size:12.5px}
.card-arrow{color:var(--muted-2)}
.ev-card{flex-wrap:wrap}
.panel{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:18px; box-shadow:var(--shadow); margin-bottom:18px}
.panel-title{margin:0 0 12px; font-size:14.5px; display:flex; align-items:center; gap:7px; color:var(--text)}
.panel-title-row{display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px}
.page-title{font-size:19px; margin:4px 0 14px}
.title-row{display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px}
.muted{color:var(--muted)}
.code{font-size:20px; color:var(--primary); letter-spacing:1px}
.backlink{display:inline-flex; align-items:center; gap:5px; color:var(--muted); font-size:13px; margin-bottom:12px}
.backlink:hover{color:var(--primary)}

/* ---------- فرم‌ها ---------- */
.field{margin-bottom:14px; min-width:0}
.field label{display:block; font-size:13px; font-weight:700; margin-bottom:6px; color:#334155}
.req{color:var(--danger); font-style:normal}
.hint{color:var(--muted-2); font-size:11.8px; display:block; margin-top:4px}
.hint-inline{color:var(--muted-2); font-size:11.5px; font-weight:400}
.frow2{display:grid; grid-template-columns:1fr 1fr; gap:0 14px}
@media (max-width:640px){ .frow2{grid-template-columns:1fr} }
.input{width:100%; height:42px; border:1.5px solid var(--line); border-radius:11px; padding:0 12px; font:inherit; font-size:14px; background:#fff; color:var(--text); outline:none}
textarea.input{height:auto; padding:9px 12px; resize:vertical}
.input:focus{border-color:var(--primary-2); box-shadow:0 0 0 3px rgba(139,92,246,.14)}
select.input{cursor:pointer}
.input-wrap{position:relative}
.input-wrap .ic{position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--muted-2); pointer-events:none}
.input-wrap .input{padding-left:36px}
.inline-form{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.grow{flex:1; min-width:150px}
.w80{width:90px; flex:none}
.stack-form .form-actions{margin-top:6px}
.form-actions{display:flex; gap:10px; margin-top:16px; flex-wrap:wrap}
.form-actions.center{justify-content:center}
.form-actions.start{justify-content:flex-start}
.chk{display:inline-flex; align-items:center; gap:7px; font-size:13.5px; color:#334155; cursor:pointer; white-space:nowrap}
.chk input{width:17px; height:17px; accent-color:var(--primary)}
.chk-lg{padding-top:8px}
.chk-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:8px 14px}
@media (max-width:640px){ .chk-grid{grid-template-columns:1fr 1fr} }
.chips{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px}
.chip{padding:7px 14px; border-radius:99px; background:#fff; border:1.5px solid var(--line); font-size:13px; cursor:pointer}
.chip-on{background:var(--primary); border-color:var(--primary); color:#fff; font-weight:700}
.filter-bar{display:flex; gap:9px; align-items:center; flex-wrap:wrap}
.filter-bar .input{width:auto; min-width:130px}
.filter-bar .grow{flex:1; min-width:170px}

/* ---------- دکمه‌ها ---------- */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1.5px solid transparent; border-radius:11px; padding:9px 18px; font:inherit; font-size:13.8px; font-weight:700; cursor:pointer; transition:.15s}
.btn-primary{background:linear-gradient(120deg,var(--primary),var(--primary-2)); color:#fff}
.btn-primary:hover{filter:brightness(1.07)}
.btn-ghost{background:#fff; border-color:var(--line); color:#475569}
.btn-ghost:hover{border-color:var(--primary-2); color:var(--primary)}
.btn-sm{padding:6px 12px; font-size:12.5px; border-radius:9px}
.btn-lg{padding:12px 26px; font-size:15px; border-radius:13px}
.btn-block{width:100%}
.btn-danger-ghost{color:var(--danger)}
.btn-danger-ghost:hover{border-color:var(--danger); color:var(--danger)}
.ibtn{width:30px; height:30px; border-radius:8px; border:1px solid var(--line); background:#fff; color:var(--muted); display:inline-grid; place-items:center; cursor:pointer}
.ibtn:hover{color:var(--primary); border-color:var(--primary-2)}
.ibtn-danger:hover{color:var(--danger); border-color:var(--danger)}
.inline{display:inline}

/* ---------- جدول ---------- */
.tbl-wrap{overflow-x:auto}
.tbl{width:100%; border-collapse:collapse; min-width:640px}
.tbl th{background:var(--primary-soft); color:#4c1d95; font-size:12.3px; padding:9px 10px; text-align:right; white-space:nowrap}
.tbl th:first-child{border-radius:0 10px 10px 0}
.tbl th:last-child{border-radius:10px 0 0 10px}
.tbl td{padding:9px 10px; border-bottom:1px solid var(--line); font-size:13.3px; vertical-align:middle}
.tbl tr:last-child td{border-bottom:none}
.tbl tr:hover td{background:#faf9fe}
.cell-num{white-space:nowrap}
.cell-act{text-align:left; white-space:nowrap}
.ph{width:44px; height:44px; object-fit:cover; border-radius:10px; border:1px solid var(--line); display:block}

/* ---------- پیام‌ها، وضعیت‌ها ---------- */
.flash{border-radius:11px; padding:11px 14px; margin:14px 0; font-size:13.5px; display:flex; gap:8px; align-items:flex-start}
.flash ul{margin:6px 18px 0 0; padding:0}
.flash-error{background:var(--danger-soft); color:#991b1b; border:1px solid #fecaca}
.flash-ok{background:var(--ok-soft); color:#166534; border:1px solid #bbf7d0}
.pill{display:inline-block; border-radius:99px; font-size:11px; padding:2px 10px; font-weight:700; vertical-align:2px}
.pill-open{background:var(--ok-soft); color:#15803d}
.pill-soon{background:var(--warn-soft); color:#b45309}
.pill-closed{background:#f1f5f9; color:#64748b}
.empty{text-align:center; color:var(--muted); padding:38px 16px; background:var(--card); border:1.5px dashed var(--line); border-radius:var(--radius); display:flex; flex-direction:column; align-items:center; gap:8px}
.empty b{font-size:15.5px; color:#475569}
.empty span{font-size:13px; max-width:420px}
.empty.small{padding:24px 14px}
.stat-ic{width:38px; height:38px; border-radius:10px; display:grid; place-items:center}
.c1{background:#ede9fe; color:#6d28d9} .c2{background:#fef3c7; color:#b45309} .c3{background:#dcfce7; color:#15803d} .c4{background:#e0f2fe; color:#0369a1}
.stats{display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; margin-bottom:18px}
.stat{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:14px; box-shadow:var(--shadow); display:flex; align-items:center; gap:11px}
.stat b{font-size:21px}
.stat small{color:var(--muted); font-size:12px}
@media (max-width:520px){ .stat b{font-size:17px} }

/* ---------- اعلان‌ها ---------- */
.notif-card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:14px; margin-bottom:12px; display:flex; gap:14px; align-items:flex-start}
.notif-card .ph{width:64px; height:64px}
.notif-body{flex:1; display:flex; flex-direction:column; gap:3px; min-width:0}
.notif-name{font-size:15px}
.notif-meta{font-size:12.5px; color:var(--muted); display:flex; align-items:center; gap:5px; flex-wrap:wrap}
.notif-actions{margin-top:6px}
@media (max-width:560px){ .notif-card{flex-direction:column-reverse} .notif-card .ph{width:72px; height:72px} }

/* ---------- ثبت‌نام: عکس ---------- */
.photo-box{border:1.5px dashed var(--line); border-radius:var(--radius); background:#fbfaff; transition:.15s}
.photo-box:hover{border-color:var(--primary-2)}
.photo-box.has-photo{border-style:solid}
.file-input{display:none}
.photo-empty{padding:26px 14px; text-align:center; color:var(--muted); cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:5px}
.photo-empty b{color:#475569; font-size:14px}
.photo-empty small{font-size:12px}
.photo-preview{padding:14px; display:flex; align-items:center; gap:14px; flex-wrap:wrap}
.photo-preview img{width:96px; height:96px; object-fit:cover; border-radius:12px; border:1px solid var(--line)}
.photo-tools{display:flex; gap:8px}
.photo-tools + .hint{flex-basis:100%}

/* ---------- رسید ثبت‌نام ---------- */
.ok-panel{text-align:center}
.ok-icon{width:62px; height:62px; margin:6px auto 10px; border-radius:50%; background:var(--ok-soft); color:var(--ok); display:grid; place-items:center}
.receipt{max-width:430px; margin:14px auto 0; border:1px solid var(--line); border-radius:var(--radius); padding:16px; text-align:right; background:#fbfaff}
.receipt-photo{width:88px; height:88px; object-fit:cover; border-radius:12px; display:block; margin:0 auto 12px; border:1px solid var(--line)}
.kv{width:100%; border-collapse:collapse; font-size:13.3px}
.kv th{color:var(--muted); font-weight:600; text-align:right; padding:5px 0; width:42%; border-bottom:1px dashed var(--line); vertical-align:top}
.kv td{padding:5px 0; border-bottom:1px dashed var(--line); font-weight:600}
.kv tr:last-child th, .kv tr:last-child td{border-bottom:none}
.auth-panel{max-width:380px; margin:26px auto}
.auth-icon{width:52px; height:52px; margin:0 auto 10px; border-radius:14px; background:var(--primary-soft); color:var(--primary); display:grid; place-items:center}
.center{text-align:center}
.small-p{font-size:13px; margin-top:0}

/* ---------- تاریخ‌دهندهٔ شمسی ---------- */
.dp{position:fixed; z-index:300; background:#fff; border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-lg); padding:12px; width:288px; max-width:calc(100vw - 16px); animation:pop .14s}
@keyframes pop{from{opacity:0; transform:scale(.97)}}
.dp-h{display:flex; gap:7px; align-items:center; margin-bottom:10px}
.dp-h .input{height:34px; font-size:13px; padding:0 8px; flex:1; min-width:0}
.dp-nav{background:var(--bg); border:1px solid var(--line); border-radius:8px; width:34px; height:34px; display:grid; place-items:center; cursor:pointer; color:var(--muted); flex-shrink:0}
.dp-nav:hover{background:var(--primary-soft); color:var(--primary)}
.dp-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:2px}
.dp-dow{font-size:10.5px; color:var(--muted-2); text-align:center; padding:3px 0; font-weight:600}
.dp-day{height:32px; border:none; background:none; border-radius:8px; cursor:pointer; font-size:13px; font-family:inherit; color:var(--text); display:flex; align-items:center; justify-content:center}
.dp-day:hover{background:var(--primary-soft)}
.dp-day.empty-day{visibility:hidden}
.dp-day.today{color:var(--primary); font-weight:800; box-shadow:inset 0 0 0 1.5px var(--primary-2)}
.dp-day.sel{background:var(--primary); color:#fff}
.dp-ft{display:flex; justify-content:space-between; margin-top:9px; border-top:1px solid var(--line); padding-top:8px}
.dp-ft button{background:none; border:none; color:var(--primary); font-family:inherit; font-size:12.8px; font-weight:700; cursor:pointer; padding:4px 8px; border-radius:8px}
.dp-ft button:hover{background:var(--primary-soft)}
.dp-ft button[data-c]{color:var(--muted)}

/* ---------- فوتر ---------- */
.footer{border-top:1px solid var(--line); color:var(--muted-2); font-size:11.8px; text-align:center; padding:14px 16px; background:#fff}

/* ---------- گزارش چاپی ---------- */
.p-tbl{width:100%; border-collapse:collapse; font-size:10.5pt}
.p-tbl th{border:1px solid #94a3b8; background:#ede9fe; padding:5px 6px; font-size:9.5pt; text-align:center; font-weight:700}
.p-tbl td{border:1px solid #b6b3cc; padding:5px 6px; text-align:center; vertical-align:middle; color:#0f172a}
.p-tbl td img{width:50px; height:60px; object-fit:cover; border-radius:4px}
.p-tbl .cell-addr{text-align:right; font-size:9pt; min-width:150px}
.p-tbl tr{page-break-inside:avoid}
@media print{
  body{padding:0}
  @page{size:A4 landscape; margin:10mm}
}
