:root {
  --icc-navy: #073b4c;
  --icc-navy-2: #0b4f63;
  --icc-teal: #0e7c7b;
  --icc-teal-2: #14919b;
  --icc-gold: #c9a227;
  --icc-bg: #f3f6f8;
  --icc-sidebar: 270px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body.app-body {
  font-family: "Cairo", "Noto Kufi Arabic", Tahoma, sans-serif;
  background: var(--icc-bg);
  color: #1d2a32;
  min-height: 100vh;
}

a { text-decoration: none; }

.app-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: var(--icc-sidebar);
  background: linear-gradient(180deg, var(--icc-navy) 0%, #052833 100%);
  color: #fff;
  overflow-y: auto;
  z-index: 1040;
  box-shadow: -4px 0 18px rgba(0,0,0,.12);
}

.app-sidebar .brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.app-sidebar .brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 3px;
}

.app-sidebar .brand h1 {
  font-size: .95rem;
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
}

.app-sidebar .brand small {
  display: block;
  opacity: .7;
  font-size: .72rem;
  font-weight: 400;
}

.side-nav {
  padding: .75rem 0 2rem;
}

.side-nav a,
.side-nav .nav-toggle {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: rgba(255,255,255,.82);
  padding: .52rem 1.1rem;
  font-size: .9rem;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: right;
}

.side-nav a:hover,
.side-nav .nav-toggle:hover,
.side-nav a.active,
.side-nav .nav-group.open > .nav-toggle {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.side-nav a.active {
  border-right: 3px solid var(--icc-gold);
  background: rgba(14,124,123,.35);
}

.side-nav .nav-group {
  margin: .15rem 0;
}

.side-nav .nav-toggle {
  cursor: pointer;
  font-weight: 600;
}

.side-nav .nav-toggle .caret {
  margin-right: auto;
  font-size: .75rem;
  opacity: .7;
  transition: transform .2s ease;
}

.side-nav .nav-group.open > .nav-toggle .caret {
  transform: rotate(180deg);
}

.side-nav .sub {
  display: none;
  background: rgba(0,0,0,.18);
  padding: .2rem 0 .35rem;
}

.side-nav .nav-group.open > .sub {
  display: block;
}

.side-nav .sub a {
  padding: .4rem 2.15rem .4rem 1.1rem;
  font-size: .86rem;
  font-weight: 400;
}

.app-main {
  margin-right: var(--icc-sidebar);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  background: #fff;
  border-bottom: 1px solid #e6ecef;
  padding: .7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.app-topbar .page-heading {
  font-weight: 700;
  margin: 0;
  font-size: 1.05rem;
}

.app-content {
  padding: 1.25rem;
  flex: 1;
}

.stat-card {
  border: 0;
  border-radius: 14px;
  color: #fff;
  overflow: hidden;
  min-height: 118px;
}

.stat-card h6 { opacity: .85; font-size: .82rem; }
.stat-card .num { font-size: 1.55rem; font-weight: 700; }

.bg-icc-1 { background: linear-gradient(135deg, #0e7c7b, #14919b); }
.bg-icc-2 { background: linear-gradient(135deg, #c0392b, #e67e22); }
.bg-icc-3 { background: linear-gradient(135deg, #c9a227, #e0b93b); color: #2b2208; }
.bg-icc-4 { background: linear-gradient(135deg, #073b4c, #0b4f63); }

.card {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(7,59,76,.06);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #eef2f4;
  font-weight: 700;
}

.btn-primary {
  --bs-btn-bg: var(--icc-teal);
  --bs-btn-border-color: var(--icc-teal);
  --bs-btn-hover-bg: #0b6867;
  --bs-btn-hover-border-color: #0b6867;
}

.btn-icc-gold {
  background: var(--icc-gold);
  border-color: var(--icc-gold);
  color: #2b2208;
}

.table thead th {
  font-size: .82rem;
  color: #5b6b73;
  white-space: nowrap;
}

.badge-status { font-weight: 600; }

.login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, #073b4c 0%, #0e7c7b 55%, #c9a227 160%);
  --bs-body-font-family: "Cairo", Tahoma, sans-serif;
  font-family: "Cairo", Tahoma, sans-serif;
}

.login-wrap h1,
.login-wrap h2,
.login-wrap h3,
.login-wrap p,
.login-wrap label,
.login-wrap .btn,
.login-wrap .form-control,
.login-wrap .form-label,
.login-wrap .alert {
  font-family: "Cairo", Tahoma, sans-serif;
}

.login-card {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #334;
}

.user-chip-btn {
  background: transparent;
  border: 0;
  padding: .2rem .45rem .2rem .2rem;
  border-radius: 999px;
}
.user-chip-btn:hover,
.user-chip-btn:focus,
.user-chip-btn.show {
  background: #eef4f4;
}
.user-chip-btn::after {
  margin-right: .15rem;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #d5e4e4;
  background: #eef4f4;
  flex-shrink: 0;
}
.user-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0e7c7b;
  color: #fff;
  font-size: 1.2rem;
  border-color: #0e7c7b;
}
.user-avatar-lg {
  width: 96px;
  height: 96px;
  font-size: 2.4rem;
}
.user-menu-drop {
  min-width: 200px;
  border: 0;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
  border-radius: 12px;
  padding: .4rem;
}
.user-menu-drop .dropdown-item {
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.user-menu-drop .dropdown-item i {
  opacity: .8;
}

.sidebar-toggle { display: none; }

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(110%);
    transition: transform .2s ease;
  }
  .app-sidebar.show { transform: none; }
  .app-main { margin-right: 0; }
  .sidebar-toggle { display: inline-flex; }
}

.sticky-summary {
  position: sticky;
  top: 5.2rem;
}

.student-mode-bar .btn {
  min-width: 10rem;
}

.student-new-box {
  background: #f7fbfb;
  border: 1px dashed #b7d4d4;
  border-radius: 12px;
  padding: 1rem;
}

.fee-box {
  background: #f4f8f8;
  border: 1px solid #dce8e8;
  border-radius: 12px;
  padding: .9rem 1rem;
  text-align: center;
  height: 100%;
}

.fee-box-total {
  background: linear-gradient(135deg, #073b4c, #0e7c7b);
  border: 0;
  color: #fff;
}

.fee-label {
  font-size: .8rem;
  opacity: .8;
  margin-bottom: .2rem;
}

.fee-value {
  font-size: 1.35rem;
  font-weight: 700;
}

.fee-hint {
  font-size: .72rem;
  opacity: .7;
  margin-top: .15rem;
}

.inst-box {
  background: #f7fbfb;
  border: 1px dashed #b7d4d4;
  border-radius: 12px;
}

.settings-hero {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.25rem 1.4rem;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #073b4c 0%, #0e7c7b 70%, #c9a227 160%);
  box-shadow: 0 12px 30px rgba(7,59,76,.18);
}
.settings-hero img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #fff;
  border-radius: 16px;
  padding: 6px;
}
.settings-hero-kicker {
  display: inline-block;
  background: rgba(255,255,255,.16);
  border-radius: 999px;
  padding: .12rem .7rem;
  font-size: .72rem;
  letter-spacing: .04em;
  margin-bottom: .25rem;
}
.settings-hero h2 {
  font-size: 1.35rem;
  margin: 0;
  font-weight: 800;
}
.settings-hero p {
  opacity: .85;
  font-size: .92rem;
}
.settings-card {
  background: #fff;
  border-radius: 18px;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: 0 8px 24px rgba(7,59,76,.06);
}
.settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1.1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid #eef3f4;
}
.settings-card-head h5 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.settings-card-head small {
  color: #6b7c83;
}
.settings-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f5f4;
  color: #0e7c7b;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.settings-hint {
  background: #f4faf9;
  border-radius: 10px;
  padding: .55rem .75rem;
  font-size: .82rem;
  color: #4a5d63;
}
.settings-hint code {
  color: #0e7c7b;
  font-weight: 700;
}
.settings-actions {
  margin-top: 1.5rem;
  padding-top: .25rem;
}
.settings-page .form-control,
.settings-page .input-group-text {
  border-radius: 10px;
  border-color: #d7e3e4;
}
.settings-page .input-group-text {
  background: #f7fbfb;
  color: #0e7c7b;
}
.settings-page .form-control:focus {
  border-color: #0e7c7b;
  box-shadow: 0 0 0 .2rem rgba(14,124,123,.12);
}

.perm-module {
  background: #f7fbfb;
  border: 1px solid #dce8e8;
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-bottom: .75rem;
}
.perm-item { margin-bottom: .35rem; }
.role-preview {
  background: #f7fbfb;
  border: 1px dashed #b7d4d4;
  border-radius: 12px;
  padding: .75rem 1rem;
  max-height: 220px;
  overflow: auto;
}

.form-step-num {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--icc-navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.day-picker-lg .day-chip span {
  padding: .5rem 1rem;
  min-width: 4.6rem;
  text-align: center;
}

.schedule-preview {
  background: #f7fbfb;
  border: 1px dashed #b7d4d4;
  border-radius: 12px;
  padding: .75rem 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  padding: .28rem 0;
  font-size: .9rem;
}
.summary-row strong {
  text-align: left;
  max-width: 62%;
}

.announcement-mini {
  background: #f4f8f8;
  border-radius: 10px;
  padding: .7rem .8rem;
  font-size: .8rem;
  line-height: 1.55;
  color: #3d5a61;
}
.photo-capture .photo-frame {
  width: 140px;
  height: 140px;
  border-radius: 14px;
  overflow: hidden;
  background: #eef4f5;
  border: 1px dashed #b7d4d4;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-placeholder {
  color: #7a99a0;
  font-size: 2.4rem;
}
.photo-preview, .photo-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.id-card-sheet {
  display: flex;
  flex-wrap: wrap;
  gap: 8mm;
  justify-content: flex-start;
}
.id-card {
  width: 86mm;
  height: 54mm;
  background: #fff;
  border: 0.35mm solid #0e7c7b;
  border-radius: 3.2mm;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 24px rgba(7, 59, 76, .14);
  page-break-inside: avoid;
  break-inside: avoid;
}
.id-card-head {
  background: linear-gradient(90deg, #073b4c 0%, #0e7c7b 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 2mm;
  padding: 1.5mm 2.4mm;
}
.id-card-head img {
  width: 8.2mm;
  height: 8.2mm;
  object-fit: contain;
  background: #fff;
  border-radius: 1.6mm;
  padding: .4mm;
}
.id-card-org {
  font-size: 8pt;
  font-weight: 700;
  line-height: 1.2;
}
.id-card-org-en {
  font-size: 5.6pt;
  opacity: .85;
  letter-spacing: .2px;
}
.id-card-badge {
  margin-inline-start: auto;
  background: #c9a227;
  color: #073b4c;
  font-size: 6.5pt;
  font-weight: 700;
  padding: .6mm 1.8mm;
  border-radius: 8mm;
  white-space: nowrap;
}
.id-card-gold {
  height: .9mm;
  background: linear-gradient(90deg, #8c7012, #e4c56a, #8c7012);
}
.id-card-body {
  display: flex;
  gap: 2.4mm;
  padding: 2mm 2.4mm 1mm;
  flex: 1;
  min-height: 0;
}
.id-card-photo {
  width: 18mm;
  height: 22mm;
  object-fit: cover;
  border-radius: 1.8mm;
  border: .35mm solid #c9a227;
  background: #eef3f4;
  flex-shrink: 0;
}
.id-card-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8aa3a8;
  font-size: 8mm;
}
.id-card-info {
  min-width: 0;
  flex: 1;
}
.id-card-name {
  font-size: 9.2pt;
  font-weight: 800;
  color: #073b4c;
  line-height: 1.25;
}
.id-card-name-en {
  font-size: 6.4pt;
  color: #4d6a72;
  direction: ltr;
  text-align: left;
  margin-bottom: .6mm;
}
.id-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 2mm;
  font-size: 6.1pt;
  line-height: 1.35;
}
.id-card-meta span { color: #6b8389; }
.id-card-course {
  font-size: 6.4pt;
  font-weight: 700;
  color: #0e7c7b;
  margin-top: .5mm;
}
.id-card-sub {
  font-size: 5.6pt;
  color: #5d757c;
}
.id-card-qr {
  width: 18mm;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: .4mm;
}
.id-qrcode {
  width: 16mm;
  height: 16mm;
  display: block;
}
.id-card-code {
  font-size: 5.4pt;
  letter-spacing: .4px;
  color: #073b4c;
  font-weight: 700;
  direction: ltr;
  text-align: center;
  line-height: 1.1;
}

@media print {
  .app-sidebar, .app-topbar, .no-print { display: none !important; }
  .app-main { margin: 0; }
  .print-only { display: block; }
  .app-content { padding: 0 !important; }
  .id-card-sheet { gap: 5mm; }
  .id-card { box-shadow: none; }
}

.day-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.day-chip {
  margin: 0;
  cursor: pointer;
}
.day-chip input { display: none; }
.day-chip span {
  display: inline-block;
  padding: .35rem .85rem;
  border: 1px solid #c5d6d6;
  border-radius: 999px;
  background: #fff;
  color: #3d5a61;
  font-size: .9rem;
}
.day-chip input:checked + span {
  background: #0e7c7b;
  border-color: #0e7c7b;
  color: #fff;
  font-weight: 700;
}
.lecture-mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.lecture-mini {
  display: flex;
  flex-direction: column;
  min-width: 7.2rem;
  padding: .45rem .7rem;
  border: 1px solid #d5e4e4;
  border-radius: 10px;
  background: #fff;
  color: #1d2a32;
  text-decoration: none;
  line-height: 1.25;
}
.lecture-mini:hover { border-color: #0e7c7b; }
.lecture-mini strong { font-weight: 800; }
.lecture-mini span { font-size: .75rem; opacity: .85; }

.att-search { max-width: 240px; }
.att-stats { display: flex; flex-wrap: wrap; gap: .45rem; }
.att-stat {
  background: #f4f8f8;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .25rem .8rem;
  font-size: .85rem;
  color: #3d5a61;
}
.att-stat.present { background: #e8f6ee; color: #146c43; }
.att-stat.absent { background: #fdecea; color: #b02a37; }
.att-stat.late { background: #fff4e5; color: #9a6700; }
.att-stat.excused { background: #e7f1ff; color: #0a58ca; }
.att-stat.none { background: #eef1f2; color: #5b6b73; }
.att-stat.active { box-shadow: 0 0 0 2px #0e7c7b; }
.att-list { display: flex; flex-direction: column; gap: .4rem; padding-bottom: 5.5rem; }
.att-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: #fff;
  border: 1px solid #dce8e8;
  border-right: 5px solid #c5d0d2;
  border-radius: 12px;
  padding: .45rem .7rem;
  cursor: pointer;
}
.att-row.is-present { border-right-color: #198754; background: #f7fdf9; }
.att-row.is-absent { border-right-color: #dc3545; background: #fff8f8; }
.att-row.is-late { border-right-color: #fd7e14; background: #fffaf4; }
.att-row.is-excused { border-right-color: #0d6efd; background: #f6f9ff; }
.att-row.is-focus { box-shadow: 0 0 0 2px rgba(14,124,123,.35); }
.att-row.is-saving { opacity: .7; }
.att-row.is-saved .att-tick { opacity: 1; color: #198754; }
.att-idx {
  width: 1.6rem;
  text-align: center;
  font-weight: 800;
  color: #8aa3a8;
  flex-shrink: 0;
}
.att-photo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.att-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef4f5;
  color: #8aa3a8;
  font-size: 1.1rem;
}
.att-who { min-width: 8rem; flex: 1; }
.att-name { font-weight: 700; line-height: 1.25; }
.att-no { font-size: .76rem; color: #6b8389; }
.att-pills { display: flex; flex-wrap: wrap; gap: .3rem; }
.att-pill {
  border: 1px solid #d5e0e0;
  background: #fff;
  border-radius: 8px;
  padding: .32rem .62rem;
  font-size: .8rem;
  color: #4d6a72;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.att-pill.active.att-present { background: #198754; border-color: #198754; color: #fff; }
.att-pill.active.att-absent { background: #dc3545; border-color: #dc3545; color: #fff; }
.att-pill.active.att-late { background: #fd7e14; border-color: #fd7e14; color: #fff; }
.att-pill.active.att-excused { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.att-tick { opacity: 0; color: #8aa3a8; transition: opacity .2s; }
.att-toast { color: #0e7c7b; font-weight: 700; margin-right: .5rem; }
.att-savebar {
  position: sticky;
  bottom: .75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border: 1px solid #dce8e8;
  border-radius: 14px;
  padding: .7rem 1rem;
  box-shadow: 0 10px 24px rgba(7,59,76,.12);
  z-index: 5;
}
@media (max-width: 768px) {
  .att-search { max-width: none; width: 100%; }
  .att-row { flex-wrap: wrap; }
  .att-pills { width: 100%; }
  .att-pill { flex: 1; justify-content: center; }
  .att-tick { display: none; }
}

.report-hub-card {
  display: block;
  height: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem 1.3rem 1.15rem;
  box-shadow: 0 8px 24px rgba(7,59,76,.06);
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.report-hub-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(7,59,76,.12);
  color: inherit;
}
.report-hub-card .icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  margin-bottom: .85rem;
}
.report-hub-card h5 {
  font-weight: 800;
  color: #073b4c;
  margin-bottom: .35rem;
}
.report-hub-card p {
  color: #5d757c;
  font-size: .9rem;
  margin-bottom: .85rem;
  min-height: 3.2em;
}
.report-hub-card span {
  color: #0e7c7b;
  font-weight: 700;
  font-size: .88rem;
}
