:root {
  --primary: #0b3c5d;
  --primary-2: #145a86;
  --primary-soft: #e7f0f7;
  --accent: #1d9a8a;
  --accent-soft: #e3f4f1;
  --gold: #c8961a;
  --gold-soft: #fbf3df;
  --bg: #f2f5f9;
  --card: #ffffff;
  --text: #1a2a3a;
  --muted: #687889;
  --border: #e2e8ef;
  --danger: #c93c3c;
  --danger-soft: #fcebeb;
  --warning: #b87708;
  --warning-soft: #fff5e0;
  --success: #1e8a4c;
  --success-soft: #e5f5ec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 38, 60, .05), 0 4px 16px rgba(16, 38, 60, .05);
  --sidebar-w: 272px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Tajawal', 'Segoe UI', Tahoma, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.35; }
p { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.ic-lg { width: 30px; height: 30px; }
.ic-xl { width: 52px; height: 52px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 18px; }
.d-block { display: block; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.text-danger { color: var(--danger); font-weight: 500; }
.big { font-size: 18px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.lg { width: 14px; height: 14px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 0 0 auto;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0b3c5d 0%, #0a2f4a 100%);
  color: #d7e3ee;
  display: flex; flex-direction: column;
  z-index: 40;
  transition: transform .25s ease;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
}
.brand:hover { text-decoration: none; }
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; font-size: 12px; color: #9fb7cc; line-height: 1.4; }
.nav { flex: 1; overflow-y: auto; padding: 10px 12px; }
.nav-label { font-size: 11.5px; letter-spacing: .3px; color: #7f9cb5; margin: 16px 10px 6px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: 10px;
  color: #d7e3ee; font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.nav a.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.nav a .ic { opacity: .9; }
.nav-tag { font-size: 11px; background: var(--gold); color: #fff; padding: 1px 8px; border-radius: 20px; }
.nav-empty { display: block; font-size: 13px; color: #8aa3b8; padding: 4px 12px; }
.sidebar-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-foot strong { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot small { color: #9fb7cc; }
.sidebar-foot .icon-btn { color: #d7e3ee; }
.sidebar-foot .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.main { flex: 1; margin-right: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px;
  background: rgba(242, 245, 249, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 21px; font-weight: 800; color: var(--primary); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.topbar .menu-btn { display: none; }
.content { padding: 24px 28px; flex: 1; width: 100%; max-width: 1320px; }
.foot { padding: 16px 28px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--border); }
.backdrop { display: none; }

/* ---------- Components ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; color: var(--primary); }
.sub-title { font-size: 15px; margin: 18px 0 10px; color: var(--primary); }
.count { background: var(--primary-soft); color: var(--primary); font-size: 12px; padding: 1px 9px; border-radius: 20px; font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px;
  font: inherit; font-weight: 700; font-size: 14.5px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, box-shadow .15s, color .15s, border-color .15s;
  text-decoration: none !important;
  line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); box-shadow: 0 4px 12px rgba(11, 60, 93, .25); }
.btn-light { background: #fff; color: var(--primary); border-color: var(--border); }
.btn-light:hover { background: var(--primary-soft); border-color: #c9d9e7; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: #e8edf3; }
.btn-ghost-danger { background: transparent; color: var(--danger); }
.btn-ghost-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 12px; font-size: 13.5px; border-radius: 9px; }
.btn-xs { padding: 3px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 20px; font-size: 16px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: #e8edf3; color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.gold { color: var(--gold); }
.icon-btn.gold:hover { background: var(--gold-soft); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 20px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
  background: #eef2f6; color: var(--muted);
}
.badge .ic { width: 14px; height: 14px; }
.badge.sm { font-size: 11px; padding: 0 8px; }
.badge.lg { font-size: 14px; padding: 6px 14px; }
.badge.navy { background: var(--primary); color: #fff; }
.status-pending { background: var(--warning-soft); color: var(--warning); }
.status-approved { background: var(--success-soft); color: var(--success); }
.status-revision { background: var(--danger-soft); color: var(--danger); }
.status-none { background: #eef1f4; color: #8392a1; }
.kind-plan { background: var(--primary-soft); color: var(--primary); }
.kind-achievement { background: var(--accent-soft); color: #147568; }
.role-coordinator { background: var(--gold-soft); color: #8d6608; }
.role-member { background: var(--primary-soft); color: var(--primary); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 20px;
  background: #f1f4f8; border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text);
}
.chip:hover { text-decoration: none; border-color: #b9cad9; }
.chip b { font-weight: 700; font-size: 11.5px; }
.chip.role-coordinator { background: var(--gold-soft); border-color: #eedcae; }
.chip.role-coordinator b { color: #8d6608; }
.chip.role-member b { color: var(--primary-2); }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: 12px;
  margin-bottom: 18px; border: 1px solid transparent;
  font-weight: 500;
}
.alert > span { flex: 1; }
.alert .ic { margin-top: 2px; }
.alert.sm { padding: 8px 12px; font-size: 13.5px; margin-bottom: 12px; }
.alert-success { background: var(--success-soft); color: #176c3b; border-color: #c4e7d3; }
.alert-error { background: var(--danger-soft); color: #9e2c2c; border-color: #f2caca; }
.alert-warning { background: var(--warning-soft); color: #8a5a04; border-color: #f3dfb3; }
.alert-info { background: var(--primary-soft); color: var(--primary); border-color: #cfe0ee; }
.alert a { font-weight: 700; color: inherit; text-decoration: underline; }
.alert-x { background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; padding: 0; }
.alert-x:hover { opacity: 1; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #147568);
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar.gold { background: linear-gradient(135deg, #e0b13a, #b88410); }
.avatar.navy { background: linear-gradient(135deg, var(--primary-2), var(--primary)); }
.avatar-lg { width: 60px; height: 60px; font-size: 20px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-weight: 700; font-size: 13.5px; color: #3a4b5c; }
input, select, textarea {
  font: inherit; color: var(--text);
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d3dce6; border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(20, 90, 134, .15); }
textarea { resize: vertical; }
input[type="color"] { padding: 3px; height: 44px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-color { grid-template-columns: 1fr 90px; }
.row-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pw { position: relative; }
.pw input { padding-left: 42px; }
.pw-toggle { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; }
.switch-field { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; cursor: pointer; align-self: end; padding-bottom: 10px; }
.switch-field input { position: absolute; opacity: 0; }
.switch { width: 44px; height: 24px; border-radius: 20px; background: #cfd8e2; position: relative; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: right .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch-field input:checked + .switch { background: var(--accent); }
.switch-field input:checked + .switch::after { right: 23px; }
.switch-field input:focus-visible + .switch { box-shadow: 0 0 0 3px rgba(29, 154, 138, .3); }

.danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border);
}

.drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px; text-align: center;
  border: 2px dashed #c6d4e1; border-radius: 12px;
  background: #f8fafc; color: var(--primary-2);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-text { font-weight: 700; color: var(--text); word-break: break-all; }

.upload-box > summary { list-style: none; display: inline-flex; }
.upload-box > summary::-webkit-details-marker { display: none; }
.upload-box[open] > summary { background: #e8edf3; color: var(--text); box-shadow: none; }

/* ---------- Toolbar & filters ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.filters select { width: auto; min-width: 140px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search .ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-right: 38px; }
.filters-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; }
.span-2 { grid-column: span 2; }
.date-f { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }

.back-link { display: inline-block; margin-bottom: 14px; font-weight: 700; color: var(--muted); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); color: var(--text);
  transition: transform .15s, box-shadow .15s;
}
.stat:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 38, 60, .09); }
.stat strong { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }
.stat-ic { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-ic .ic { width: 22px; height: 22px; }
.stat-ic.blue { background: #e4eefb; color: #2f6fc1; }
.stat-ic.teal { background: var(--accent-soft); color: var(--accent); }
.stat-ic.navy { background: var(--primary-soft); color: var(--primary); }
.stat-ic.green { background: var(--success-soft); color: var(--success); }
.stat-ic.gold { background: var(--gold-soft); color: var(--gold); }

.attention {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  background: #fff; border: 1px solid #f0dcae; border-right: 4px solid var(--gold);
  border-radius: 12px; padding: 10px 16px; margin-bottom: 18px;
}
.attention strong { display: flex; align-items: center; gap: 6px; color: #8a5a04; }
.attention a { background: var(--warning-soft); color: #8a5a04; padding: 3px 12px; border-radius: 20px; font-weight: 700; font-size: 13.5px; }

.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.narrow { max-width: 720px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: right; font-weight: 700; color: var(--muted); font-size: 12.5px; padding: 10px; border-bottom: 1px solid var(--border); white-space: nowrap; background: #f8fafc; }
.table td { padding: 11px 10px; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
.table tbody tr:hover { background: #fafcfe; }
.table tr.inactive { opacity: .55; }
.table .actions { text-align: left; white-space: nowrap; }
.table.bordered th, .table.bordered td { border: 1px solid var(--border); }
.warn-row { background: #fffaf0; }
.strong-link { font-weight: 700; color: var(--text); display: inline-flex; align-items: center; gap: 7px; }
.strong-link:hover { color: var(--primary-2); }
.person { display: flex; align-items: center; gap: 10px; }

/* ---------- Bars chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 210px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar { flex: 1; width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; background: #f1f4f8; border-radius: 8px; overflow: hidden; }
.seg-p { background: var(--primary); }
.seg-a { background: var(--accent); }
.bar-val { font-weight: 800; font-size: 13px; }
.bar-lbl { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 16px; justify-content: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-p { background: var(--primary); }
.lg-a { background: var(--accent); }

/* ---------- Committees ---------- */
.committee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.committee-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; padding-top: 22px;
  box-shadow: var(--shadow); color: var(--text);
  position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.committee-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--c); }
.committee-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 10px 26px rgba(16, 38, 60, .1); }
.cc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cc-top h3 { font-size: 17px; }
.cc-coord { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.cc-coord .ic { color: var(--gold); width: 16px; }
.cc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; }
.cc-stats > div { background: #f5f8fb; border-radius: 10px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.cc-stats strong { font-size: 19px; line-height: 1.2; }
.cc-stats span { font-size: 12px; color: var(--muted); }
.cc-stats .ok { background: var(--success-soft); }
.cc-stats .ok strong { color: var(--success); }
.cc-stats .warn { background: var(--warning-soft); }
.cc-stats .warn strong { color: var(--warning); }
.cc-hint { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--warning); font-weight: 700; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.committee-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 22px 24px; margin-bottom: 18px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--c) 0%, color-mix(in srgb, var(--c) 70%, #000) 100%);
  color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 30%, transparent);
}
.committee-hero h2 { font-size: 23px; }
.committee-hero p { opacity: .88; margin-top: 4px; }
.committee-hero .badge { background: rgba(255, 255, 255, .95); }
.committee-hero .btn-light { border-color: transparent; }

.welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 24px; margin-bottom: 18px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--primary) 0%, #0f5578 60%, var(--accent) 130%);
  color: #fff;
}
.welcome h2 { font-size: 22px; }
.welcome p { opacity: .9; margin-top: 4px; }
.welcome-stat { background: rgba(255, 255, 255, .12); border-radius: 12px; padding: 10px 18px; text-align: center; }
.welcome-stat strong { display: block; font-size: 28px; line-height: 1.1; }
.welcome-stat span { font-size: 12.5px; opacity: .85; }

.tabs { display: flex; gap: 4px; }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 12px 12px 0 0;
  color: var(--muted); font-weight: 700;
  border: 1px solid transparent; border-bottom: 0;
}
.tab:hover { text-decoration: none; color: var(--text); background: #e8edf3; }
.tab.active { background: var(--card); color: var(--primary); border-color: var(--border); position: relative; top: 1px; }
.tab-card { border-top-right-radius: 0; }

.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef2f6; }
.people li:last-child { border-bottom: 0; }
.people strong { display: block; font-size: 14px; }
.people form { margin: 0; }

.inline-add { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.inline-add select { flex: 1; min-width: 130px; }
.inline-add.stack { flex-direction: column; }
.inline-add.stack .row-inline select { flex: 1; }

.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { padding: 6px 0; border-bottom: 1px solid #eef2f6; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }

.profile-top { display: flex; align-items: center; gap: 14px; }

/* ---------- Submissions ---------- */
.sub-list { display: flex; flex-direction: column; }
.sub { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid #edf1f5; }
.sub:first-child { padding-top: 4px; }
.sub:last-child { border-bottom: 0; padding-bottom: 0; }
.sub-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sub-icon.plan { background: var(--primary-soft); color: var(--primary); }
.sub-icon.achievement { background: var(--accent-soft); color: var(--accent); }
.sub-icon .ic { width: 22px; height: 22px; }
.sub-body { flex: 1; min-width: 0; }
.sub-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sub-head h3 { font-size: 15.5px; word-break: break-word; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.meta > span { display: inline-flex; align-items: center; gap: 4px; }
.meta .ic { width: 14px; height: 14px; }
.sub-desc { margin-top: 8px; font-size: 14px; white-space: pre-line; color: #3a4b5c; }
.note { margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; background: #f5f7fa; border-right: 3px solid var(--muted); }
.note-approved { background: var(--success-soft); border-color: var(--success); }
.note-revision { background: var(--danger-soft); border-color: var(--danger); }
.note-pending { background: var(--warning-soft); border-color: var(--warning); }
.sub-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 12px; }
.sub-actions form { margin: 0; }
.review > summary { list-style: none; }
.review > summary::-webkit-details-marker { display: none; }
.review[open] { flex-basis: 100%; order: 10; }
.review[open] > summary { background: #e8edf3; color: var(--text); }
.review-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding: 14px; background: #f6f9fc; border: 1px solid var(--border); border-radius: 12px; }
.review-form .btn { align-self: flex-start; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-block; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: #fff; font-size: 13.5px; font-weight: 700; }
.seg input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(20, 90, 134, .25); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ic { width: 44px; height: 44px; color: #b6c4d2; margin-bottom: 8px; }

.error-card { max-width: 480px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px; }
.error-card .ic { color: var(--warning); }
.error-card.standalone { margin-top: 12vh; }

/* ---------- Login ---------- */
.login-body { background: var(--bg); min-height: 100vh; }
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 15% 85%, rgba(29, 154, 138, .45), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(200, 150, 26, .25), transparent 40%),
    linear-gradient(150deg, #0b3c5d 0%, #082a42 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.login-hero::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 36px 36px;
}
.hero-inner { position: relative; z-index: 1; max-width: 440px; }
.hero-inner h1 { font-size: 32px; font-weight: 800; margin-top: 18px; }
.hero-inner > p { font-size: 18px; color: #b9d0e2; margin-top: 4px; }
.hero-points { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-direction: column; gap: 14px; }
.hero-points li { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.hero-points .ic { width: 38px; height: 38px; padding: 9px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #7fd6ca; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login-form h2 { font-size: 26px; color: var(--primary); }
.login-form .alert { margin: 0; }
.login-logo-sm { display: none; }

/* ---------- Print ---------- */
.print-head { display: none; }
.signatures { display: none; }

@media print {
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .foot, .no-print, .alert, .backdrop { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .card-head h2 { font-size: 14px; }
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  .table th { background: #eef2f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge { border: 1px solid #ccc; }
  .print-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--primary); padding-bottom: 10px; margin-bottom: 16px; }
  .print-head div { flex: 1; }
  .print-head h2 { font-size: 18px; color: var(--primary); }
  .page-break { page-break-before: always; }
  .signatures { display: flex; justify-content: space-around; margin-top: 40px; text-align: center; font-weight: 700; }
  .signatures span { display: block; margin-top: 30px; font-weight: 400; }
  tr { page-break-inside: avoid; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .layout-side { grid-template-columns: 1fr; }
  .layout-side > aside { order: -1; }
  .grid-2 { grid-template-columns: 1fr; }
  .filters-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(100%); box-shadow: none; }
  body.nav-open .sidebar { transform: none; box-shadow: -10px 0 30px rgba(0, 0, 0, .25); }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(8, 25, 40, .45); z-index: 30; }
  body.nav-open { overflow: hidden; }
  .main { margin-right: 0; }
  .topbar .menu-btn { display: inline-flex; color: var(--primary); }
  .topbar { padding: 10px 14px; }
  .topbar h1 { font-size: 18px; }
  .today { display: none; }
  .content { padding: 16px 14px; }
  .foot { padding: 14px; }
  .login { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-logo-sm { display: block; }
  .login-form { background: #fff; padding: 28px 22px; border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--border); }
  .login-form-wrap { align-items: flex-start; padding-top: 8vh; background: linear-gradient(180deg, var(--primary) 0 180px, var(--bg) 180px); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat-ic { width: 38px; height: 38px; }
  .stat strong { font-size: 21px; }
  .row-2 { grid-template-columns: 1fr; }
  .row-color { grid-template-columns: 1fr 70px; }
  .filters-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: 1 / -1; }
  .filters select { flex: 1; min-width: 0; }
  .toolbar > .btn { width: 100%; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .welcome { flex-direction: column; align-items: flex-start; }
  .committee-hero { padding: 18px; }
  .committee-hero h2 { font-size: 20px; }
  .sub { gap: 10px; }
  .sub-icon { width: 36px; height: 36px; }
  .sub-head { flex-direction: column; gap: 4px; }
  .tab { padding: 9px 12px; font-size: 14px; }
  .committee-grid { grid-template-columns: 1fr; }
  .bars { gap: 6px; }
  .bar-lbl { font-size: 10px; }

  /* الجداول كبطاقات على الموبايل */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
  .table-cards td { border: 0; padding: 5px 0; }
  .table-cards td[data-label]:not([data-label="المعلم"])::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
  .table-cards td[dir="ltr"] { text-align: right; }
  .table-cards .actions { text-align: right; padding-top: 8px; }
  .table-cards .actions .btn { width: 100%; }
}

/* ---------- الإشعارات ---------- */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; color: var(--primary); background: #fff; border: 1px solid var(--border); }
.bell:hover, .bell.active { background: var(--primary-soft); text-decoration: none; }
.bell .ic { width: 20px; height: 20px; }
.bell-count { position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li a { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-bottom: 1px solid #edf1f5; color: var(--muted); border-radius: 8px; }
.notif-list li a:hover { background: #f6f9fc; text-decoration: none; }
.notif-list li.unread a { color: var(--text); font-weight: 700; background: #f5f9fd; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: transparent; flex-shrink: 0; }
.notif-list li.unread .notif-dot { background: var(--accent); }

/* ---------- المهام ---------- */
.week-card { margin-bottom: 18px; border-top: 4px solid var(--accent); }
.card-head h2 small { font-weight: 500; font-size: 13px; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf1f5; }
.task:last-child { border-bottom: 0; }
.task form { margin: 0; }
.task-body { flex: 1; min-width: 0; }
.task-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-title strong { font-size: 15px; }
.task-done .task-title strong { text-decoration: line-through; color: var(--muted); }
.task-check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #b9c7d5; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; padding: 0; margin-top: 2px; }
.task-check:hover { border-color: var(--accent); }
.task-check .ic { width: 16px; height: 16px; stroke-width: 3; }
.task-check.disabled { cursor: default; opacity: .6; }
.task-done .task-check { background: var(--accent); border-color: var(--accent); }
.task-week { background: linear-gradient(90deg, transparent, #f3fbf9); }
.task-late .task-check { border-color: var(--danger); }
.meta .strong { color: var(--text); font-weight: 700; }
.state-done { background: var(--success-soft); color: var(--success); }
.state-late { background: var(--danger-soft); color: var(--danger); }
.state-week { background: var(--accent-soft); color: #147568; }
.state-upcoming, .state-current { background: #eef1f4; color: #6b7a8c; }
.sub-title .ic { width: 16px; height: 16px; }

.task-form { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.task-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.task-row .t-details { grid-column: 1 / -1; }
.task-row .field > span { font-size: 12px; }
.task-row input, .task-row select { padding: 8px 10px; }

/* ---------- صفحة الطباعة ---------- */
.print-page { background: #e9eef3; padding: 16px; }
.print-toolbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
.print-note { max-width: 800px; margin: 0 auto 14px; }
.sheet { background: #fff; max-width: 800px; margin: 0 auto; padding: 36px 40px; box-shadow: 0 4px 24px rgba(0, 0, 0, .1); border-radius: 6px; }
.sheet-head { display: flex; align-items: center; gap: 16px; border-bottom: 3px double var(--primary); padding-bottom: 12px; }
.sheet-head h1 { font-size: 20px; color: var(--primary); }
.sheet-head p { color: var(--muted); }
.sheet-title { text-align: center; margin: 22px 0 16px; font-size: 22px; }
.sheet-info { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet-info th, .sheet-info td { border: 1px solid #cfd8e2; padding: 8px 10px; text-align: right; }
.sheet-info th { background: #f1f5f9; width: 18%; white-space: nowrap; }
.sheet h3 { margin: 20px 0 6px; font-size: 16px; color: var(--primary); }
.sheet-text { white-space: pre-line; line-height: 1.9; }
.sheet-image { margin: 20px 0 0; text-align: center; }
.sheet-image img { max-width: 100%; max-height: 900px; border: 1px solid #ddd; }
.sheet-sign { display: flex; justify-content: space-around; margin-top: 50px; text-align: center; font-weight: 700; }
.sheet-sign span { display: block; margin-top: 8px; min-width: 160px; padding-top: 30px; border-bottom: 1px dotted #999; font-weight: 500; }
.pdf-frame { display: block; width: 100%; max-width: 1000px; height: 85vh; margin: 16px auto 0; border: 1px solid var(--border); border-radius: 6px; background: #fff; }

@media print {
  .print-page { background: #fff; padding: 0; }
  .sheet { box-shadow: none; max-width: none; padding: 0; }
  .sheet-info th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .layout-side { display: block; }
  .layout-side > aside, .committee-hero, .back-link, .upload-card, .tabs, .card-head.no-print, .sub-actions, .task-check-form, .bell { display: none !important; }
  .tab-card { border: 0; }
  .task { page-break-inside: avoid; }
}
@media (max-width: 860px) {
  .task-row { grid-template-columns: 1fr 1fr; }
  .task-row .t-title { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .sheet { padding: 20px 16px; }
  .sheet-info th { width: auto; }
  .bell { width: 36px; height: 36px; }
}
/* ---------- الشاشة الافتتاحية (الموبايل) ---------- */
.splash { display: none; }
@media (max-width: 860px) {
  .splash {
    display: flex; flex-direction: column; justify-content: space-between; align-items: center;
    position: fixed; inset: 0; z-index: 100;
    padding: 12vh 24px calc(28px + env(safe-area-inset-bottom));
    text-align: center; color: #fff; cursor: pointer;
    background:
      radial-gradient(circle at 20% 80%, rgba(29, 154, 138, .5), transparent 50%),
      radial-gradient(circle at 85% 12%, rgba(200, 150, 26, .28), transparent 45%),
      linear-gradient(160deg, #0b3c5d 0%, #072336 100%);
    transition: opacity .45s ease, visibility .45s ease;
  }
  .splash.hide { opacity: 0; visibility: hidden; }
  .splash-inner { display: flex; flex-direction: column; align-items: center; animation: splash-in .7s ease both; }
  .splash-inner img { filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .35)); }
  .splash h1 { font-size: 26px; font-weight: 800; margin-top: 18px; line-height: 1.45; }
  .splash > .splash-inner > p { color: #a8c4da; font-size: 16px; margin-top: 6px; }
  .splash-points { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
  .splash-points li { display: flex; align-items: center; gap: 10px; animation: splash-in .7s ease both; }
  .splash-points li:nth-child(1) { animation-delay: .12s; }
  .splash-points li:nth-child(2) { animation-delay: .22s; }
  .splash-points li:nth-child(3) { animation-delay: .32s; }
  .splash-points .ic { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #7fd6ca; }
  .splash-foot { width: 100%; max-width: 340px; animation: splash-in .7s ease .4s both; }
  .splash-btn { background: #fff; color: #0b3c5d; border: 0; }
  .splash-foot small { display: block; margin-top: 12px; color: #93b0c7; font-size: 12.5px; }
}
@keyframes splash-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .splash, .splash-inner, .splash-points li, .splash-foot { animation: none !important; transition: none !important; }
}
/* شعار المدرسة على الخلفيات الداكنة */
.brand img, .splash-inner img, .hero-inner img, .login-logo-sm, .sheet-head img, .print-head img {
  background: #fff; border-radius: 50%; padding: 2px; object-fit: contain;
}
.brand img { box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.splash-inner img { box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
/* إغلاق الشاشة الافتتاحية بدون جافاسكربت (عبر :target) */
@media (max-width: 860px) {
  #splash:target { opacity: 0; visibility: hidden; pointer-events: none; }
  .splash-btn { text-decoration: none !important; }
}