@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
  --navy: #0e7490;
  --navy-light: #0891b2;
  --green: #0d9488;
  --green-light: #ccfbf1;
  --theme: #0d9488;
  --theme-dark: #0e7490;
  --theme-deep: #155e75;
  --theme-light: #22d3ee;
  --theme-soft: #ccfbf1;
  --theme-softer: #f0fdfa;
  --theme-line: #99f6e4;
  --app-gradient: linear-gradient(135deg, var(--theme-dark) 0%, var(--theme) 55%, var(--theme-light) 100%);
  --sidebar-gradient: linear-gradient(195deg, var(--theme-dark) 0%, var(--theme) 58%, var(--theme-deep) 100%);
  --app-success: linear-gradient(135deg, #047857 0%, #059669 100%);
  --gold: #bc8c36;
  --ink: #254b53;
  --muted: #859daf;
  --line: #dcebe9;
  --canvas: #effbf8;
  --white: #fff;
  font-family: "Cairo", Tahoma, Arial, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }

.sidebar {
  width: 245px; flex: 0 0 245px; align-self: stretch; min-height: 0;
  background: linear-gradient(195deg,#155e75,#0e7490); color: #d6f5f2;
  display: flex; flex-direction: column; padding: 18px 13px 13px; border-radius: 0;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 26px; border-bottom: 1px solid #ffffff16; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; background: var(--green); color: #fff; border: 1px solid #ffffff30; border-radius: 13px; font-size: 24px; font-weight: 700; }
.brand strong, .brand span { display: block; }
.brand strong { color: #fff; font-size: 14px; }
.brand span { color: #a9bbc6; font-size: 11px; margin-top: 3px; }
.nav-caption { color: #8399a7; font-size: 11px; padding: 24px 13px 10px; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #c2d0d8; border-radius: 9px; padding: 11px 13px; display: flex; align-items: center; gap: 13px; text-align: right; font-size: 13px; transition: .18s ease; }
.nav-item:hover { color: #fff; background: #ffffff0b; }
.nav-item.active { color: #fff; background: var(--green); box-shadow: 0 7px 16px #0d55472b; }
.nav-icon { width: 20px; text-align: center; color: #a9bdc7; font-size: 18px; line-height: 1; }
.nav-item.active .nav-icon { color: #fff; }
.sidebar-bottom { margin-top: auto; }
.sidebar-user { margin: 20px 4px 13px; border-top: 1px solid #ffffff16; padding: 17px 8px 8px; display: flex; align-items: center; gap: 10px; }
.avatar, .top-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #d9eee8; color: var(--green); font-weight: 700; }
.user-meta { display: grid; gap: 3px; flex: 1; }
.user-meta strong { color: #fff; font-size: 12px; }
.user-meta span { font-size: 10px; color: #9fb0bb; }
.online-dot { width: 7px; height: 7px; background: #5ed39b; border-radius: 50%; }
.sidebar-foot { display: flex; justify-content: space-between; color: #8ba0ad; font-size: 10px; padding: 10px 8px 0; }

.main-content { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { height: 84px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 34px; }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; color: #9aa5ad; font-size: 11px; }
.breadcrumbs strong { color: var(--green); font-weight: 500; }
.crumb-sep { color: #c7cdd1; }
.topbar h1 { font-size: 19px; margin: 3px 0 0; color: var(--navy); font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.today-date { color: #697985; font-size: 11px; display: flex; gap: 8px; align-items: center; }
.calendar-icon { color: var(--green); font-size: 17px; }
.icon-button { border: 1px solid var(--line); background: #fff; color: #667681; border-radius: 9px; width: 36px; height: 36px; font-size: 20px; display: grid; place-items: center; }
.icon-button:hover { color: var(--green); border-color: #b8d8ce; }
.top-avatar { width: 34px; height: 34px; font-size: 13px; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; color: var(--navy); }
.content-area { width: 100%; max-width: 1500px; margin: 0 auto; padding: 27px 34px 36px; flex: 1; }
.page-footer { display: flex; justify-content: space-between; color: #9aa5ad; font-size: 10px; padding: 15px 34px; border-top: 1px solid var(--line); background: #fff; }
.welcome { padding: 21px 24px; margin-bottom: 22px; border-radius: 12px; background: linear-gradient(105deg, #143145, #1b4b50); color: #fff; position: relative; overflow: hidden; }
.welcome:after { content: ""; position: absolute; width: 230px; height: 230px; border: 1px solid #ffffff17; border-radius: 50%; top: -138px; left: 22%; box-shadow: 0 0 0 28px #ffffff08, 0 0 0 56px #ffffff05; }
.welcome .eyebrow { color: #b5d6cc; }
.welcome h2 { margin: 7px 0; font-size: 20px; }
.welcome p { color: #d0dfdf; margin: 0; font-size: 12px; }
.welcome-meta { position: absolute; left: 24px; top: 25px; font-size: 11px; color: #ccdedb; z-index: 1; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card, .panel, .table-card, .settings-card { background: #fff; border: 1px solid #edf0f2; border-radius: 11px; box-shadow: 0 2px 8px #142b3e05; }
.stat-card { padding: 17px 18px; min-height: 117px; position: relative; }
.stat-head { display: flex; justify-content: space-between; align-items: center; color: #7e8d98; font-size: 11px; }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; font-size: 18px; }
.stat-icon.green { color: var(--green); background: #e7f3ef; }
.stat-icon.gold { color: #aa7e31; background: #fbf3e5; }
.stat-icon.blue { color: #4680a1; background: #e9f2f7; }
.stat-icon.red { color: #b35b61; background: #faeeee; }
.stat-value { font-weight: 700; font-size: 25px; color: var(--navy); margin-top: 7px; }
.stat-note { color: #99a5ad; font-size: 10px; margin-top: 1px; }
.dashboard-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 17px; }
.panel { padding: 18px 20px; min-width: 0; }
.panel-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-heading h3, .section-heading h2 { color: var(--navy); margin: 0; font-size: 14px; }
.panel-heading p { color: #95a1a9; font-size: 10px; margin: 4px 0 0; }
.text-link { border: 0; background: none; color: var(--green); font-size: 11px; padding: 5px; }
.activity-list { margin-top: 14px; }
.activity-row { display: flex; align-items: center; gap: 11px; border-top: 1px solid #f0f2f3; padding: 12px 0; }
.activity-row:first-child { border-top: 0; }
.activity-badge { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #edf6f2; color: var(--green); }
.activity-copy { flex: 1; min-width: 0; }
.activity-copy strong, .activity-copy span { display: block; }
.activity-copy strong { font-size: 11px; color: #40515e; font-weight: 600; }
.activity-copy span { color: #9aa5ad; font-size: 10px; margin-top: 3px; }
.activity-date { color: #98a3aa; font-size: 10px; white-space: nowrap; }
.chart-wrap { height: 180px; display: flex; align-items: end; justify-content: space-around; gap: 13px; padding: 19px 5px 0; }
.chart-col { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; }
.chart-bar { width: min(34px,70%); min-height: 9px; border-radius: 5px 5px 2px 2px; background: #d8e9e4; position: relative; }
.chart-bar.current { background: var(--green); }
.chart-label { color: #929fa8; font-size: 10px; }
.chart-legend { color: #84929b; font-size: 10px; display: flex; align-items: center; gap: 7px; margin-top: 10px; }
.legend-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; }
.section-heading { margin-bottom: 19px; }
.section-heading h2 { font-size: 17px; }
.section-heading p { color: #8e9aa3; font-size: 11px; margin: 5px 0 0; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.search-box { width: 220px; height: 38px; border: 1px solid #e4e9ec; border-radius: 8px; background: #fff; display: flex; align-items: center; gap: 8px; padding: 0 11px; color: #9aa5ad; }
.search-box input { border: 0; background: transparent; outline: 0; width: 100%; color: var(--ink); font-size: 11px; }
.button { border: 1px solid transparent; padding: 9px 14px; border-radius: 8px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.button-primary { color: white; background: var(--green); box-shadow: 0 4px 10px #167a6420; }
.button-primary:hover { background: #106853; }
.button-light { border-color: #e4e9ec; color: #52616c; background: #fff; }
.button-light:hover { border-color: #b8d8ce; color: var(--green); }
.table-card { overflow: hidden; border-radius: 14px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
thead { background: var(--app-gradient); }
th { text-align: right; color: #fff; font-weight: 800; font-size: 11px; padding: 13px 15px; border-bottom: 0; border-left: 1px solid rgba(255,255,255,.16); }
th:last-child { border-left: 0; }
td { padding: 12px 15px; border-bottom: 1px solid #e7f3f0; font-size: 11px; color: #3f555c; }
tbody tr:nth-child(even) { background: #f7fcfb; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--theme-softer); }
.grade-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 78px; border-radius: 999px; padding: 4px 10px; font-size: 10px; font-weight: 800; border: 1px solid transparent; }
.grade-1 { background: #15803d; color: #fff; border-color: #166534; }
.grade-2 { background: #22c55e; color: #052e16; border-color: #16a34a; }
.grade-3 { background: #84cc16; color: #1a2e05; border-color: #65a30d; }
.grade-4 { background: #eab308; color: #422006; border-color: #ca8a04; }
.grade-5 { background: #facc15; color: #422006; border-color: #eab308; }
.grade-6 { background: #f59e0b; color: #431407; border-color: #d97706; }
.grade-7 { background: #f97316; color: #fff; border-color: #ea580c; }
.grade-8 { background: #ef4444; color: #fff; border-color: #dc2626; }
.grade-9 { background: #dc2626; color: #fff; border-color: #b91c1c; }
.grade-10 { background: #b91c1c; color: #fff; border-color: #991b1b; }
.grade-x { background: #e5e7eb; color: #374151; border-color: #d1d5db; }
.scale-table tr.grade-1 { background: #f0fdf4; }
.scale-table tr.grade-2 { background: #f7fee7; }
.scale-table tr.grade-3 { background: #f7fee7; }
.scale-table tr.grade-4 { background: #fefce8; }
.scale-table tr.grade-5 { background: #fefce8; }
.scale-table tr.grade-6 { background: #fff7ed; }
.scale-table tr.grade-7 { background: #fff7ed; }
.scale-table tr.grade-8 { background: #fef2f2; }
.scale-table tr.grade-9 { background: #fef2f2; }
.scale-table tr.grade-10 { background: #fff1f2; }
.scale-table tr.grade-1 td:first-child { border-inline-start: 4px solid #15803d; }
.scale-table tr.grade-2 td:first-child { border-inline-start: 4px solid #22c55e; }
.scale-table tr.grade-3 td:first-child { border-inline-start: 4px solid #84cc16; }
.scale-table tr.grade-4 td:first-child { border-inline-start: 4px solid #eab308; }
.scale-table tr.grade-5 td:first-child { border-inline-start: 4px solid #facc15; }
.scale-table tr.grade-6 td:first-child { border-inline-start: 4px solid #f59e0b; }
.scale-table tr.grade-7 td:first-child { border-inline-start: 4px solid #f97316; }
.scale-table tr.grade-8 td:first-child { border-inline-start: 4px solid #ef4444; }
.scale-table tr.grade-9 td:first-child { border-inline-start: 4px solid #dc2626; }
.scale-table tr.grade-10 td:first-child { border-inline-start: 4px solid #b91c1c; }
.employee-name { color: #344957; font-weight: 600; }
.employee-cell { display: flex; align-items: center; gap: 10px; }
.employee-avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--app-gradient); color: #fff; font-weight: 800; flex: 0 0 36px; }
.employee-link { border: 0; background: transparent; padding: 0; color: #1f3d45; font-weight: 800; font-size: 13px; cursor: pointer; }
.employee-cell .employee-sub { font-size: 12px; margin-top: 2px; }
.employee-number { font-weight: 800; color: #64748b; }
.salary-figure { color: #c07a12; font-weight: 800; white-space: nowrap; }
.salary-figure small { font-weight: 600; color: #8a6a32; margin-right: 4px; }
.row-actions { display: flex; gap: 6px; }
.row-actions .icon-button { width: 32px; height: 32px; font-size: 14px; }
.employee-sub { display: block; color: #9aa5ad; font-size: 9px; margin-top: 3px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 4px 9px; background: #e9f5ef; color: #267455; font-size: 10px; }
.badge.warn { background: #fff4e4; color: #a27126; }
.badge.danger { background: #fceced; color: #b55259; }
.badge.neutral { background: #edf2f5; color: #647681; }
.empty-state { text-align: center; padding: 44px 16px; color: #97a3ab; font-size: 12px; }
.empty-icon { color: #bdcbc9; font-size: 27px; margin-bottom: 8px; }
.summary-strip { display: flex; gap: 10px; margin-bottom: 15px; }
.summary-pill { background: #fff; border: 1px solid #edf0f2; border-radius: 9px; padding: 10px 15px; color: #73818b; font-size: 10px; }
.summary-pill strong { color: var(--navy); font-size: 16px; margin-left: 5px; }
.report-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.report-card { background: #fff; border: 1px solid #edf0f2; border-radius: 11px; padding: 19px; }
.report-card .stat-icon { margin-bottom: 14px; }
.report-card h3 { margin: 0 0 5px; color: var(--navy); font-size: 13px; }
.report-card p { margin: 0 0 18px; color: #8c99a2; font-size: 10px; line-height: 1.8; }
.grade-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grade-card { background: #fff; border: 1px solid #edf0f2; border-radius: 10px; padding: 16px; }
.grade-card h3 { color: var(--navy); font-size: 13px; margin: 0; }
.grade-card p { color: #8d9aa2; font-size: 10px; margin: 5px 0 12px; }
.grade-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.step-chip { padding: 5px 8px; background: #f1f6f4; color: #477568; border-radius: 6px; font-size: 9px; }
.sidebar { transition: transform .22s ease, opacity .22s ease; }
.workspace.sidebar-collapsed .sidebar {
  position: absolute !important;
  flex: 0 0 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden;
  transform: none;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.workspace.sidebar-collapsed .main-content { width: 100%; max-width: 100%; flex: 1 1 100%; }
.letter-hub { display: grid; gap: 16px; }
.letter-hub-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 18px 20px; border-radius: 16px; border: 1px solid #99f6e4;
  background: linear-gradient(135deg,#ecfeff 0%,#ccfbf1 100%); color: #0f766e;
  box-shadow: 0 8px 22px rgba(13,148,136,.12);
}
.letter-hub-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; color: #0e7490; }
.letter-hub-head p { margin: 4px 0 0; font-size: 11px; color: #0f766e; max-width: 520px; line-height: 1.7; }
.letter-hub-head.penalties h2 { color: #0e7490; }
.btn-hub-add {
  border: 0; border-radius: 12px; padding: 11px 16px; font-size: 11px; font-weight: 800; cursor: pointer;
  color: #04221f; background: linear-gradient(100deg,#22c55e,#10b981); box-shadow: 0 8px 22px #10b98145;
}
.btn-hub-add.penalty { color: #fff; background: linear-gradient(100deg,#ef4444,#dc2626); box-shadow: 0 8px 22px #ef444445; }
.letter-stat-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.letter-stat-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-radius: 14px; border: 1px solid #dcefea;
  background: #fff; box-shadow: 0 4px 14px #07565b0c;
}
.letter-stat-card strong { display: block; color: #07575d; font-size: 22px; font-family: ui-monospace, monospace; }
.letter-stat-card span.label { font-size: 10px; color: #7a969c; font-weight: 700; }
.letter-stat-card small { display: block; font-size: 9px; color: #95a8ae; margin-top: 2px; }
.letter-stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; }
.letter-stat-icon.honor { background: #e8faf3; color: #10b981; border: 1px solid #a7f3d0; }
.letter-stat-icon.staff { background: #e8faf3; color: #059669; border: 1px solid #a7f3d0; }
.letter-stat-icon.teacher { background: #e0f7f4; color: #0d9488; border: 1px solid #99f6e4; }
.letter-stat-icon.penalty { background: #fee2e2; color: #ef4444; border: 1px solid #fecaca; }
.letter-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 14px; }
.letter-card {
  border-radius: 16px; padding: 14px 15px; display: flex; flex-direction: column; gap: 10px;
  border: 1px solid transparent; min-height: 230px;
}
.letter-card.empty { background: #f0fdfa; border-color: #5eead4; box-shadow: 0 6px 16px rgba(13,148,136,.08); }
.letter-card.filled-honor { background: #ecfeff; border-color: #67e8f9; box-shadow: 0 6px 16px rgba(14,116,144,.1); }
.letter-card.filled-penalty { background: #f0fdfa; border-color: #99f6e4; box-shadow: 0 6px 16px rgba(13,148,136,.08); }
.letter-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.letter-card-title-wrap { display: flex; align-items: center; gap: 8px; }
.letter-card-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; }
.letter-card.empty .letter-card-icon { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
.letter-card.filled-honor .letter-card-icon { background: #cffafe; color: #0e7490; border: 1px solid #67e8f9; }
.letter-card.filled-penalty .letter-card-icon { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
.letter-card-sub { font-size: 10px; font-weight: 700; margin: 0; }
.letter-card.empty .letter-card-sub { color: #0f766e; }
.letter-card.filled-honor .letter-card-sub { color: #0e7490; }
.letter-card.filled-penalty .letter-card-sub { color: #0f766e; }
.letter-card-title { margin: 2px 0 0; font-size: 13px; font-weight: 800; font-family: ui-monospace, monospace; color: #134e4a; }
.letter-badge {
  font-size: 9px; font-weight: 800; padding: 5px 9px; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.letter-card.empty .letter-badge { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
.letter-card.filled-honor .letter-badge { background: #cffafe; color: #0e7490; border: 1px solid #67e8f9; }
.letter-card.filled-penalty .letter-badge { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
.letter-meta { font-size: 10px; color: #115e59; line-height: 1.75; border-top: 1px solid #99f6e4; border-bottom: 1px solid #99f6e4; padding: 9px 0; }
.letter-meta strong { color: #0f766e; font-weight: 700; }
.letter-meta .val { color: #134e4a; font-weight: 700; }
.letter-count {
  display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: #115e59;
  background: #ffffffcc; border-radius: 10px; padding: 9px 10px; border: 1px solid #99f6e4;
}
.letter-count strong { font-size: 11px; padding: 3px 8px; border-radius: 8px; font-weight: 800; }
.letter-card.empty .letter-count strong { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
.letter-card.filled-honor .letter-count strong { background: #cffafe; color: #0e7490; border: 1px solid #67e8f9; }
.letter-card.filled-penalty .letter-count strong { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
.letter-actions { display: flex; gap: 6px; align-items: center; margin-top: auto; }
.letter-actions .btn-card-add {
  flex: 1; border: 0; border-radius: 10px; padding: 9px 8px; font-size: 10px; font-weight: 800; cursor: pointer;
}
.letter-card.empty .btn-card-add { background: linear-gradient(100deg,#f59e0b,#eab308); color: #1f1300; animation: pulse-card 2s infinite; }
.letter-card.filled-honor .btn-card-add { background: linear-gradient(135deg,#0e7490,#0d9488); color: #fff; }
.letter-card.filled-penalty .btn-card-add { background: linear-gradient(135deg,#0e7490,#0d9488); color: #fff; }
.letter-actions .btn-card-view {
  border: 1px solid #99f6e4; background: #fff; color: #0f766e; border-radius: 10px; padding: 8px 10px; font-size: 10px; font-weight: 700; cursor: pointer;
}
.letter-card.empty .btn-card-view { border-color: #5eead4; color: #0f766e; }
.letter-card.filled-honor .btn-card-view { border-color: #67e8f9; color: #0e7490; }
.letter-card.filled-penalty .btn-card-view { border-color: #5eead4; color: #0f766e; }
.letter-actions .btn-card-delete {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid #ef444444; background: #ef444415; color: #f87171; cursor: pointer;
}
@keyframes pulse-card { 0%,100% { opacity: 1; } 50% { opacity: .88; } }
.dark-modal { background: rgba(14,116,144,.28); backdrop-filter: blur(4px); }
.modal-dark {
  background: #fff; border: 0; color: #1f2937; border-radius: 18px;
  box-shadow: 0 8px 32px rgba(14,116,144,.18);
}
.modal-head-dark h2 { color: #0e7490; font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.modal-dark .field label { color: #6b7280; }
.modal-dark .field input, .modal-dark .field select, .modal-dark .field textarea {
  background: #fff; border: 1px solid #e5e7eb; color: #1f2937; border-radius: 12px; color-scheme: light;
}
.modal-dark .field select option { background: #fff; color: #1f2937; }
.modal-dark .field input:focus, .modal-dark .field select:focus, .modal-dark .field textarea:focus {
  border-color: #0d9488; box-shadow: 0 0 0 3px rgba(13,148,136,.18);
}
.modal-dark.penalty-mode .field input:focus, .modal-dark.penalty-mode .field select:focus { border-color: #ef4444; box-shadow: 0 0 0 3px #ef444425; }
.modal-actions-dark { border-top-color: #f3f4f6; }
.button-muted { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.button-emerald { background: var(--app-success); color: #fff; font-weight: 800; border: 0; }
.button-emerald.penalty { background: linear-gradient(135deg,#dc2626,#ef4444); color: #fff; }
.book-form-grid { gap: 0 14px; }
.modal-book { width: min(560px,100%); padding: 0; overflow: hidden; }
.modal-book .modal-head { margin: 0; padding: 16px 18px; align-items: center; background: linear-gradient(135deg,#16a34a,#15803d); }
.modal-book.penalty-mode .modal-head { background: linear-gradient(135deg,#dc2626,#b91c1c); }
.modal-book .modal-head h2 { display: grid; gap: 2px; color: #fff; margin: 0; font-size: 16px; }
.book-kicker { font-size: 11px; font-weight: 700; opacity: .88; }
.modal-book .icon-button { background: rgba(255,255,255,.18); color: #fff; border-color: transparent; }
.modal-book .icon-button:hover { color: #fff; border-color: rgba(255,255,255,.45); }
.modal-book form { padding: 18px 18px 16px; }
.book-form-grid { gap: 2px 14px; }
.modal-book .field label { color: #334155; font-size: 11px; font-weight: 800; }
.field-optional { color: #94a3b8; font-weight: 600; }
.modal-book .field input, .modal-book .field select, .modal-book .field textarea { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 12px; min-height: 42px; }
.modal-book:not(.penalty-mode) .field input:focus,
.modal-book:not(.penalty-mode) .field select:focus,
.modal-book:not(.penalty-mode) .field textarea:focus { border-color: #16a34a; box-shadow: 0 0 0 3px #16a34a22; }
.modal-book .modal-actions { margin: 6px 0 0; padding-top: 14px; }
.modal-book .button-emerald { background: linear-gradient(135deg,#16a34a,#15803d); color: #fff; min-width: 150px; }
.modal-book.penalty-mode .button-emerald,
.modal-book .button-emerald.penalty { background: linear-gradient(135deg,#dc2626,#b91c1c); color: #fff; }
.letter-modal-dark .modal { background: #fff; border: 0; color: #1f2937; border-radius: 18px; }
.letter-picker-row { background: #f8fafc; border-color: #e5e7eb; color: #374151; }
.letter-picker-row.selected { background: #f0fdfa; border-color: #0d9488; }
@media (max-width: 800px) { .letter-stat-grid { grid-template-columns: 1fr; } }
.modal-wide { width: min(760px,100%); }
.letter-picker { max-height: 340px; overflow: auto; display: grid; gap: 8px; margin-top: 12px; }
.letter-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.letter-picker-row .employee-name { margin: 0; font-size: 11px; }
.letter-modal-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.letter-modal-tab { border: 0; background: #f3f4f6; color: #6b7280; border-radius: 8px; padding: 8px 12px; font-size: 10px; cursor: pointer; }
.letter-modal-tab.active { background: var(--app-gradient); color: #fff; font-weight: 800; }
.letter-modal-dark.penalty-hub .letter-modal-tab.active { background: linear-gradient(135deg,#dc2626,#ef4444); color: #fff; }
.letter-modal-dark.penalty-hub .letter-picker-row.selected { background: #fef2f2; border-color: #ef4444; }
.scale-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 22px 24px; border-radius: 14px; margin-bottom: 16px; color: #fff;
  background: linear-gradient(110deg,#147b8d 0%,#07998e 53%,#08aabe 100%);
  box-shadow: 0 10px 28px #07998e2e;
}
.scale-hero h2 { margin: 6px 0 4px; font-size: 18px; }
.scale-hero p { margin: 0; font-size: 11px; opacity: .92; }
.scale-hero .eyebrow { color: #d7fffa; }
.scale-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.scale-stat-card {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #dcefea;
  border-radius: 12px; padding: 14px 16px; box-shadow: 0 2px 10px #07565b0a;
}
.scale-stat-card strong { display: block; color: #07575d; font-size: 12px; margin-bottom: 3px; }
.scale-stat-card p { margin: 0; color: #7a969c; font-size: 10px; line-height: 1.6; }
.scale-stat-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; }
.scale-stat-icon.teal { background: #e0f7f4; color: #078e88; border: 1px solid #b8ebe4; }
.scale-stat-icon.gold { background: #fff7e8; color: #c07a12; border: 1px solid #f6dfae; }
.scale-stat-icon.green { background: #e7faf2; color: #0a8f67; border: 1px solid #b9ebd8; }
.scale-table-wrap { background: #fff; border: 1px solid #dcefea; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 18px #07565b0d; }
.scale-table { width: 100%; border-collapse: collapse; font-size: 10px; min-width: 980px; }
.scale-table thead { background: linear-gradient(100deg,#0c6f78,#07998e); color: #ecfffd; }
.scale-table th { padding: 11px 8px; font-weight: 700; text-align: center; border-left: 1px solid #ffffff1f; }
.scale-table td { padding: 9px 6px; text-align: center; border-top: 1px solid #edf3f2; border-left: 1px solid #f0f4f3; color: #3f555c; }
.scale-table tbody tr:nth-child(even) { background: #f8fcfb; }
.scale-table tbody tr:hover { background: #eef9f6; }
.scale-grade { font-weight: 800; color: #07575d; background: #f1faf8; }
.scale-input { width: 78px; max-width: 100%; border: 1px solid #cfe5e1; border-radius: 8px; padding: 6px 8px; font-size: 10px; text-align: center; color: #07575d; background: #fff; }
.scale-input.increment { color: #c07a12; font-weight: 700; }
.scale-input.years { color: #0a8f67; font-weight: 700; }
.scale-salary { font-weight: 700; color: #4a6168; font-family: ui-monospace, monospace; }
@media (max-width: 900px) { .scale-stats { grid-template-columns: 1fr; } }
.settings-page { display: grid; gap: 14px; }
.settings-tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px;
  background: #fff; border: 1px solid var(--theme-line); border-radius: 16px; padding: 8px;
  box-shadow: 0 2px 16px rgba(14,116,144,.08);
}
.settings-tab {
  border: 1px solid transparent; background: var(--theme-softer); color: var(--theme-dark); border-radius: 12px;
  padding: 12px 10px; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
}
.settings-tab.active { background: var(--app-gradient); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(14,116,144,.22); }
.settings-card { padding: 22px 24px; border-radius: 18px; }
.settings-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.settings-card h3 { color: #0e7490; font-size: 16px; margin: 0; }
.profile-layout { max-width: none; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.profile-fields { width: min(760px, 100%); min-width: 0; }
.profile-actions { display: flex; align-items: center; }
.settings-card .field label { font-size: 13px; font-weight: 700; color: #315a60; }
.settings-card .field-note { font-size: 12px; font-weight: 700; line-height: 1.45; }
.settings-card .field input { font-size: 14px; font-weight: 600; color: #1f3d45; }
.settings-card .role-lock { font-size: 14px; }
.settings-card .button { font-size: 13px; font-weight: 700; padding: 0 18px; height: 44px; width: 220px; }
.settings-head-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: #f0fdfa; color: #0d9488; border: 1px solid #99f6e4; }
.settings-card > p { font-size: 11px; color: #6b7280; margin: 0 0 16px; }
.settings-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.settings-split-3 { grid-template-columns: 1.2fr .7fr .9fr; }
.field-note { font-size: 10px; color: #0d9488; font-weight: 700; }
.role-lock { background: #f0fdfa; border: 1px solid #99f6e4; color: #0f766e; border-radius: 12px; padding: 12px 14px; font-size: 12px; font-weight: 800; }
.gm-badge { background: #ccfbf1; color: #047857; border: 1px solid #6ee7b7; border-radius: 999px; padding: 5px 12px; font-size: 11px; font-weight: 800; }
.settings-form { max-width: 580px; }
.settings-form.profile-layout { max-width: none; width: 100%; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 10px; color: #63737e; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #e2e8eb; outline: 0; border-radius: 7px; padding: 10px 11px; color: #384a57; background: #fff; font-size: 11px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #84b9a9; box-shadow: 0 0 0 3px #167a6410; }
.field textarea { resize: vertical; min-height: 70px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; }
.form-grid .field.full { grid-column: 1/-1; }
.field-hint { font-size: 9px; color: #98a4ab; }
.color-options { display: flex; gap: 10px; }
.color-choice { width: 30px; height: 30px; border: 3px solid #fff; outline: 1px solid #dce4e6; border-radius: 50%; }
.color-choice.selected { outline: 2px solid var(--navy); }
.modal-backdrop { position: fixed; z-index: 20; inset: 0; background: #10243380; display: grid; place-items: center; padding: 20px; }
.modal-backdrop[hidden] { display: none !important; pointer-events: none !important; visibility: hidden !important; }
.letter-actions button { cursor: pointer; pointer-events: auto; position: relative; z-index: 1; }
.btn-hub-add { cursor: pointer; pointer-events: auto; }
.modal { width: min(620px,100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 20px 60px #0e263640; }
.modal-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 18px; }
.modal-head h2 { color: var(--navy); font-size: 17px; margin: 4px 0 0; }
.eyebrow { color: var(--green); font-size: 10px; }
.modal-description { margin: 5px 0 0; color: #7b8d94; font-size: 11px; font-weight: 600; }
.modal-actions { border-top: 1px solid var(--line); padding-top: 15px; display: flex; justify-content: flex-start; gap: 8px; margin-top: 9px; }
.employee-record-modal {
  width: min(860px, 100%); height: min(720px, calc(100vh - 48px)); max-height: calc(100vh - 48px);
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid var(--theme-line); border-radius: 18px;
}
.employee-record-modal .modal-head {
  margin: 0; padding: 20px 24px; align-items: center;
  background: linear-gradient(100deg, #0f766e 0%, #0d9488 58%, #2dd4bf 100%);
  color: #fff;
}
.employee-record-modal .modal-head h2 { margin: 3px 0 0; color: #fff; font-size: 21px; font-weight: 900; }
.employee-record-modal .eyebrow { color: #ccfbf1; font-size: 11px; font-weight: 800; }
.employee-record-modal .modal-description { color: rgba(255,255,255,.86); }
.employee-record-modal .modal-head .icon-button {
  background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.32); color: #fff;
}
.employee-record-modal .modal-head .icon-button:hover { background: rgba(255,255,255,.26); border-color: #fff; color: #fff; }
.employee-record-modal #record-form {
  flex: 1; min-height: 0; overflow: hidden; padding: 0; display: flex; flex-direction: column;
}
.employee-record-modal #form-fields {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px;
  display: grid; grid-template-columns: 1fr; gap: 12px;
  scrollbar-color: var(--theme-line) transparent; scrollbar-width: thin;
}
.employee-form-section {
  padding: 13px 15px 0; border: 1px solid #dcebe9; border-radius: 14px;
  background: linear-gradient(135deg, #fff 0%, var(--theme-softer) 100%);
}
.employee-form-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.employee-form-section-head > span {
  width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px;
  border-radius: 9px; background: var(--app-gradient); color: #fff; font-size: 12px; font-weight: 900;
  box-shadow: 0 5px 12px rgba(13,148,136,.2);
}
.employee-form-section-head strong { display: block; color: var(--theme-dark); font-size: 13px; font-weight: 900; }
.employee-form-section-head small { display: block; margin-top: 1px; color: #82949a; font-size: 10px; font-weight: 600; }
.employee-form-grid { display: grid; gap: 0 12px; }
.employee-form-grid.basic-fields, .employee-form-grid.contact-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.employee-form-grid.job-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.employee-record-modal .field { margin-bottom: 12px; gap: 6px; }
.employee-record-modal .field label { color: #315a60; font-size: 11px; font-weight: 800; }
.employee-record-modal .field label b { color: #dc2626; font-size: 10px; }
.employee-record-modal .field input,
.employee-record-modal .field select {
  height: 42px; border: 1px solid #cfe1df; border-radius: 10px; padding: 0 12px;
  color: #25464d; background: #fff; font-family: "Cairo", Tahoma, sans-serif;
  font-size: 12px; font-weight: 700; transition: border-color .2s, box-shadow .2s, background .2s;
}
.employee-record-modal .field input::placeholder { color: #a5b4b8; font-weight: 500; }
.employee-record-modal .field input:focus,
.employee-record-modal .field select:focus {
  border-color: var(--theme); background: #fff;
  box-shadow: 0 0 0 3px var(--theme-soft);
}
.user-role-field { margin-bottom: 13px !important; }
.user-role-options { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.user-role-option {
  --role-color: #0d9488; --role-bg: #f0fdfa; --role-border: #99f6e4;
  position: relative; min-height: 104px; padding: 13px 13px 11px;
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
  border: 2px solid var(--role-border); border-radius: 13px;
  background: var(--role-bg); color: var(--role-color);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.user-role-option:hover { transform: translateY(-2px); box-shadow: 0 7px 17px color-mix(in srgb, var(--role-color) 18%, transparent); }
.user-role-option:has(input:checked) {
  border-color: var(--role-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--role-color) 16%, transparent);
}
.user-role-option input {
  position: absolute; top: 10px; left: 10px; width: 17px !important; height: 17px !important;
  padding: 0 !important; accent-color: var(--role-color); box-shadow: none !important;
}
.user-role-option-icon {
  width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px;
  border-radius: 10px; background: #fff; border: 1px solid var(--role-border); font-size: 17px;
}
.user-role-option strong { display: block; padding-left: 17px; color: var(--role-color); font-size: 11px; font-weight: 900; }
.user-role-option small { display: block; margin-top: 4px; color: #64748b; font-size: 9px; font-weight: 700; line-height: 1.55; }
.user-role-option.system-role { --role-color: #b91c1c; --role-bg: #fef2f2; --role-border: #fecaca; }
.user-role-option.hr-role { --role-color: #4338ca; --role-bg: #eef2ff; --role-border: #c7d2fe; }
.user-role-option.promotion-role { --role-color: #047857; --role-bg: #ecfdf5; --role-border: #a7f3d0; }
.user-status-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.user-status-option {
  --status-color: #047857; --status-bg: #ecfdf5; --status-border: #a7f3d0;
  position: relative; min-height: 76px; padding: 12px 13px;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 2px solid var(--status-border); border-radius: 13px;
  background: var(--status-bg); color: var(--status-color);
  transition: transform .18s, box-shadow .18s;
}
.user-status-option:hover { transform: translateY(-2px); }
.user-status-option:has(input:checked) {
  border-color: var(--status-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color) 16%, transparent);
}
.user-status-option input {
  position: absolute; top: 9px; left: 9px; width: 17px !important; height: 17px !important;
  padding: 0 !important; accent-color: var(--status-color); box-shadow: none !important;
}
.user-status-option-icon {
  width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px;
  border-radius: 10px; background: #fff; border: 1px solid var(--status-border); font-size: 16px; font-weight: 900;
}
.user-status-option strong { display: block; padding-left: 17px; color: var(--status-color); font-size: 11px; font-weight: 900; }
.user-status-option small { display: block; margin-top: 3px; color: #64748b; font-size: 9px; font-weight: 700; }
.user-status-option.stopped-status { --status-color: #b91c1c; --status-bg: #fef2f2; --status-border: #fecaca; }
.password-control { position: relative; display: flex; align-items: center; width: 100%; }
.password-control input {
  width: 100%; padding-left: 44px !important; user-select: text !important; -webkit-user-select: text !important;
}
input[type="password"] { user-select: text !important; -webkit-user-select: text !important; }
input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none; }
.password-toggle {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 30px; height: 30px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: #527078; cursor: pointer;
}
.password-toggle svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.password-toggle:hover { background: var(--theme-soft); color: var(--theme-dark); }
.auth-input.password-control { position: relative; }
.auth-input.password-control input { padding-left: 40px !important; }
.auth-input .password-toggle { left: 10px; }
.setup-password-control input { height: 43px; }
.setup-password-control .password-toggle { left: 7px; }
.employee-record-modal .modal-actions {
  position: static; flex: 0 0 auto; z-index: 2; margin: 0; padding: 13px 20px;
  background: rgba(255,255,255,.96); border-top: 1px solid #dcebe9;
  backdrop-filter: blur(8px);
}
.employee-record-modal .modal-actions .button { min-width: 120px; height: 40px; border-radius: 10px; font-size: 12px; font-weight: 800; }
.employee-record-modal .modal-actions .button-primary { background: var(--app-gradient); box-shadow: 0 7px 16px rgba(13,148,136,.2); }
@media (max-width: 700px) {
  .employee-record-modal .modal-head { padding: 17px 18px; }
  .employee-record-modal #form-fields { padding-inline: 14px; }
  .employee-form-grid.basic-fields,
  .employee-form-grid.contact-fields,
  .employee-form-grid.job-fields { grid-template-columns: 1fr; }
  .user-role-options { grid-template-columns: 1fr; }
  .user-status-options { grid-template-columns: 1fr; }
  .employee-record-modal .modal-actions { padding-inline: 14px; }
}

/* هوية موحدة لجميع النوافذ المنبثقة */
.modal-backdrop { backdrop-filter: blur(4px); }
.record-modal:not(.employee-record-modal),
.import-modal,
.modal-book,
.letter-modal-dark .modal {
  padding: 0; overflow: hidden; border: 1px solid var(--theme-line); border-radius: 18px;
  box-shadow: 0 22px 65px rgba(15, 76, 72, .25);
}
.record-modal:not(.employee-record-modal) .modal-head,
.import-modal .modal-head,
.modal-book .modal-head,
.letter-modal-dark .modal-head {
  margin: 0; padding: 18px 20px; align-items: center;
  background: linear-gradient(100deg, #0f766e 0%, #0d9488 58%, #2dd4bf 100%);
  color: #fff;
}
.record-modal:not(.employee-record-modal) .modal-head h2,
.import-modal .modal-head h2,
.modal-book .modal-head h2,
.letter-modal-dark .modal-head h2 { color: #fff; font-size: 18px; font-weight: 900; }
.record-modal:not(.employee-record-modal) .modal-head .eyebrow,
.letter-modal-dark .modal-head .eyebrow { color: #ccfbf1; font-weight: 800; }
.import-modal .modal-head p { color: rgba(255,255,255,.86); font-weight: 600; }
.record-modal:not(.employee-record-modal) .modal-head .icon-button,
.import-modal .modal-head .icon-button,
.modal-book .modal-head .icon-button,
.letter-modal-dark .modal-head .icon-button {
  background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.32); color: #fff;
}
.record-modal:not(.employee-record-modal) .modal-head .icon-button:hover,
.import-modal .modal-head .icon-button:hover,
.modal-book .modal-head .icon-button:hover,
.letter-modal-dark .modal-head .icon-button:hover {
  background: rgba(255,255,255,.26); border-color: #fff; color: #fff;
}
.record-modal:not(.employee-record-modal) #record-form { padding: 18px 20px 0; }
.import-modal .import-grid { margin: 18px 20px 0; }
.import-modal > .modal-actions { margin: 16px 0 0; padding: 13px 20px; background: #fff; }
.letter-modal-dark #letter-modal-body { padding: 18px 20px 20px; }
.modal-book.penalty-mode .modal-head { background: linear-gradient(100deg, #0f766e 0%, #0d9488 58%, #2dd4bf 100%); }
.modal-book .button-emerald,
.modal-book.penalty-mode .button-emerald,
.modal-book .button-emerald.penalty { background: var(--app-gradient); }
.modal-book {
  height: min(560px, calc(100vh - 48px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
}
.modal-book .modal-head { flex: 0 0 auto; }
.modal-book #book-create-form {
  flex: 1; min-height: 0; overflow: hidden; padding: 0;
  display: flex; flex-direction: column;
}
.modal-book #book-create-fields {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 4px;
  scrollbar-color: var(--theme-line) transparent; scrollbar-width: thin;
}
.modal-book .modal-actions {
  flex: 0 0 auto; margin: 0; padding: 13px 18px;
  background: #fff; border-top: 1px solid #dcebe9;
}
.modal-book .modal-actions .button { min-height: 40px; border-radius: 10px; font-weight: 800; }
.career-modal {
  width: min(700px, 100%); max-height: calc(100vh - 48px); padding: 0; overflow: hidden;
  border: 1px solid var(--theme-line); border-radius: 18px;
  box-shadow: 0 22px 65px rgba(15,76,72,.25);
}
.career-modal .modal-head {
  margin: 0; padding: 18px 20px; align-items: center;
  background: linear-gradient(100deg, #0f766e 0%, #0d9488 58%, #2dd4bf 100%);
}
.career-modal .modal-head h2 { color: #fff; font-size: 18px; font-weight: 900; }
.career-modal .modal-head .eyebrow { color: #ccfbf1; font-weight: 800; }
.career-modal .modal-description { color: rgba(255,255,255,.86); }
.career-modal .modal-head .icon-button { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.32); color: #fff; }
.career-modal form { max-height: calc(100vh - 145px); display: flex; flex-direction: column; }
.career-form-body { padding: 18px 20px 5px; overflow-y: auto; }
.career-type-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.career-type-options label { position: relative; cursor: pointer; }
.career-type-options input { position: absolute; opacity: 0; pointer-events: none; }
.career-type-options span {
  min-height: 44px; display: grid; place-items: center; border-radius: 11px;
  border: 2px solid #dcebe9; background: #fff; color: #47646a; font-size: 11px; font-weight: 900;
}
.career-type-options label:first-child input:checked + span { color: #fff; background: #ca8a04; border-color: #854d0e; box-shadow: 0 5px 13px rgba(161,98,7,.25); }
.career-type-options label:last-child input:checked + span { color: #fff; background: #15803d; border-color: #14532d; box-shadow: 0 5px 13px rgba(21,128,61,.25); }
.career-form-note { margin: 0 0 8px; padding: 9px 11px; border-radius: 9px; background: #f0fdfa; color: #315a60; font-size: 10px; font-weight: 700; }
.career-modal .modal-actions { flex: 0 0 auto; margin: 0; padding: 13px 20px; background: #fff; }
.toast-stack {
  position: fixed; top: 84px; left: 22px; z-index: 80;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(420px, calc(100vw - 44px)); pointer-events: none;
}
.app-toast {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px 16px 44px; border-radius: 14px; color: #fff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .22); overflow: hidden;
  pointer-events: auto; opacity: 0; transform: translateX(-24px) scale(.96);
  transition: opacity .35s ease, transform .35s cubic-bezier(.22, 1, .36, 1);
  font-family: "Cairo", Tahoma, sans-serif;
}
.app-toast.show { opacity: 1; transform: translateX(0) scale(1); }
.app-toast.hide { opacity: 0; transform: translateX(-16px) scale(.98); }
.app-toast-icon {
  width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.22);
  display: grid; place-items: center; flex: 0 0 auto;
}
.app-toast-icon svg { width: 22px; height: 22px; }
.app-toast-content { min-width: 0; flex: 1; }
.app-toast-content strong { display: block; font-size: 14px; font-weight: 800; margin-bottom: 2px; }
.app-toast-content p { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.45; }
.app-toast-close {
  position: absolute; top: 10px; left: 10px; width: 28px; height: 28px;
  border: 0; border-radius: 8px; background: rgba(255,255,255,.18); color: #fff;
  display: grid; place-items: center; cursor: pointer; font-size: 16px; line-height: 1;
}
.app-toast-close:hover { background: rgba(255,255,255,.32); }
.app-toast-progress {
  position: absolute; bottom: 0; right: 0; left: 0; height: 3px;
  background: rgba(255,255,255,.45); transform-origin: right center;
  animation: toastProgress linear forwards;
}
@keyframes toastProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.app-toast-success { background: linear-gradient(135deg, #059669 0%, #10b981 55%, #34d399 100%); border: 1px solid rgba(255,255,255,.25); }
.app-toast-error { background: linear-gradient(135deg, #b91c1c 0%, #dc2626 55%, #ef4444 100%); border: 1px solid rgba(255,255,255,.22); }
@media (max-width: 600px) {
  .toast-stack { left: 12px; right: 12px; max-width: none; }
}
.loading { color: #82909b; padding: 40px; text-align: center; font-size: 12px; }

@media (max-width: 1120px) {
  .sidebar { width: 235px; flex-basis: 235px; }
  .content-area { padding: 24px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grade-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 800px) {
  .sidebar { position: fixed; z-index: 10; right: 0; top: 0; bottom: 0; transform: translateX(100%); transition: transform .2s ease; width: 270px; }
  .sidebar.open { transform: translateX(0); box-shadow: -10px 0 30px #142b3e30; }
  .mobile-menu { display: block; }
  .topbar { padding: 0 18px; height: 72px; }
  .content-area { padding: 20px 17px 28px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .grade-grid { grid-template-columns: repeat(2,1fr); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-split, .settings-split-3 { grid-template-columns: 1fr; }
  .settings-tabs { grid-template-columns: 1fr 1fr; }
  .profile-layout { flex-direction: column; align-items: stretch; }
  .profile-actions { justify-content: flex-end; }
  .settings-tab { white-space: nowrap; }
  .page-footer { padding-inline: 18px; }
}
@media (max-width: 540px) {
  .today-date { display: none; }
  .topbar h1 { font-size: 16px; }
  .welcome { padding: 19px; }
  .welcome-meta { display: none; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 13px; min-height: 105px; }
  .stat-value { font-size: 22px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .search-box { flex: 1; min-width: 0; }
  .heading-actions .button { padding-inline: 10px; }
  .report-grid { grid-template-columns: 1fr; }
  .grade-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field.full { grid-column: auto; }
  .page-footer { gap: 9px; flex-direction: column; }
}

/* Reference-inspired turquoise identity and full-width main navigation. */
body { background: var(--theme-softer); }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: relative; z-index: 5; flex: 0 0 76px; height: 76px; width: 100%;
  padding: 0 30px; border: 0; color: #fff;
  background: var(--app-gradient); box-shadow: 0 4px 18px rgba(0,0,0,.12); gap: 25px;
}
.top-brand { display: flex; align-items: center; gap: 11px; min-width: 220px; color: #fff; text-decoration: none; cursor: pointer; }
.top-brand:hover strong { color: #fff; }
.top-brand > span:last-child { display: grid; gap: 1px; }
.topbar, .topbar button, .topbar a { font-family: "Cairo", Tahoma, Arial, sans-serif; }
.top-brand strong { color: #fff; font-size: 13px; font-weight: 700; }
.top-brand small { color: rgba(255,255,255,.86); font-size: 11px; font-weight: 700; }
.brand-mark { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 13px; box-shadow: none; }
.topbar-actions { gap: 10px; }
.topbar-actions .today-date { font-family: inherit; color: #fff; }
.calendar-icon { color: #fff; }
.top-avatar { background: rgba(255,255,255,.22); color: #fff; }
.logout-link { color: #fff; text-decoration: none; font-size: 11px; border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.12); border-radius: 20px; padding: 8px 12px; white-space: nowrap; }
.logout-link:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.22); }
.impersonation-banner {
  position: relative; z-index: 4; min-height: 52px; padding: 9px 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  color: #fff; background: linear-gradient(135deg, #b45309 0%, #d97706 55%, #f59e0b 100%);
  border-bottom: 2px solid #fcd34d; box-shadow: 0 4px 14px rgba(217,119,6,.28);
  font-size: 12px; font-weight: 700;
}
.impersonation-info { display: flex; align-items: center; gap: 9px; }
.impersonation-icon {
  width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px;
  border-radius: 9px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25);
}
.impersonation-banner code {
  color: #fef3c7; background: rgba(0,0,0,.15); padding: 2px 7px; border-radius: 6px;
  font-family: Consolas, monospace; direction: ltr;
}
.impersonation-banner form { margin: 0; }
.impersonation-return {
  min-height: 35px; padding: 7px 13px; border: 0; border-radius: 9px;
  background: #fff; color: #b45309; font-family: "Cairo", Tahoma, sans-serif;
  font-size: 11px; font-weight: 900; white-space: nowrap;
}
.impersonation-return:hover { background: #fffbeb; color: #92400e; }
.app-shell.is-impersonating .workspace { min-height: calc(100vh - 128px); }
.mobile-menu { display: grid; color: #fff; }
.workspace { display: flex; flex: 1; min-height: calc(100vh - 76px); align-items: stretch; }
.sidebar {
  width: 245px; flex: 0 0 245px; align-self: stretch; height: auto; min-height: 0;
  margin: 0; background: var(--sidebar-gradient);
  color: #e7fffb; border: 0; border-left: 1px solid #0c4a6e; border-radius: 0; box-shadow: none;
  padding: 18px 13px 13px; position: relative; top: auto;
}
.nav-caption { padding: 8px 12px 10px; color: #d6fffa; font-size: 11px; font-weight: 700; }
.nav-list { padding: 0; gap: 5px; }
.nav-item {
  color: #e7fffb; border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 700;
  border-right: 0;
}
.nav-item:hover { color: #fff; background: #ffffff18; }
.nav-item.active { color: #fff; background: rgba(255,255,255,.22); box-shadow: none; }
.nav-icon { color: #b7fff4; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { color: #fff; }
.sidebar-bottom { margin-top: auto; padding: 0; }
.sidebar-user { border-top: 1px solid #ffffff22; margin: 16px 4px 8px; }
.user-meta strong { color: #fff; }
.user-meta span, .sidebar-foot { color: #d5f7f3; }
.avatar { background: #ccfbf1; color: #0d9488; }
.rights-nav { text-decoration: none; }
.main-content { min-width: 0; flex: 1; min-height: calc(100vh - 76px); background: #f6fbfa; display: flex; flex-direction: column; }
.page-footer { margin-top: auto; }
.content-area { max-width: none; padding: 18px 34px 32px; }
.page-footer { color: #88a2a5; border-top-color: #e2efed; flex-direction: column; align-items: center; gap: 10px; padding: 20px 34px; }
.page-footer > span:first-child { font-size: 10px; }
.welcome { background: var(--app-gradient); }
.button-primary { background: var(--app-gradient); }
.button-primary:hover { background: linear-gradient(135deg,#0c6478,#0f766e 50%,#0891b2); }
.scale-hero { background: var(--app-gradient); }
.scale-table thead { background: var(--app-gradient); }
.icon-button { border-color: #dcebe9; color: #4f7c82; }
.icon-button:hover { color: var(--theme-dark); border-color: var(--theme-line); }
.topbar .icon-button { background: rgba(255,255,255,.16); color: #fff; border-color: transparent; }
.topbar .icon-button:hover { color: #fff; border-color: rgba(255,255,255,.55); }
.stat-icon.green { color: #078e88; background: #e0f7f2; }
.badge { background: #e3f8f2; color: #168875; }
.settings-tab.active { background: var(--app-gradient); color: #fff; }
.password-section { border-top: 1px solid #e7efef; margin-top: 20px; padding-top: 17px; }
.password-section h4 { font-size: 12px; color: #315a60; margin: 0 0 3px; }
.password-section > p { font-size: 10px; color: #8c99a2; margin: 0 0 12px; }

.auth-body { min-width: 320px; min-height: 100vh; background: #eefbf8; }
.auth-layout { min-height: 100vh; width: 100%; display: flex; flex-direction: row; direction: ltr; overflow: hidden; border: 1px solid #d5e8e5; border-radius: 9px; }
.auth-form-panel { flex: 0 0 36.3%; min-width: 435px; display: flex; justify-content: center; align-items: center; background: #effbf8; padding: 34px clamp(34px,5vw,78px); direction: rtl; }
.auth-form-content { width: 100%; max-width: 450px; text-align: center; display: flex; flex-direction: column; align-items: stretch; }
.auth-form-content h1, .rights-info-content h1 { color: #07575c; font-size: 24px; line-height: 1.35; margin: 0; font-weight: 800; }
.auth-subtitle { color: #82a5ab; font-size: 12.5px; margin: 5px 0 25px; font-weight: 400; }
.welcome-pill { min-width: 190px; width: fit-content; margin: 0 auto 20px; padding: 9px 20px; border-radius: 26px; border: 1.5px solid #4de5cf; color: #078e89; background: #b7f5e9; font-size: 12px; font-weight: 700; }
.welcome-pill span { margin-right: 7px; }
.form-divider { position: relative; display: flex; align-items: center; gap: 14px; color: #9bb1c0; margin-bottom: 19px; font-size: 11px; }
.form-divider:before, .form-divider:after { content: ""; flex: 1; height: 1px; background: #d9e8eb; }
.auth-error { text-align: right; color: #aa4247; background: #ffefef; border: 1px solid #f5d0d1; border-radius: 8px; padding: 9px 12px; font-size: 11px; margin: 0 0 12px; }
.auth-form { display: grid; gap: 18px; }
.auth-input { height: 58px; display: flex; align-items: center; gap: 14px; background: #fff; border: 2px solid #e6eceb; border-radius: 13px; box-shadow: 0 3px 10px #2258570b; padding: 0 16px; transition: .15s ease; }
.auth-input:focus-within { border-color: #42d5c4; box-shadow: 0 0 0 4px #27bba719; }
.auth-input input { width: 100%; border: 0; outline: 0; background: transparent; color: #315960; font-family: inherit; font-size: 14px; text-align: right; }
.auth-input input::placeholder { color: #9eafc1; opacity: 1; }
.input-symbol { width: 23px; height: 23px; flex: 0 0 23px; color: #079a91; display: grid; place-items: center; }
.input-symbol svg { fill: currentColor; width: 22px; height: 22px; }
.auth-submit { width: 100%; min-height: 56px; border: 0; border-radius: 13px; display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; background: linear-gradient(105deg,#079a91 0%,#078ead 100%); box-shadow: 0 11px 23px #079c9a35; font-family: inherit; font-size: 14px; font-weight: 800; text-decoration: none; transition: transform .16s ease,box-shadow .16s ease; }
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 13px 26px #079c9a45; }
.auth-form .auth-submit { margin-top: 2px; }
.first-setup-link { color: #078e88; font-size: 11px; text-decoration: none; margin-top: 14px; }
.first-setup-link:hover { text-decoration: underline; }
.auth-footer { margin-top: 20px; border-top: 1px solid #dff0ec; padding-top: 15px; display: flex; align-items: center; flex-direction: column; gap: 10px; }
.auth-footer p { margin: 0; color: #8199ac; font-size: 11px; }
.developer-badge { direction: ltr; display: inline-flex; align-items: center; gap: 8px; border-radius: 30px; padding: 9px 22px; color: #fff; background: var(--app-gradient); text-decoration: none; font-family: Arial,sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; border: 1px solid rgba(255,255,255,.45); box-shadow: 0 4px 16px rgba(0,0,0,.12); transition: transform .25s ease, box-shadow .25s ease; }
.letter-hub-head:not(.penalties) {
  background: linear-gradient(100deg, #0f766e 0%, #0d9488 55%, #2dd4bf 100%);
  border-color: #0f766e;
  color: #fff;
  box-shadow: 0 8px 22px rgba(13,148,136,.28);
}
.letter-hub-head:not(.penalties) h2,
.letter-hub-head:not(.penalties) p { color: #fff; }
.letter-hub-head.penalties { background: linear-gradient(135deg, var(--theme-softer), var(--theme-soft)); border-color: var(--theme-line); color: var(--theme-deep); }
.letter-hub-head.penalties h2 { color: var(--theme-dark); }
.letter-hub-head.penalties p { color: var(--theme-deep); }
@property --card-spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes card-spin { to { --card-spin: 360deg; } }
.letter-card.empty,
.letter-card.filled-honor,
.letter-card.filled-penalty,
.letter-card.penalty-empty {
  border: 2px solid transparent;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  animation: card-spin 2.6s linear infinite;
}
.letter-card.empty,
.letter-card.penalty-empty {
  background-image: linear-gradient(#fffbeb,#fffbeb), conic-gradient(from var(--card-spin), #f59e0b, #fde68a, #f59e0b 40%, #fbbf24, #f59e0b);
}
.letter-card.filled-honor {
  background-image: linear-gradient(#f0fdf4,#f0fdf4), conic-gradient(from var(--card-spin), #16a34a, #86efac, #16a34a 40%, #4ade80, #16a34a);
}
.letter-card.filled-penalty {
  background-image: linear-gradient(#fef2f2,#fef2f2), conic-gradient(from var(--card-spin), #dc2626, #fca5a5, #dc2626 40%, #f87171, #dc2626);
}
.letter-card.empty .letter-card-title,
.letter-card.penalty-empty .letter-card-title,
.letter-card.empty .letter-meta,
.letter-card.penalty-empty .letter-meta,
.letter-card.empty .letter-meta .val,
.letter-card.penalty-empty .letter-meta .val,
.letter-card.empty .letter-count,
.letter-card.penalty-empty .letter-count { color: #92400e; }
.letter-card.empty .letter-card-sub,
.letter-card.penalty-empty .letter-card-sub,
.letter-card.empty .letter-meta strong,
.letter-card.penalty-empty .letter-meta strong { color: #b45309; }
.letter-card.empty .letter-card-icon,
.letter-card.penalty-empty .letter-card-icon,
.letter-card.empty .letter-badge,
.letter-card.penalty-empty .letter-badge,
.letter-card.empty .letter-count strong,
.letter-card.penalty-empty .letter-count strong { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.letter-card.empty .btn-card-add,
.letter-card.penalty-empty .btn-card-add { background: linear-gradient(100deg,#f59e0b,#eab308); color: #1f1300; }
.letter-card.empty .btn-card-view,
.letter-card.penalty-empty .btn-card-view { background: #fff; color: #b45309; border-color: #f59e0b; }
.letter-card.filled-honor .letter-card-title,
.letter-card.filled-honor .letter-meta,
.letter-card.filled-honor .letter-meta .val,
.letter-card.filled-honor .letter-count { color: #14532d; }
.letter-card.filled-honor .letter-card-sub,
.letter-card.filled-honor .letter-meta strong { color: #15803d; }
.letter-card.filled-honor .letter-card-icon,
.letter-card.filled-honor .letter-badge,
.letter-card.filled-honor .letter-count strong { background: #dcfce7; color: #166534; border-color: #16a34a; }
.letter-card.filled-honor .btn-card-add { background: linear-gradient(135deg,#16a34a,#15803d); color: #fff; }
.letter-card.filled-honor .btn-card-view { background: #fff; color: #15803d; border-color: #16a34a; }
.letter-card.filled-penalty .letter-card-title,
.letter-card.filled-penalty .letter-meta,
.letter-card.filled-penalty .letter-meta .val,
.letter-card.filled-penalty .letter-count { color: #7f1d1d; }
.letter-card.filled-penalty .letter-card-sub,
.letter-card.filled-penalty .letter-meta strong { color: #b91c1c; }
.letter-card.filled-penalty .letter-card-icon,
.letter-card.filled-penalty .letter-badge,
.letter-card.filled-penalty .letter-count strong { background: #fee2e2; color: #991b1b; border-color: #dc2626; }
.letter-card.filled-penalty .btn-card-add { background: linear-gradient(135deg,#dc2626,#b91c1c); color: #fff; }
.letter-card.filled-penalty .btn-card-view { background: #fff; color: #b91c1c; border-color: #dc2626; }
.main-content { background: var(--theme-softer); }
.settings-card h3, .field-note, .settings-head-icon { color: var(--theme-dark); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(148px,1fr)); gap: 12px; }
.theme-swatch { border: 2px solid #e5e7eb; background: #fff; border-radius: 16px; padding: 12px; text-align: center; cursor: pointer; }
.theme-swatch.selected { border-color: var(--theme); box-shadow: 0 0 0 3px var(--theme-soft); }
.theme-chip { height: 62px; border-radius: 12px; margin-bottom: 8px; }
.theme-swatch strong { display: block; color: #134e4a; font-size: 12px; }
.theme-swatch span { color: #6b7280; font-size: 10px; }
.developer-badge:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(13,148,136,.45); border-color: #99f6e4; }
.badge-icon { color: #f59e0b; font-size: 10px; line-height: 1; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; animation: devBadgePulse 1.5s ease-in-out infinite; }
@keyframes devBadgePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.8); } }
.auth-hero { flex: 1; min-width: 0; min-height: calc(100vh - 2px); display: flex; justify-content: center; align-items: center; position: relative; overflow: hidden; color: #fff; direction: rtl; background: linear-gradient(132deg,#177b91 0%,#078d8e 48%,#08adc1 100%); }
.auth-hero:before { content: ""; position: absolute; inset: 0; opacity: .16; background: radial-gradient(ellipse at 18% 16%,#61e0cf 0 1px,transparent 2px),radial-gradient(ellipse at 78% 69%,#6cebd6 0 1px,transparent 2px); background-size: 31px 31px,43px 43px; mask-image: linear-gradient(120deg,#000,transparent 62%); }
.auth-hero-content { position: relative; z-index: 1; width: min(460px,84%); text-align: center; padding: 40px 0; }
.seal-mark { width: 130px; height: 130px; margin: 0 auto 27px; display: grid; place-items: center; border: 2px solid #d2fffa80; border-radius: 33px; background: #d0fff827; box-shadow: inset 0 0 0 1px #ffffff15; }
.seal-mark span { color: #fff; font-size: 69px; line-height: 1; text-shadow: 0 3px 10px #ffffff34; }
.auth-hero-content h2 { color: #fff; font-size: 25px; line-height: 1.35; font-weight: 800; margin: 0 0 9px; }
.auth-hero-content > p { color: #e4fffc; font-size: 12.5px; margin: 0 0 25px; }
.hero-feature { min-height: 48px; margin: 9px auto 0; width: min(320px,100%); border: 1px solid #ffffff36; border-radius: 15px; background: #ffffff17; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 15px; color: #fff; font-size: 11.5px; font-weight: 700; }
.hero-feature span { color: #fff; font-size: 20px; }
.hero-orb { position: absolute; border-radius: 50%; background: #a1fff71a; pointer-events: none; }
.orb-one { width: 143px; height: 143px; top: 7%; left: 13%; }
.orb-two { width: 66px; height: 66px; top: 34%; left: 5%; }
.orb-three { width: 99px; height: 99px; bottom: 8%; left: 29%; }
.orb-four { width: 96px; height: 96px; bottom: 24%; right: 24%; }
.setup-form { gap: 12px; }
.setup-field { display: grid; gap: 5px; text-align: right; color: #426b71; font-size: 11px; font-weight: 700; }
.setup-field input { height: 43px; border: 1px solid #dce9e7; border-radius: 9px; background: #fff; outline: none; padding: 0 12px; color: #244b51; font-family: inherit; }
.setup-field input:focus { border-color: #42d5c4; box-shadow: 0 0 0 3px #27bba719; }
.setup-form .auth-submit { min-height: 55px; font-size: 14px; margin-top: 3px; }
.rights-info-panel { padding-top: 30px; padding-bottom: 30px; }
.rights-info-content { width: 100%; max-width: 470px; text-align: center; }
.rights-info-content h1 { margin-bottom: 18px; }
.rights-info-content .welcome-pill { margin-bottom: 24px; }
.developer-details { margin: 0 0 22px; background: #fff; border: 1px solid #e4efed; border-radius: 18px; overflow: hidden; text-align: right; box-shadow: 0 9px 26px #2258570b; }
.developer-details div { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 59px; padding: 12px 20px; border-bottom: 1px solid #edf2f2; }
.developer-details div:last-child { border-bottom: 0; }
.developer-details dt { color: #77909c; font-weight: 700; font-size: 11px; }
.developer-details dd { margin: 0; color: #264b55; font-family: Arial,sans-serif; font-size: 11px; font-weight: 700; direction: ltr; text-align: left; }
.developer-details a { color: #078e88; text-decoration: none; }
.developer-details a:hover { text-decoration: underline; }
.return-login { min-height: 62px; font-size: 15px; }
.rights-footer { margin-top: 24px; color: #8ea5b4; font-size: 10px; }
.rights-hero-content { position: relative; z-index: 1; width: min(500px,80%); text-align: center; padding: 40px 0; }
.developer-logo { height: 230px; width: 100%; margin: 0 auto 32px; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; gap: 18px; border: 1px solid #12395e; border-radius: 24px; color: white; background: radial-gradient(ellipse at 22% 50%,#0e4d85 0%,transparent 37%),radial-gradient(ellipse at 84% 30%,#0c244c 0%,transparent 38%),linear-gradient(135deg,#030b1d,#061630 62%,#061022); box-shadow: 0 17px 42px #03454e40; }
.developer-logo:before { content: ""; position: absolute; inset: 0; opacity: .4; background: repeating-linear-gradient(0deg,transparent 0 29px,#1472a62b 30px),repeating-linear-gradient(90deg,transparent 0 39px,#1472a61c 40px); }
.logo-icon-mark { position: relative; z-index: 1; flex: 0 0 70px; width: 70px; height: 70px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(150deg,#1f6fd1,#0a2c57); color: #bfe3ff; font-family: Arial,sans-serif; font-style: italic; font-weight: 900; font-size: 32px; box-shadow: 0 0 20px #1f8dff4d, inset 0 0 0 1px #4fa6ff55; }
.logo-word { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; color: #fff; font-family: Arial,sans-serif; font-size: clamp(18px,1.8vw,26px); font-weight: 800; letter-spacing: 1px; white-space: nowrap; }
.logo-word small { color: #d2e8ff; font-size: 9px; letter-spacing: 3px; margin-top: 6px; }
.logo-deco { position: absolute; z-index: 1; color: #4fa6ff; opacity: .32; font-family: Arial,sans-serif; font-weight: 700; }
.deco-one { top: 18px; left: 22px; font-size: 15px; }
.deco-two { bottom: 20px; left: 30px; font-size: 20px; }
.deco-three { top: 22px; right: 24px; font-size: 14px; }
.deco-four { bottom: 18px; right: 22px; font-size: 17px; }
.rights-description { color: #dcfffc; font-size: 12.5px; line-height: 1.8; margin: 0 auto 22px; }
.rights-hero .hero-feature { width: min(400px,100%); min-height: 54px; margin-top: 10px; font-size: 11.5px; }
.rights-hero .feature-code, .rights-hero .feature-shield, .rights-hero .feature-support { color: #ff9b18; font-family: Arial,sans-serif; font-size: 21px; font-weight: 800; }

@media (max-width: 1040px) {
  .topbar { padding-inline: 18px; gap: 12px; }
  .top-brand { min-width: 190px; }
  .sidebar { width: 220px; flex-basis: 220px; }
  .auth-form-panel { min-width: 390px; }
  .developer-logo { height: 250px; }
}
@media (max-width: 800px) {
  .topbar { height: 70px; flex-basis: 70px; padding-inline: 15px; }
  .top-brand { min-width: 0; }
  .topbar-actions { margin-right: auto; }
  .topbar-actions .today-date, .topbar-actions #refresh-button { display: none; }
  .mobile-menu { display: block; color: #087d7b; }
  .workspace { min-height: calc(100vh - 70px); }
  .sidebar { position: fixed; z-index: 10; right: 0; top: 70px; bottom: 0; height: calc(100vh - 70px); min-height: 0; transform: translateX(105%); transition: transform .2s ease; width: 270px; }
  .sidebar.open { transform: translateX(0); box-shadow: -10px 0 30px #07565b30; }
  .main-content { width: 100%; }
  .content-area { padding: 18px 17px 28px; }
  .page-footer { padding-inline: 18px; }
  .auth-layout { flex-direction: column-reverse; overflow: auto; border-radius: 0; border: 0; }
  .auth-hero { flex: 0 0 auto; min-height: 330px; }
  .auth-hero-content { padding: 29px 0 34px; }
  .seal-mark { width: 82px; height: 82px; border-radius: 23px; margin-bottom: 15px; }
  .seal-mark span { font-size: 46px; }
  .auth-hero-content h2 { font-size: 21px; }
  .auth-hero-content > p { margin-bottom: 17px; font-size: 11px; }
  .hero-feature { min-height: 45px; margin-top: 8px; font-size: 10.5px; }
  .auth-form-panel { flex: 1 0 auto; min-width: 0; padding: 34px 26px 24px; }
  .auth-form-content { max-width: 480px; }
  .auth-subtitle { margin-bottom: 20px; }
  .rights-hero { min-height: 440px; }
  .rights-hero-content { width: min(500px,88%); }
  .developer-logo { height: 190px; margin-bottom: 20px; }
  .logo-icon-mark { width: 56px; height: 56px; flex-basis: 56px; font-size: 26px; border-radius: 15px; }
  .rights-description { font-size: 12px; margin-bottom: 16px; }
}
@media (max-width: 480px) {
  .topbar { gap: 7px; }
  .top-brand strong { font-size: 12px; }
  .top-brand small { font-size: 9px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .top-avatar { display: none; }
  .logout-link { padding: 7px 9px; font-size: 10px; }
  .auth-form-content h1, .rights-info-content h1 { font-size: 20px; }
  .auth-form-panel { padding-inline: 21px; }
  .auth-input { height: 54px; }
  .auth-submit { min-height: 52px; font-size: 13px; }
  .developer-details div { padding-inline: 13px; }
  .developer-details dt, .developer-details dd { font-size: 10px; }
  .developer-details dd { overflow-wrap: anywhere; }
  .developer-logo { height: 150px; border-radius: 18px; gap: 11px; }
  .logo-icon-mark { width: 44px; height: 44px; flex-basis: 44px; font-size: 20px; border-radius: 12px; }
  .logo-word { font-size: 16px; }
  .logo-word small { font-size: 7px; letter-spacing: 2px; }
}

.employee-detail { display: grid; gap: 14px; font-family: "Cairo", system-ui, sans-serif; font-size: 14px; line-height: 1.6; }
.detail-toolbar { display: flex; }
.detail-toolbar .button { font-family: inherit; font-size: 14px; font-weight: 700; }
.detail-hero, .detail-stat, .detail-card { background: #fff; border: 1px solid var(--theme-line); border-radius: 16px; box-shadow: 0 2px 10px rgba(14,116,144,.06); }
.detail-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; }
.detail-person { display: flex; align-items: center; gap: 14px; min-width: 0; }
.detail-avatar { width: 80px; height: 80px; border-radius: 16px; display: grid; place-items: center; background: var(--app-gradient); color: #fff; font-size: 30px; font-weight: 900; flex: 0 0 80px; }
.detail-hero h2 { margin: 0; color: var(--theme-dark); font-size: 24px; font-weight: 900; }
.detail-hero p { margin: 4px 0 0; color: #3f555c; font-size: 14px; font-weight: 700; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; color: #6b7280; font-size: 12px; font-weight: 400; }
.detail-meta span { background: var(--theme-softer); border: 1px solid var(--theme-line); border-radius: 999px; padding: 3px 10px; }
.detail-stats, .detail-split { display: grid; gap: 12px; }
.detail-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-split { grid-template-columns: 1fr 1fr; }
.detail-stat, .detail-card { padding: 16px 18px; }
.detail-stat span, .detail-card h3 { color: var(--theme-dark); }
.detail-stat span { font-size: 12px; font-weight: 600; }
.detail-stat strong { display: block; margin: 4px 0 2px; color: var(--theme); font-size: 16px; font-weight: 900; }
.detail-stat small, .detail-empty { color: #6b7280; font-size: 12px; font-weight: 400; }
.detail-stat.promotion { color: #fff; background: #15803d; border-color: #14532d; box-shadow: 0 7px 18px rgba(21,128,61,.23); }
.detail-stat.allowance { color: #fff; background: #ca8a04; border-color: #854d0e; box-shadow: 0 7px 18px rgba(161,98,7,.23); }
.detail-stat.promotion span, .detail-stat.promotion strong, .detail-stat.promotion small,
.detail-stat.allowance span, .detail-stat.allowance strong, .detail-stat.allowance small { color: #fff; }
.detail-card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.detail-card h3 em { font-style: normal; background: #dcfce7; color: #166534; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 900; }
.detail-card h3 em.penalty { background: #fee2e2; color: #991b1b; }
.detail-kv { display: grid; gap: 8px; }
.detail-kv div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid #e7f3f0; font-size: 12px; font-weight: 400; }
.detail-kv div:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-kv span { color: #6b7280; font-weight: 400; }
.detail-kv b { color: #1f3d45; font-weight: 700; text-align: left; }
.detail-list { display: grid; gap: 8px; }
.detail-letter { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-radius: 12px; padding: 10px 12px; }
.detail-letter.honor { background: #f0fdf4; border: 1px solid #86efac; }
.detail-letter.penalty { background: #fef2f2; border: 1px solid #fca5a5; }
.detail-letter strong { display: block; color: #14532d; font-size: 14px; font-weight: 900; }
.detail-letter.penalty strong, .detail-letter.penalty b { color: #991b1b; }
.detail-letter span, .detail-letter small { display: block; color: #3f555c; font-size: 12px; font-weight: 600; }
.detail-letter b { color: #166534; font-size: 12px; font-weight: 700; white-space: nowrap; }
.detail-status strong { display: block; margin-bottom: 6px; color: var(--theme-dark); font-size: 16px; font-weight: 900; }
.detail-status p { margin: 0; color: #3f555c; font-size: 12px; font-weight: 400; line-height: 1.7; }
.employee-detail th, .employee-detail td { font-family: inherit; font-size: 12px; font-weight: 700; }
.employee-detail th { font-weight: 900; }
.employee-record-row { cursor: pointer; transition: background .18s, box-shadow .18s; }
.employee-record-row:hover { background: var(--theme-soft) !important; box-shadow: inset -4px 0 0 var(--theme); }
.employee-record-row:focus-visible { outline: 2px solid var(--theme); outline-offset: -2px; background: var(--theme-softer); }
.detail-hero {
  color: #fff;
  background: linear-gradient(100deg, #0f766e 0%, #0d9488 55%, #2dd4bf 100%);
  border-color: #0f766e;
  box-shadow: 0 8px 22px rgba(13,148,136,.28);
}
.detail-hero h2, .detail-hero p { color: #fff; }
.detail-hero .detail-avatar {
  color: #fff; background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35); box-shadow: none;
}
.detail-hero .detail-meta { color: rgba(255,255,255,.92); }
.detail-hero .detail-meta span {
  color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3);
}
.detail-hero .detail-meta .detail-service-status {
  color: #065f46; background: #ecfdf5; border-color: #a7f3d0; font-weight: 900;
}
.detail-back-button {
  min-height: 40px; padding: 8px 15px; border: 1px solid rgba(255,255,255,.5);
  border-radius: 10px; background: rgba(255,255,255,.16); color: #fff;
  font-family: "Cairo", Tahoma, sans-serif; font-size: 12px; font-weight: 900;
}
.detail-back-button:hover { background: #fff; color: #0f766e; }
.detail-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-delete-button {
  min-height: 40px; padding: 8px 15px; border: 1px solid #fecaca; border-radius: 10px;
  background: #b91c1c; color: #fff; font-family: "Cairo", Tahoma, sans-serif;
  font-size: 12px; font-weight: 900;
}
.detail-delete-button:hover { background: #991b1b; border-color: #fff; }
.detail-hero .badge {
  color: #065f46; background: #ecfdf5; border: 1px solid rgba(255,255,255,.65); font-weight: 900;
}
.detail-hero .badge.warn { color: #92400e; background: #fef3c7; }
.detail-hero .badge.neutral { color: #334155; background: #f8fafc; }
.career-history-title { gap: 12px; flex-wrap: wrap; }
.career-history-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.career-add { min-height: 34px; padding: 6px 11px; border-radius: 9px; font-family: inherit; font-size: 10px; font-weight: 900; }
.career-add.allowance { color: #fff; background: #ca8a04; border: 1px solid #854d0e; }
.career-add.promotion { color: #fff; background: #15803d; border: 1px solid #14532d; }
.career-add.allowance:hover { background: #a16207; }
.career-add.promotion:hover { background: #166534; }
.career-history-table { min-width: 1180px; white-space: normal; }
.career-history-table th, .career-history-table td { text-align: center; vertical-align: middle; }
.career-kind { display: inline-flex; justify-content: center; min-width: 62px; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; }
.career-kind.allowance { color: #fff; background: #ca8a04; border: 1px solid #854d0e; }
.career-kind.promotion { color: #fff; background: #15803d; border: 1px solid #14532d; }
.career-kind.hire { color: #7c2d12; background: #ffedd5; }
.career-kind.current { color: #5b21b6; background: #ede9fe; }
.career-sequence { color: #0f766e; font-size: 13px !important; font-weight: 900 !important; }
.career-duration-reason { min-width: 245px; color: #5f4b16; background: #fffbeb; line-height: 1.8; }
.career-honors { display: grid; gap: 4px; min-width: 170px; }
.career-honors span { padding: 4px 7px; border-radius: 7px; background: #fef3c7; color: #92400e; font-size: 9px; font-weight: 800; }
.detail-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.detail-card-heading h3 { margin: 0; flex: 1; }
.detail-add-book { min-height: 34px; padding: 6px 11px; border-radius: 9px; color: #fff; font-size: 10px; font-weight: 900; white-space: nowrap; }
.detail-add-book.honor { background: #15803d; border: 1px solid #14532d; }
.detail-add-book.honor:hover { background: #166534; }
.detail-add-book.penalty { background: #b91c1c; border: 1px solid #7f1d1d; }
.detail-add-book.penalty:hover { background: #991b1b; }
.honor-year-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: -3px 0 10px; }
.honor-year-summary span { padding: 4px 8px; border-radius: 999px; background: #f0fdf4; border: 1px solid #86efac; color: #166534; font-size: 9px; font-weight: 800; }
.detail-letter.honor.not-counted { background: #fff7ed; border-color: #fdba74; opacity: .82; }
.detail-letter.honor.not-counted strong, .detail-letter.honor.not-counted b { color: #9a3412; }
.detail-status.is-ready { background: #f0fdf4; border-color: #86efac; }
.detail-status.is-ready strong { color: #166534; }
.detail-status.is-blocked { background: #fef2f2; border-color: #fca5a5; }
.detail-status.is-blocked strong { color: #991b1b; }
@media (max-width: 800px) {
  .detail-hero, .detail-letter, .detail-kv div { align-items: flex-start; flex-direction: column; }
  .detail-stats, .detail-split { grid-template-columns: 1fr; }
  .detail-hero-actions { width: 100%; }
  .detail-hero-actions .button { flex: 1; }
  .detail-card-heading { align-items: stretch; flex-direction: column; }
  .detail-add-book { width: 100%; }
  .reports-head, .reports-filters { display: grid; grid-template-columns: 1fr; }
}

.reports-center { display: grid; gap: 14px; }
.reports-head, .reports-filters, .reports-sheet { background: #fff; border: 1px solid var(--theme-line); border-radius: 16px; }
.reports-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; }
.reports-head h2 { margin: 0; color: var(--theme-dark); font-size: 20px; }
.reports-head p { margin: 4px 0 0; color: #6b7280; font-size: 12px; }
.reports-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.reports-filters { display: grid; grid-template-columns: 180px 180px minmax(0, 1fr); gap: 12px; padding: 14px; }
.reports-filters label { display: grid; gap: 6px; color: var(--theme-dark); font-size: 12px; font-weight: 800; }
.reports-filters input { border: 1px solid var(--theme-line); border-radius: 10px; padding: 10px 12px; color: #1f3d45; background: #fff; font: inherit; font-size: 13px; }
.reports-switch { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.report-kind { border: 1px solid var(--theme-line); background: var(--theme-softer); color: var(--theme-dark); border-radius: 12px; padding: 10px 14px; font-weight: 800; font-size: 13px; }
.report-kind.active { background: var(--app-gradient); color: #fff; border-color: transparent; }
.reports-sheet { position: relative; padding: 22px 18px 18px; min-height: 120px; }
.reports-sheet h3 { margin: 0; text-align: center; color: #374151; font-size: 22px; font-weight: 900; }
.reports-institution {
  position: absolute; top: 20px; left: 18px; max-width: 220px;
  display: grid; gap: 2px; color: #374151; text-align: center;
  font-size: 11px; font-weight: 800; line-height: 1.5;
}
.reports-institution span { display: block; }
.reports-range {
  margin: 3px 0 16px; text-align: center; color: #4b5563;
  font-weight: 700; font-size: 12px; line-height: 1.55;
}
.reports-range span { display: block; }
.official-report-table {
  direction: rtl; table-layout: fixed; border-collapse: collapse; white-space: normal;
  border: 1px solid #aab6a5; background: #fff;
}
.official-report-table th {
  padding: 8px 5px; border: 1px solid #aab6a5; background: #dce5d5;
  color: #263129; text-align: center; vertical-align: middle;
  font-size: 10px; font-weight: 900; line-height: 1.35;
}
.official-report-table td {
  padding: 8px 5px; border: 1px solid #b8c2b2; color: #28322b;
  text-align: center; vertical-align: middle; font-size: 10px; font-weight: 700;
  line-height: 1.4; overflow-wrap: anywhere;
}
.official-report-table tbody tr:nth-child(odd) { background: #e5efcd; }
.official-report-table tbody tr:nth-child(even) { background: #fff; }
.official-report-table tbody tr:hover { background: #dbe9bb; }
.official-report-table .report-date { color: #9f312f; font-weight: 900; }
.official-report-table th:nth-child(1) { width: 7%; }
.official-report-table th:nth-child(2) { width: 13%; }
.official-report-table th:nth-child(3) { width: 11%; }
.official-report-table th:nth-child(4),
.official-report-table th:nth-child(5),
.official-report-table th:nth-child(7),
.official-report-table th:nth-child(9),
.official-report-table th:nth-child(10) { width: 6%; }
.official-report-table th:nth-child(6),
.official-report-table th:nth-child(8),
.official-report-table th:nth-child(11),
.official-report-table th:nth-child(12) { width: 9%; }
.reports-empty { text-align: center; color: #6b7280; font-size: 13px; padding: 16px 8px 20px; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  html, body { width: 100%; height: auto; margin: 0; background: #fff; overflow: visible; }
  body * { visibility: hidden !important; }
  #report-sheet, #report-sheet * { visibility: visible !important; }
  #report-sheet {
    position: absolute; inset: 0; width: 100%; padding: 0; margin: 0;
    border: 0; border-radius: 0; box-shadow: none; background: #fff;
    direction: rtl; font-family: "Cairo", Tahoma, sans-serif;
  }
  #report-sheet .table-scroll { overflow: visible; }
  #report-sheet h3 { font-size: 20px; color: #333; margin: 0; }
  #report-sheet .reports-institution {
    top: 0; left: 0; max-width: 210px; color: #333;
    font-size: 10px; line-height: 1.45; text-align: center;
  }
  #report-sheet .reports-range { margin: 2px 0 12px; color: #444; font-size: 11px; }
  .official-report-table { width: 100%; page-break-inside: auto; }
  .official-report-table thead { display: table-header-group; }
  .official-report-table tr { page-break-inside: avoid; page-break-after: auto; }
  .official-report-table th { background: #dce5d5 !important; color: #1f2922 !important; font-size: 8.5px; padding: 5px 3px; }
  .official-report-table td { font-size: 8.5px; padding: 5px 3px; }
  .official-report-table tbody tr:nth-child(odd) { background: #e5efcd !important; }
  .official-report-table tbody tr:nth-child(even) { background: #fff !important; }
  .official-report-table .report-date { color: #9f312f !important; }
  #report-sheet, .official-report-table, .official-report-table * {
    -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important;
  }
}

.section-heading,
.welcome,
.scale-hero,
.reports-head,
.letter-hub-head,
.letter-hub-head.penalties,
.letter-hub-head:not(.penalties) {
  background: linear-gradient(100deg, #0f766e 0%, #0d9488 55%, #2dd4bf 100%);
  border: 1px solid #0f766e;
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(13,148,136,.28);
}
.section-heading { padding: 18px 20px; margin-bottom: 16px; }
.welcome, .scale-hero { background: linear-gradient(100deg, #0f766e 0%, #0d9488 55%, #2dd4bf 100%); }
.section-heading h2,
.section-heading p,
.welcome h2,
.welcome p,
.welcome .eyebrow,
.welcome-meta,
.scale-hero h2,
.scale-hero p,
.scale-hero .eyebrow,
.reports-head h2,
.reports-head p,
.letter-hub-head h2,
.letter-hub-head p,
.letter-hub-head.penalties h2,
.letter-hub-head.penalties p,
.letter-hub-head:not(.penalties) h2,
.letter-hub-head:not(.penalties) p { color: #fff; }

.button-danger { background: #dc2626; color: #fff; }
.button-danger:hover { background: #b91c1c; }
.check-col { width: 42px; text-align: center; }
.check-col input, .table-pager select { accent-color: var(--theme); }
.employees-card { display: flex; flex-direction: column; }
.table-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--theme-line); color: #64748b; font-size: 12px; font-weight: 700; }
.table-pager strong { color: var(--theme-dark); }
.table-pager p, .table-pager label { margin: 0; display: flex; align-items: center; gap: 6px; }
.pager-nav { display: flex; align-items: center; gap: 4px; background: var(--theme-softer); border: 1px solid var(--theme-line); border-radius: 12px; padding: 4px; }
.pager-nav button { min-width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--theme-dark); font-weight: 800; }
.pager-nav button.active { background: var(--app-gradient); color: #fff; }
.pager-nav button:disabled { opacity: .35; }
.table-pager select { border: 1px solid var(--theme-line); border-radius: 8px; background: #fff; color: var(--theme-dark); padding: 4px 8px; font: inherit; font-weight: 800; }
.import-modal { width: min(860px, 100%); }
.import-modal .modal-head h2 { margin: 0; color: var(--theme-dark); font-size: 18px; }
.import-modal .modal-head p { margin: 4px 0 0; color: #6b7280; font-size: 12px; }
.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.import-drop, .import-template { border-radius: 16px; min-height: 190px; padding: 18px; display: grid; align-content: center; justify-items: center; text-align: center; gap: 8px; }
.import-drop { position: relative; border: 2px dashed var(--theme-line); background: var(--theme-softer); color: var(--theme-dark); cursor: pointer; }
.import-drop.drag { border-color: var(--theme); background: #fff; }
.import-file { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.import-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--theme); font-size: 22px; font-weight: 800; border: 1px solid var(--theme-line); }
.import-drop small, .import-template p { color: #6b7280; font-size: 12px; margin: 0; }
.import-template { background: #f0fdfa; border: 1px solid var(--theme-line); }
.import-template h3 { margin: 0; color: var(--theme-dark); font-size: 16px; }
@media (max-width: 800px) {
  .import-grid, .table-pager { display: grid; grid-template-columns: 1fr; justify-items: center; }
}

/* إدارة المستخدمين — بأسلوب نظام براءة الذمة */
.users-page { display: grid; gap: 18px; }
.users-hero {
  position: relative; overflow: hidden; display: flex; align-items: center;
  justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 25px 28px; border-radius: 18px; color: #fff;
  background: linear-gradient(100deg, #0f766e 0%, #0d9488 55%, #2dd4bf 100%);
  box-shadow: 0 9px 28px rgba(13,148,136,.25);
}
.users-hero::before, .users-hero::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.06); pointer-events: none;
}
.users-hero::before { width: 190px; height: 190px; top: -100px; left: -45px; }
.users-hero::after { width: 230px; height: 230px; right: -80px; bottom: -150px; }
.users-hero-copy, .users-hero-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.users-hero-icon {
  width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px;
  background: rgba(255,255,255,.17); border: 1px solid rgba(255,255,255,.2); font-size: 23px;
}
.users-hero h2 { margin: 0; color: #fff; font-size: 22px; font-weight: 900; }
.users-hero p { margin: 4px 0 0; color: rgba(255,255,255,.82); font-size: 12px; font-weight: 600; }
.users-hero-actions { flex-wrap: wrap; }
.users-hero-btn {
  min-height: 42px; border: 0; border-radius: 11px; padding: 9px 17px;
  background: #fff; color: #0f766e; font-family: inherit; font-size: 12px; font-weight: 900;
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.users-hero-btn:hover { transform: translateY(-1px); }
.users-hero-btn.button-primary {
  background: var(--app-gradient); color: #fff;
  box-shadow: 0 4px 10px #167a6420;
}
.users-hero-btn.button-primary:hover {
  background: linear-gradient(135deg,#0c6478,#0f766e 50%,#0891b2);
}
.users-delete-selected { background: #dc2626; color: #fff; }

/* توحيد أزرار الأشرطة الرئيسية بحجم وخط زر إضافة مستخدم */
.section-heading .heading-actions .button,
.letter-hub-head .btn-hub-add,
.scale-hero > .button,
.reports-head-actions .button,
.users-hero-actions .users-hero-btn {
  min-height: 42px; padding: 9px 17px; border-radius: 11px;
  font-family: "Cairo", Tahoma, sans-serif;
  font-size: 12px; font-weight: 900; line-height: 1.3;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap;
}
.users-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.users-stat {
  display: flex; align-items: center; gap: 12px; min-height: 84px;
  border: 1px solid #e5eceb; border-right: 4px solid var(--user-stat);
  border-radius: 14px; padding: 14px 16px; background: #fff; color: #374151;
  text-align: right; font-family: inherit; box-shadow: 0 2px 12px rgba(15,76,72,.07);
  transition: transform .18s, box-shadow .18s;
}
.users-stat:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,76,72,.12); }
.users-stat.active { box-shadow: 0 0 0 2px var(--user-stat), 0 6px 18px rgba(15,76,72,.12); }
.users-stat-icon {
  width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px;
  border-radius: 11px; background: color-mix(in srgb, var(--user-stat) 12%, white);
  color: var(--user-stat); font-size: 19px; font-weight: 900;
}
.users-stat b { display: block; color: var(--user-stat); font-size: 22px; font-weight: 900; line-height: 1.1; }
.users-stat small { display: block; margin-top: 3px; color: #6b7280; font-size: 11px; font-weight: 700; }
.users-table-card { overflow: hidden; border: 1px solid #e3ecea; border-radius: 18px; background: #fff; box-shadow: 0 3px 16px rgba(15,76,72,.08); }
.users-table-head {
  display: grid; grid-template-columns: auto minmax(220px, 360px) auto;
  align-items: center; gap: 14px; padding: 14px 18px;
  background: linear-gradient(100deg, #0f766e 0%, #0d9488 58%, #2dd4bf 100%);
  color: #fff;
}
.users-table-head > strong { font-size: 14px; font-weight: 900; white-space: nowrap; }
.users-table-head > span { font-size: 11px; font-weight: 700; white-space: nowrap; }
.users-search { position: relative; display: flex; align-items: center; }
.users-search span { position: absolute; right: 12px; color: #0d9488; z-index: 1; font-size: 16px; }
.users-search input {
  width: 100%; height: 38px; border: 0; outline: 0; border-radius: 10px;
  padding: 0 36px 0 12px; color: #1f3d45; background: rgba(255,255,255,.96);
  font-family: inherit; font-size: 11px; font-weight: 700;
}
.users-security-note { padding: 10px 16px; background: #f0fdfa; border-bottom: 1px solid #ccfbf1; color: #315a60; font-size: 11px; }
.users-table { min-width: 1050px; }
.users-table th { padding-block: 13px; text-align: center; }
.users-table td { padding-block: 11px; text-align: center; font-size: 11px; }
.users-table tr.is-selected { background: #f0fdfa !important; }
.users-index { color: #9ca3af; font-weight: 800; }
.users-username { display: block; color: #475569; font-family: Consolas, monospace; font-size: 12px; direction: ltr; }
.users-full-name { color: #134e4a; font-size: 12px; font-weight: 900; }
.current-user-badge {
  display: inline-flex; width: fit-content; margin: 4px auto 0; padding: 2px 8px;
  border-radius: 999px; background: #ccfbf1; color: #0f766e; font-size: 9px; font-weight: 900;
}
.current-user-badge.protected { margin: 0; background: #f0fdfa; border: 1px solid #99f6e4; }
.users-role, .users-status {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 999px; padding: 4px 10px; border: 1px solid; font-size: 10px; font-weight: 900;
}
.users-role.role-admin { color: #7f1d1d; background: #fef2f2; border-color: #fecaca; }
.users-role.role-hr { color: #4338ca; background: #eef2ff; border-color: #c7d2fe; }
.users-role.role-reader { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.users-status.active { color: #065f46; background: #d1fae5; border-color: #a7f3d0; }
.users-status.stopped { color: #991b1b; background: #fee2e2; border-color: #fecaca; }
.users-email { color: #4b5563; direction: ltr; }
.users-last-login { color: #64748b; direction: ltr; white-space: nowrap; }
.users-row-actions { display: grid; gap: 5px; min-width: 112px; }
.user-action {
  height: 29px; border-radius: 8px; background: #fff; font-family: inherit;
  font-size: 10px; font-weight: 800; cursor: pointer;
}
.user-action.login { color: #047857; border: 1px solid #10b981; }
.user-action.login:hover { color: #fff; background: #10b981; }
.user-action:disabled { opacity: .42; cursor: not-allowed; transform: none !important; background: #fff !important; color: #94a3b8 !important; border-color: #cbd5e1 !important; }
.user-action.edit { color: #d97706; border: 1px solid #f59e0b; }
.user-action.edit:hover { color: #fff; background: #f59e0b; }
.user-action.delete { color: #dc2626; border: 1px solid #ef4444; }
.user-action.delete:hover { color: #fff; background: #ef4444; }
.users-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: #0d9488; }
@media (max-width: 900px) {
  .users-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .users-table-head { grid-template-columns: 1fr; }
  .impersonation-banner { padding-inline: 16px; flex-direction: column; align-items: stretch; }
  .impersonation-return { width: 100%; }
}
@media (max-width: 560px) {
  .users-stats { grid-template-columns: 1fr; }
  .users-hero { padding: 20px; }
}
