:root { --red:#C8102E; --orange:#F0A040; --yellow:#FFF7DB; --line:#D9DEE5; --bg:#F4F2EE; }
body { font-family: "Cairo", system-ui, sans-serif; background: var(--bg); color: #1A1D24; }
.app-nav { background: rgba(244,242,238,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.app-nav .nav-link { font-weight: 600; border-radius: .5rem; padding: .45rem .8rem !important; transition: background-color .2s; }
.app-nav .nav-link.active { background: var(--red); color: #fff !important; }
.btn-srca { background: var(--red); color: #fff; font-weight: 700; }
.btn-srca:hover { background: #A00D25; color: #fff; }
.card { border-color: var(--line); border-radius: .9rem; }
.th-orange, .table thead.orange th { background: var(--orange) !important; color: #1E1B18; font-weight: 700; }
.form-control, .form-select { background-color: var(--yellow); border-color: #E8D9A8; }
.form-control:focus, .form-select:focus { border-color: var(--orange); box-shadow: 0 0 0 .2rem rgba(240,160,64,.25); background-color: var(--yellow); }
.form-tabs .nav-link { font-weight: 700; color: #475569; border-radius: .6rem; border: 1px solid var(--line); background: #fff; margin: 0 .2rem .4rem; white-space: nowrap; }
.form-tabs .nav-link.active { background: #1A1D24; color: #fff; }
.form-tabs { flex-wrap: nowrap; overflow-x: auto; }
.sec-title { font-weight: 800; border-inline-start: 5px solid var(--red); padding-inline-start: .6rem; margin-bottom: 1rem; }
.check-row { display: flex; align-items: center; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border: 0; }
.check-row .name { flex: 1; font-weight: 600; font-size: .92rem; }
.check-row .note { width: 130px; }
.btn-check + .btn-ok, .btn-check + .btn-no { width: 36px; height: 34px; padding: 0; border: 1px solid #cbd5e1; background: #fff; color: #cbd5e1; font-weight: 800; }
.btn-check:checked + .btn-ok { background: #059669; border-color: #059669; color: #fff; }
.btn-check:checked + .btn-no { background: var(--red); border-color: var(--red); color: #fff; }
.login-hero { background: #0F1A33 url('../images/ambulance.webp') center 62%/cover; position: relative; }
.login-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,26,51,.9), rgba(15,26,51,.35) 55%, transparent); }
.login-hero > * { position: relative; }
.kpi { font-size: 2.3rem; font-weight: 800; }
.sheet-wrap { overflow-x: auto; }
.sheet-html { width: 210mm; height: 297mm; overflow: hidden; position: relative; box-sizing: border-box; background: #fff; margin: 0 auto; padding: 5.3mm 9.3mm 0 9.8mm; box-shadow: 0 10px 40px -10px rgba(0,0,0,.25); }
@media (max-width: 576px) { .check-row .note { width: 90px; } }
@media print {
    @page { size: A4; margin: 0; }
    .photo-break { page-break-before: always; margin-top: 0 !important; }
    .no-print { display: none !important; }
    body { background: #fff; }
    .sheet-html { box-shadow: none; margin: 0; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* ---- Autocomplete (combo) ---- */
.combo-wrap { position: relative; }
.combo-inp { padding-inline-end: 34px !important; scroll-margin-top: 96px; }
.combo-clear { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 999px; border: 0; background: transparent; color: #9AA3AF; display: flex; align-items: center; justify-content: center; z-index: 2; padding: 0; transition: background-color .15s, color .15s; }
.combo-clear:hover { background: #F1F3F6; color: #C8102E; }
.combo-pop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; background: #fff; border: 1px solid #DCDFE4; border-radius: 10px; box-shadow: 0 10px 24px -10px rgba(26,29,36,.22); overflow: hidden; animation: comboIn .12s ease-out; font-size: 14px; text-align: start; }
@keyframes comboIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.combo-scroll { max-height: 240px; overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.combo-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; min-height: 42px; border-radius: 6px; cursor: pointer; transition: background-color .12s; }
.combo-opt.is-active { background: #FBEFF1; }
.combo-opt.is-active .combo-val { color: #C8102E; }
.combo-val { font-weight: 600; color: #1A1D24; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-hint { font-size: 12px; color: #6B7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-mark { background: transparent; color: #C8102E; font-weight: 800; padding: 0; }
.combo-new { padding: 7px 12px; color: #047857; font-size: 12px; border-bottom: 1px solid #EEF0F3; background: #F6FBF8; }
.combo-empty { padding: 12px; text-align: center; color: #9AA3AF; font-size: 13px; }
@media (pointer: coarse) { .combo-opt { min-height: 46px; } }
.autofilled { animation: autofill 1.6s ease-out; }
@keyframes autofill { 0% { box-shadow: 0 0 0 3px rgba(4,120,87,.45); background: #ECFDF5; } 100% { box-shadow: none; } }
.para-wrap { overflow: visible; }
@media (max-width: 767px) {
  .para-table { min-width: 0 !important; }
  .para-table thead { display: none; }
  .para-table, .para-table tbody, .para-table tr, .para-table td { display: block; width: 100% !important; }
  .para-table tr { border: 1px solid #E5E7EB; border-radius: 10px; padding: 8px; margin-bottom: 10px; background: #fff; }
  .para-table td { padding: 4px 2px !important; border: 0 !important; }
  .para-table td[data-label]:not(:first-child) { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .para-table td[data-label]:not(:first-child)::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: #6B7280; }
  .para-table td[data-label]:not(:first-child) > * { max-width: 60%; }
}

.tri-btn { width: 34px; height: 34px; border-radius: 7px; border: 2px solid #CBD2DA; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 17px; line-height: 1; transition: background-color .15s, border-color .15s; padding: 0; }
.tri-btn[data-v="1"] { background: #059669; border-color: #059669; color: #fff; }
.tri-btn[data-v="1"]::after { content: "✓"; }
.tri-btn[data-v="0"] { background: #C8102E; border-color: #C8102E; color: #fff; }
.tri-btn[data-v="0"]::after { content: "✗"; }

/* ---------- Navigation v2 ---------- */
.app-nav { background: var(--red) !important; backdrop-filter: none; border-bottom: 0; color: #fff; box-shadow: 0 8px 24px -14px rgba(160,13,37,.9); z-index: 1030; }
.app-nav .nav-bar { height: 64px; }
.app-nav .brand-emblem { background: #fff; border-radius: 50%; padding: 2px; display: inline-flex; }
.app-nav .brand-title { font-size: 15px; }
.app-nav .nav-accent { height: 3px; background: var(--orange); }
.nav-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border-radius: 999px; font-weight: 700; font-size: .875rem; color: rgba(255,255,255,.92); background: transparent; border: 0; text-decoration: none; white-space: nowrap; transition: background-color .2s, color .2s; }
.nav-pill:hover { background: rgba(255,255,255,.15); color: #fff; }
.nav-pill.on { background: #fff; color: var(--red); }
.nav-pill.soft { background: rgba(255,255,255,.1); }
.nav-icon-btn { background: transparent; border: 0; color: #fff; width: 40px; height: 40px; border-radius: 50%; }
.nav-icon-btn:hover { background: rgba(255,255,255,.15); }
.nav-user { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .7rem .25rem .25rem; border-radius: 999px; border: 0; background: rgba(255,255,255,.1); color: #fff; }
[dir=rtl] .nav-user { padding: .25rem .25rem .25rem .7rem; }
.nav-user:hover { background: rgba(255,255,255,.2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--red); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.avatar.lg { width: 44px; height: 44px; }
.nav-menu { border: 1px solid var(--line); border-radius: .9rem; padding: .4rem; min-width: 15rem; margin-top: .5rem !important; animation: menuPop .16s ease-out both; }
.nav-menu .dropdown-item { border-radius: .55rem; padding: .6rem .75rem; font-weight: 600; font-size: .9rem; display: flex; gap: .6rem; align-items: center; color: #334155; }
.nav-menu .dropdown-item:hover { background: #F8FAFC; }
.nav-menu .dropdown-item.active, .nav-menu .dropdown-item:active { background: rgba(200,16,46,.1); color: var(--red); }
@keyframes menuPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nav-drawer { width: min(86vw, 330px) !important; }
.nav-drawer .drawer-head { background: var(--red); color: #fff; padding: 1rem; }
.drawer-group { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .65rem .75rem; border: 0; background: transparent; border-radius: .55rem; font-weight: 800; font-size: .9rem; color: #1e293b; }
.drawer-group > i:first-child { color: var(--red); }
.drawer-group:hover { background: #F8FAFC; }
.drawer-group .chev { transition: transform .2s; }
.drawer-group:not(.collapsed) .chev { transform: rotate(180deg); }
.drawer-sub { margin-inline-start: 1.25rem; padding-inline-start: .75rem; border-inline-start: 2px solid #F3D6DB; }
.drawer-link { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: .55rem; font-weight: 600; font-size: .9rem; color: #334155; text-decoration: none; }
.drawer-link:hover { background: #F8FAFC; color: #0f172a; }
.drawer-link.active { background: rgba(200,16,46,.1); color: var(--red); }
.page-head { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1.5rem; }
.page-head > i { color: var(--red); font-size: 1.4rem; margin-top: .2rem; }
.page-title { font-size: 1.6rem; font-weight: 800; margin: 0; }
.page-sub { color: var(--muted, #5B6472); font-size: .875rem; margin: .25rem 0 0; }
.soon-card { position: relative; overflow: hidden; transition: transform .3s, box-shadow .3s; }
.soon-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -14px rgba(0,0,0,.25); }
.soon-card .ic { width: 44px; height: 44px; border-radius: .75rem; background: rgba(200,16,46,.1); color: var(--red); display: grid; place-items: center; font-size: 1.3rem; }
.soon-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: 11px; font-weight: 700; padding: .25rem .65rem; border-radius: 999px; background: #FFF2DE; color: #B4610B; }
.soon-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.card { box-shadow: 0 1px 2px rgba(16,24,40,.04); }
@media (max-width: 575.98px) { .app-main { padding-top: 1rem !important; } .form-control, .form-select { font-size: 16px; } .page-title { font-size: 1.35rem; } }

.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px var(--red); display: inline-block; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #1E1B18; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.cl-stat { background: #F8FAFC; border: 1px solid var(--line); border-radius: .6rem; padding: .5rem .75rem; }

.vh-month-head { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; cursor: pointer; list-style: none; user-select: none; transition: background-color .2s; }
.vh-month-head::-webkit-details-marker { display: none; }
.vh-month-head:hover { background: #F8FAFC; }
.vh-month[open] > .vh-month-head { background: #FFF6EA; }
.vh-month-ic { width: 40px; height: 40px; border-radius: .75rem; background: rgba(200,16,46,.1); color: var(--red); display: grid; place-items: center; flex-shrink: 0; }
.vh-month-hours { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .8rem; font-weight: 800; font-size: .875rem; white-space: nowrap; }
.vh-chev { color: #94a3b8; transition: transform .2s; }
.vh-month[open] .vh-chev { transform: rotate(180deg); }
.shift-morn { background: #FFFBEB; color: #B45309; }
.shift-eve { background: #EEF2FF; color: #4338CA; }

.vh-sec { border: 1px solid var(--line); border-radius: .8rem; padding: 1rem; margin-bottom: 1rem; background: rgba(255,255,255,.6); }
.vh-sec-t { font-size: 13px; font-weight: 800; color: #475569; margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.vh-sec-t i { width: 28px; height: 28px; border-radius: .5rem; background: rgba(200,16,46,.1); color: var(--red); display: inline-grid; place-items: center; }
.vh-recent { border: 1px solid var(--line); border-radius: .8rem; background: #F8FAFC; padding: .75rem; position: sticky; top: 90px; }
.vh-recent-item { background: #fff; border: 1px solid var(--line); border-radius: .6rem; padding: .55rem .65rem; margin-bottom: .5rem; }
.vh-recent-item.new { border-color: #6EE7B7; animation: menuPop .3s ease-out both; }
.vh-stat-ic { width: 44px; height: 44px; border-radius: .75rem; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.vh-stat-ic.red { background: rgba(200,16,46,.1); color: var(--red); } .vh-stat-ic.amber { background: #FFFBEB; color: #B45309; }
.vh-stat-ic.indigo { background: #EEF2FF; color: #4338CA; } .vh-stat-ic.green { background: #ECFDF5; color: #047857; }
