:root {
  --brand: #1f4e79;
  --brand-2: #2e75b6;
  --ok: #198754;
  --bad: #dc3545;
}
body { font-family: 'Tajawal', system-ui, sans-serif; background: #f4f6fa; }
.app-nav { background: var(--brand); }
.app-nav .navbar-brand, .app-nav .nav-link, .app-nav .navbar-text { color: #fff !important; }
.app-nav .nav-link { opacity: .8; }
.app-nav .nav-link.active, .app-nav .nav-link:hover { opacity: 1; font-weight: 700; }
.app-nav .navbar-toggler { border-color: rgba(255,255,255,.5); filter: invert(1); }
.app-main { max-width: 1400px; }
.card { border: 0; border-radius: 14px; }
.card-header { background: #fff; font-weight: 700; border-bottom: 1px solid #eef0f4; border-radius: 14px 14px 0 0 !important; }
.login-box { max-width: 400px; margin: 10vh auto; }
.stat { font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1; }
.form-control, .form-select { border-radius: 10px; }
.table-sm td, .table-sm th { vertical-align: middle; }
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; border: 1px solid rgba(0,0,0,.15); }

/* شبكة عدم التوفر */
.avail-grid td, .avail-grid th { text-align: center; padding: 4px; }
.avail-grid .slot { width: 38px; height: 30px; border-radius: 6px; border: 1px solid #ced4da; background: #e8f5e9; cursor: pointer; user-select: none; }
.avail-grid .slot.off { background: #f8d7da; border-color: #f1aeb5; }
.avail-grid .slot.off::after { content: '✕'; color: var(--bad); }
.avail-grid .day-toggle { cursor: pointer; white-space: nowrap; }

/* الجدول */
.tt-toolbar { position: sticky; top: 0; z-index: 20; background: #f4f6fa; padding: .5rem 0; }
.tt-grid { border-collapse: separate; border-spacing: 4px; width: 100%; table-layout: fixed; }
.tt-grid th { background: var(--brand); color: #fff; text-align: center; border-radius: 8px; padding: 6px 4px; font-weight: 600; font-size: .9rem; }
.tt-grid th small { display: block; font-weight: 400; opacity: .8; font-size: .72rem; }
.tt-grid th.day { width: 90px; }
.tt-cell { height: 64px; border-radius: 10px; background: #fff; border: 2px dashed #dee2e6; text-align: center; vertical-align: middle; padding: 2px; position: relative; font-size: .88rem; line-height: 1.25; }
.tt-cell.na { background: repeating-linear-gradient(45deg,#f1f3f5,#f1f3f5 6px,#e9ecef 6px,#e9ecef 12px); border-style: solid; border-color: transparent; }
.tt-cell.filled { border-style: solid; border-color: rgba(0,0,0,.08); cursor: grab; }
.tt-cell .subj { font-weight: 700; }
.tt-cell .who { font-size: .76rem; opacity: .8; }
.tt-cell .lock { position: absolute; top: 2px; left: 4px; font-size: .75rem; cursor: pointer; opacity: .35; }
.tt-cell .lock.on { opacity: 1; color: var(--brand); }
.tt-cell.hard { box-shadow: 0 0 0 3px var(--bad) inset; }
.tt-cell.soft { box-shadow: 0 0 0 3px #fd7e14 inset; }
.tt-cell.flash { animation: flash 1.2s ease 2; }
.tt-cell.drop-ok { outline: 3px solid var(--ok); outline-offset: -3px; }
.tt-cell.drop-bad { outline: 3px solid var(--bad); outline-offset: -3px; opacity: .6; }
.tt-cell.dragging { opacity: .35; }
.tt-cell.dbl-start { border-top-left-radius: 2px; border-bottom-left-radius: 2px; }
.tt-cell.dbl-end { border-top-right-radius: 2px; border-bottom-right-radius: 2px; }
@keyframes flash { 50% { transform: scale(1.06); box-shadow: 0 0 0 4px #ffc107 inset; } }
.tt-full { font-size: .74rem; border-collapse: collapse; }
.tt-full th, .tt-full td { border: 1px solid #dee2e6; padding: 3px; text-align: center; white-space: nowrap; }
.tt-full thead th { background: var(--brand); color: #fff; }
.issue { cursor: pointer; border-radius: 8px; padding: 6px 10px; margin-bottom: 4px; font-size: .9rem; }
.issue:hover { background: #fff3cd; }
.status-pill { font-size: 1.05rem; font-weight: 700; border-radius: 50px; padding: 6px 16px; display: inline-block; }
.print-only { display: none; }

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  .no-print, .app-nav { display: none !important; }
  .print-only { display: block; }
  .app-main { max-width: none; padding: 0 !important; }
  .print-page { page-break-after: always; }
  .print-page:last-child { page-break-after: auto; }
  .tt-cell { border: 1px solid #adb5bd !important; box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tt-grid th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tt-cell .lock { display: none; }
}
