/* IcaruZen Task Sheet — a production docket for a social team.
   Palette reads the brand name literally: Icarus = sun amber, Zen = deep still green. */

:root {
  /* Brand navy, taken from the company mark */
  --navy:      #1B2A6B;
  --navy-2:    #2E4CA6;
  --navy-soft: #E7ECF9;

  --ink:      #1B2A6B;   /* primary surfaces (sidebar, primary buttons) */
  --ink-2:    #24347A;
  --ink-3:    #33489C;
  --paper:    #EEF1F7;
  --card:     #FFFFFF;
  --rule:     #D9DFEC;
  --rule-2:   #EDF0F7;
  --mute:     #66708A;
  --text:     #1A2233;

  /* functional status colours */
  --zen:      #1C7C5B;
  --zen-soft: #E3F2EC;
  --sun:      #D98A1F;
  --sun-soft: #FBEFD8;
  --alert:    #C4453B;
  --alert-soft: #FAE7E5;
  --sky:      #2E4CA6;
  --sky-soft: #E7ECF9;

  --r-sm: 4px;
  --r:    8px;
  --r-lg: 14px;

  --shadow:    0 1px 2px rgba(27,42,107,.06), 0 4px 16px rgba(27,42,107,.06);
  --shadow-lg: 0 8px 40px rgba(20,30,80,.18);

  --display: 'Zain', 'Tajawal', system-ui, sans-serif;
  --body:    'IBM Plex Sans Arabic', 'Segoe UI', system-ui, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;

  --nav-w: 240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.2; margin: 0; letter-spacing: 0; }
a { color: var(--navy-2); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; border-radius: var(--r-sm); }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* ------------------------------------------------------------ boot */
.app-boot { min-height: 100dvh; display: grid; place-items: center; }
.boot { text-align: center; color: var(--mute); }
.boot-mark {
  width: 52px; height: 52px; display: block; margin: 0 auto 14px;
  background: url('logo.svg') center/contain no-repeat;
  animation: rise 1.5s ease-in-out infinite;
}
@keyframes rise {
  0%, 100% { transform: translateY(3px) scale(.94); opacity: .55; }
  50%      { transform: translateY(-3px) scale(1); opacity: 1; }
}

/* brand mark — the company logo, used in sidebar / login / drawer */
.brand-logo {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: url('logo.svg') center/contain no-repeat;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14);
}
.brand-logo.lg { width: 44px; height: 44px; }
.mark-sun { /* legacy fallback */
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: url('logo.svg') center/contain no-repeat;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--card); color: var(--text); font-weight: 500;
  cursor: pointer; transition: background .14s, border-color .14s, transform .06s;
  white-space: nowrap;
}
.btn:hover { background: var(--rule-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-3); }
.btn-zen { background: var(--zen); border-color: var(--zen); color: #fff; }
.btn-zen:hover { background: #12654f; }
.btn-sun { background: var(--sun); border-color: var(--sun); color: #3A2C08; }
.btn-sun:hover { background: #cf9a26; }
.btn-danger { color: var(--alert); border-color: var(--alert-soft); background: var(--alert-soft); }
.btn-danger:hover { background: #f5d9d6; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--mute); }
.btn-ghost:hover { background: var(--rule-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ forms */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--mute); margin-bottom: 5px; }
.field > .hint { font-size: 12px; color: var(--mute); margin-top: 5px; font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], select, textarea {
  width: 100%; padding: 9px 11px; background: var(--card);
  border: 1px solid var(--rule); border-radius: var(--r);
  transition: border-color .14s, box-shadow .14s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--zen); box-shadow: 0 0 0 3px var(--zen-soft);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
input[dir=ltr] { text-align: left; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--zen); }

/* ------------------------------------------------------------ install + login */
.install-body, .login-body { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.install-card, .login-card {
  width: 100%; max-width: 420px; background: var(--card);
  border-radius: var(--r-lg); padding: 30px 26px 20px; box-shadow: var(--shadow-lg);
}
.install-mark, .login-mark { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.install-mark b, .login-mark b { font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.install-mark i, .login-mark i { font-style: normal; font-size: 12px; color: var(--mute); letter-spacing: .1em; text-transform: uppercase; }
.install-mark .mark-sun, .login-mark .mark-sun {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: url('logo.svg') center/contain no-repeat;
}
.install-card h1, .login-card h1 { font-size: 26px; margin-bottom: 6px; }
.install-lead, .login-lead { color: var(--mute); font-size: 14px; margin: 0 0 20px; }
.install-error, .login-error {
  background: var(--alert-soft); color: #8A2E26; border-radius: var(--r);
  padding: 9px 12px; font-size: 13.5px; margin: 0 0 16px;
}
.install-form label { display: block; margin-bottom: 13px; font-size: 13px; font-weight: 500; color: var(--mute); }
.install-form label input { margin-top: 5px; }
.check-list { list-style: none; margin: 0 0 18px; padding: 0; font-size: 13.5px; }
.check-list li { display: flex; align-items: center; gap: 9px; padding: 5px 0; border-bottom: 1px solid var(--rule-2); }
.check-list li span { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.check-list li.pass span { background: var(--zen); }
.check-list li.fail span { background: var(--alert); }
.check-list li.fail { color: var(--alert); }
.install-foot, .login-foot {
  margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--rule-2);
  font-size: 11.5px; color: var(--mute); text-align: center;
}
code { font-family: var(--mono); background: var(--rule-2); padding: 1px 5px; border-radius: var(--r-sm); font-size: .9em; }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100dvh; }

.nav {
  background: linear-gradient(185deg, #16205A 0%, #1B2A6B 60%, #1E306F 100%);
  color: #C3CBD6; padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.nav-brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 18px; }
.nav-brand b { font-family: var(--display); font-size: 20px; font-weight: 800; color: #fff; }
.nav-brand i { font-style: normal; font-size: 10px; color: #9AA6D6; letter-spacing: .12em; text-transform: uppercase; display: block; }
.nav-home {
  display: flex; align-items: center; gap: 9px; width: 100%; margin-bottom: 8px;
  padding: 9px 11px; border-radius: var(--r); border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06); color: #EAEEFB; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .14s;
}
.nav-home:hover { background: rgba(255,255,255,.13); }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: var(--r); color: #B7C0DE; text-decoration: none;
  font-size: 14.5px; font-weight: 500; border: 0; background: none;
  cursor: pointer; width: 100%; text-align: right; transition: background .14s, color .14s;
}
.nav-link:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-link.on { background: rgba(255,255,255,.16); color: #fff; }
.nav-link .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sun); margin-inline-start: auto; flex: none; }
.nav-sep { font-size: 10px; letter-spacing: .14em; color: #7C87BC; text-transform: uppercase; padding: 16px 11px 6px; }
.nav-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 11px; color: #8791C2; }
.nav-me { display: flex; align-items: center; gap: 9px; padding: 10px; background: rgba(255,255,255,.08); border-radius: var(--r); margin-bottom: 10px; }
.nav-me small { display: block; color: #9AA6D6; font-size: 11px; }
.nav-me b { color: #fff; font-size: 13.5px; font-weight: 500; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 600;
  font-size: 12px; font-family: var(--display);
}
.avatar-lg { width: 38px; height: 38px; font-size: 15px; }

.shell { min-width: 0; }
.main { padding: 26px 30px 60px; max-width: 1180px; min-width: 0; }
.card, .sheet { min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 30px; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--mute); font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------ the sheet (signature) */
.sheet {
  background: var(--card); border-radius: var(--r-lg);
  border: 1px solid var(--rule); box-shadow: var(--shadow); overflow: hidden;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 2px solid var(--ink); flex-wrap: wrap;
}
.sheet-head h2 { font-size: 18px; }
.sheet-head .meta { font-size: 12px; color: var(--mute); }

.sheet-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: stretch;
  border-bottom: 1px solid var(--rule-2);
  background: var(--card);
  transition: background .14s;
}
.sheet-row:last-child { border-bottom: 0; }
.sheet-row:hover { background: #FAFBFC; }
.sheet-rail { background: var(--rule); }
.sheet-row[data-s=doing]   .sheet-rail { background: var(--sky); }
.sheet-row[data-s=review]  .sheet-rail { background: var(--sun); }
.sheet-row[data-s=changes] .sheet-rail { background: var(--alert); }
.sheet-row[data-s=done]    .sheet-rail { background: var(--zen); }
.sheet-row[data-s=blocked] .sheet-rail { background: #8A93A0; }
.sheet-row.late .sheet-rail { background: repeating-linear-gradient(45deg, var(--alert) 0 5px, #E17A72 5px 10px); }

.sheet-body { padding: 13px 16px; min-width: 0; }
.sheet-title { font-weight: 600; font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet-row[data-s=done] .sheet-title { color: var(--mute); }
.sheet-row[data-s=done] .sheet-title .txt { text-decoration: line-through; text-decoration-color: var(--rule); }
.sheet-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 5px; font-size: 12.5px; color: var(--mute); }
.sheet-side { padding: 13px 16px; display: flex; align-items: center; gap: 8px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border-radius: 100px; font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: var(--rule-2); color: var(--mute);
}
.tag-client { background: var(--ink); color: #fff; }
.tag-sun { background: var(--sun-soft); color: #7A5A0A; }
.tag-zen { background: var(--zen-soft); color: #0D5644; }
.tag-alert { background: var(--alert-soft); color: #8A2E26; }
.tag-sky { background: var(--sky-soft); color: #2A4C77; }
.tag-urgent { background: var(--alert); color: #fff; }
.tag-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }

/* the approval stamp */
.stamp {
  font-family: var(--display); font-size: 11px; font-weight: 800;
  color: var(--zen); border: 2px solid var(--zen); border-radius: var(--r-sm);
  padding: 1px 7px; transform: rotate(-6deg); opacity: .8; letter-spacing: .03em;
}

/* ------------------------------------------------------------ cards & grid */
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow);
}
.card h3 { font-size: 15px; margin-bottom: 12px; }

.stat { position: relative; overflow: hidden; }
.stat .k { font-size: 12px; color: var(--mute); font-weight: 500; }
.stat .v { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1.1; margin-top: 2px; }
.stat .s { font-size: 12px; color: var(--mute); margin-top: 2px; }
.stat.accent-sun .v { color: var(--sun); }
.stat.accent-zen .v { color: var(--zen); }
.stat.accent-alert .v { color: var(--alert); }

/* the Icarus arc — month completion drawn as a sun climbing its path */
.arc-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.arc { flex: none; }
.arc-track { fill: none; stroke: var(--rule); stroke-width: 8; stroke-linecap: round; }
.arc-fill  { fill: none; stroke: var(--sun); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .7s cubic-bezier(.4,0,.2,1); }
.arc-label { font-family: var(--display); font-size: 30px; font-weight: 800; fill: var(--ink); }
.arc-sub   { font-size: 10px; fill: var(--mute); }

.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; }
.bar-row .name { font-weight: 500; }
.bar-row .val { color: var(--mute); font-size: 12px; }
.bar-track { grid-column: 1 / -1; height: 6px; background: var(--rule-2); border-radius: 100px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 100px; transition: width .5s ease; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: right; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--mute); font-weight: 600; padding: 0 10px 8px; border-bottom: 2px solid var(--ink); white-space: nowrap;
}
.table td { padding: 10px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
.table tbody tr:hover { background: #FAFBFC; }
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }

.empty { text-align: center; padding: 44px 20px; color: var(--mute); }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 17px; }
.empty p { margin: 0 0 16px; font-size: 14px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select, .filters input { width: auto; min-width: 130px; padding: 7px 10px; font-size: 13.5px; }

/* ------------------------------------------------------------ modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(19,26,36,.5);
  display: grid; place-items: center; padding: 20px; z-index: 60;
  animation: fade .16s ease;
  overflow-y: auto;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--card); border-radius: var(--r-lg); width: 100%; max-width: 620px;
  box-shadow: var(--shadow-lg); max-height: 92dvh; display: flex; flex-direction: column;
  animation: pop .18s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--rule); display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
.modal-foot .spacer { margin-inline-start: auto; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--mute); cursor: pointer; padding: 4px 8px; border-radius: var(--r-sm); }
.x:hover { background: var(--rule-2); color: var(--text); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px; border: 1px solid var(--rule); border-radius: 100px;
  background: var(--card); cursor: pointer; font-size: 13px; transition: all .14s;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.notes { display: flex; flex-direction: column; gap: 10px; }
.note { display: flex; gap: 9px; font-size: 13.5px; }
.note .bubble { background: var(--rule-2); border-radius: var(--r); padding: 8px 11px; flex: 1; }
.note .bubble b { font-size: 12px; }
.note .bubble time { font-size: 11px; color: var(--mute); margin-inline-start: 6px; }
.note .bubble p { margin: 3px 0 0; white-space: pre-wrap; }
.note.status .bubble { background: var(--sun-soft); }

.checklist { display: flex; flex-direction: column; gap: 6px; }
.checklist-item { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; padding: 4px 0; }
.checklist-item input { margin-top: 4px; width: 15px; height: 15px; accent-color: var(--zen); flex: none; }
.checklist-item.done span { text-decoration: line-through; color: var(--mute); }

.toast-wrap { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r);
  box-shadow: var(--shadow-lg); font-size: 14px; animation: slide .2s ease;
  max-width: 340px;
}
.toast.bad { background: var(--alert); }
.toast.good { background: var(--zen); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }

/* ------------------------------------------------------------ mobile */
.mobile-bar { display: none; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .main { padding: 16px 14px 90px; }
  .page-head h1 { font-size: 23px; }

  .shell { grid-template-columns: 1fr; }
  .nav {
    position: fixed; inset-inline-start: 0; top: 0; width: min(82vw, 300px); z-index: 70;
    transform: translateX(100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  [dir=rtl] .nav { transform: translateX(100%); }
  .nav.open { transform: translateX(0); }
  .nav-scrim { position: fixed; inset: 0; background: rgba(15,20,45,.5); z-index: 65; }

  .mobile-bar {
    display: flex; align-items: center; gap: 10px; justify-content: space-between;
    position: sticky; top: 0; z-index: 40;
    background: var(--ink); color: #fff; padding: 9px 12px;
  }
  .mobile-bar b { font-family: var(--display); font-size: 17px; flex: 1; text-align: center; }
  .mobile-bar .burger { background: none; border: 0; color: #fff; font-size: 21px; padding: 4px 10px; cursor: pointer; line-height: 1; }

  /* page header stacks cleanly, actions become a full-width row */
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 16px; }
  .page-actions { width: 100%; }
  .page-actions .btn, .page-actions select, .page-actions input { flex: 1 1 auto; min-width: 0; }

  /* filters wrap to two-per-row and stay inside the screen */
  .filters { gap: 7px; }
  .filters select, .filters input { min-width: 0; flex: 1 1 44%; width: auto; }
  .filters input[type=text] { flex-basis: 100%; }

  /* tables scroll horizontally inside their card, never stretch the page */
  .table-wrap { margin: 0 -14px; padding: 0 14px; -webkit-overflow-scrolling: touch; overflow-x: auto; }
  .table { font-size: 12.5px; }
  .table th, .table td { padding: 8px 7px; }

  .sheet-row { grid-template-columns: 6px 1fr; }
  .sheet-side { grid-column: 2; padding: 0 14px 12px; flex-wrap: wrap; }
  .sheet-body { padding: 12px 14px; }
  .sheet-head { padding: 12px 14px; }

  .modal-back { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; width: 100%; border-radius: 16px 16px 0 0; max-height: 94dvh; }
  .row-2 { grid-template-columns: 1fr; }
  .btn { padding: 9px 13px; }
  .btn-sm { padding: 7px 11px; }
}

@media (min-width: 901px) { .nav-scrim { display: none; } }

@media print {
  .nav, .mobile-bar, .page-actions, .filters, .btn { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .card, .sheet { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  body { background: #fff; }
}

/* ------------------------------------------------------ additions v1.1 */

/* carry-over + new accents */
:root { --carry: #A8563F; --carry-soft: #F6E6DF; }
.tag-carry { background: var(--carry-soft); color: #7A3B29; }
.stat.accent-carry .v { color: var(--carry); }
.btn-team { background: var(--sky-soft); border-color: var(--sky-soft); color: #2A4C77; }
.btn-team:hover { background: #d8e4f2; }

/* nav pill badges */
.pill-badge {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  padding: 0 5px; margin-inline-start: 6px; border-radius: 100px;
  background: var(--sun); color: #3A2C08; font-family: var(--mono);
  font-size: 11px; text-align: center; vertical-align: middle;
}
.pill-badge.alert { background: var(--alert); color: #fff; }

/* banners */
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 15px; border-radius: var(--r); margin-bottom: 14px; font-size: 14px;
  border: 1px solid var(--rule);
}
.banner-alert { background: var(--carry-soft); border-color: #EAD2C7; color: #6E3826; }
.banner b { font-family: var(--mono); }

/* month calendar */
.cal { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 12px; box-shadow: var(--shadow); margin-bottom: 8px; }
.cal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-top b { font-family: var(--display); font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-head { margin-bottom: 5px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--mute); font-weight: 600; padding: 2px 0; }
.cal-cell {
  position: relative; min-height: 52px; border: 1px solid var(--rule-2); background: var(--card);
  border-radius: var(--r); padding: 5px 6px; cursor: pointer; text-align: start;
  display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, background .15s;
}
.cal-cell:hover { border-color: var(--sun); }
.cal-cell.empty { border: none; background: transparent; cursor: default; }
.cal-cell.has { background: #FCFDFE; }
.cal-cell.today { border-color: var(--zen); }
.cal-cell.sel { border-color: var(--ink); background: var(--sun-soft); box-shadow: inset 0 0 0 1px var(--ink); }
.cal-num { font-family: var(--mono); font-size: 13px; color: var(--text); }
.cal-cell.today .cal-num { color: var(--zen); font-weight: 700; }
.cal-badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; }
.cal-b {
  min-width: 17px; height: 17px; line-height: 17px; text-align: center; padding: 0 3px;
  border-radius: 100px; font-family: var(--mono); font-size: 10.5px; font-weight: 600;
}
.cal-b.open { background: var(--sky-soft); color: #2A4C77; }
.cal-b.done { background: var(--zen-soft); color: #0D5644; }
.cal-b.late { background: var(--carry-soft); color: #7A3B29; }

/* subtasks */
.checklist-item.subtask { align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--rule-2); }
.checklist-item.subtask:last-child { border-bottom: none; }
.checklist-item.subtask span { display: flex; flex-direction: column; }
.sub-note { font-style: normal; font-size: 12.5px; color: var(--mute); margin-top: 1px; }

/* policy */
.policy-card { max-width: 820px; }
.policy-text { font-size: 15px; line-height: 1.85; white-space: normal; }

@media (max-width: 640px) {
  .cal-cell { min-height: 46px; padding: 4px; }
  .cal-num { font-size: 12px; }
  .banner { flex-direction: column; align-items: stretch; }
}

@media print {
  .cal, .banner, .page-actions { display: none !important; }
}

/* ------------------------------------------------------ v1.2: drawer, dashboard, deductions */

/* role tag colours */
.tag-role-admin { background: var(--navy); color: #fff; }
.tag-role-management { background: #6B4E9E; color: #fff; }
.tag-role-manager { background: var(--sky-soft); color: #26418C; }
.tag-role-employee { background: var(--rule-2); color: var(--mute); }

/* ---- app drawer (home launcher) ---- */
.home { min-height: 100dvh; background:
  radial-gradient(1200px 480px at 85% -10%, #223a86 0%, rgba(34,58,134,0) 60%),
  linear-gradient(180deg, #16205A 0%, #1B2A6B 46%, #22347E 100%);
  color: #fff; padding: 0; }
.home-inner { max-width: 1120px; margin: 0 auto; padding: 30px 24px 60px; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.home-brand { display: flex; align-items: center; gap: 12px; }
.home-brand b { font-family: var(--display); font-size: 26px; font-weight: 800; color: #fff; line-height: 1; }
.home-brand i { font-style: normal; display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #9AA6D6; margin-top: 3px; }
.home-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.home-actions .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: #EAEEFB; }
.home-actions .btn:hover { background: rgba(255,255,255,.2); }
.home-hi { margin: 22px 0 6px; }
.home-hi h1 { font-size: 30px; color: #fff; letter-spacing: -.01em; }
.home-hi p { margin: 6px 0 0; color: #B7C0DE; font-size: 14.5px; }

.home-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0 8px; }
.kpi {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-lg); padding: 14px 16px; backdrop-filter: blur(4px);
}
.kpi .k { font-size: 12px; color: #A8B2DA; font-weight: 500; }
.kpi .v { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1.1; margin-top: 3px; color: #fff; }
.kpi .s { font-size: 11.5px; color: #96A1CF; margin-top: 2px; }
.kpi.warn { background: rgba(217,138,31,.18); border-color: rgba(217,138,31,.4); }
.kpi.warn .v { color: #FFD48A; }
.kpi.alert { background: rgba(196,69,59,.2); border-color: rgba(196,69,59,.42); }
.kpi.alert .v { color: #FFB4AC; }

.home-sec { margin: 26px 0 12px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #8791C2; font-weight: 700; }
.drawer { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.app-tile {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: rgba(255,255,255,.95); border: 1px solid rgba(255,255,255,.5);
  border-radius: 18px; padding: 18px; cursor: pointer; text-align: start;
  color: var(--text); transition: transform .12s ease, box-shadow .16s ease;
  box-shadow: 0 6px 20px rgba(10,18,60,.22); min-height: 118px;
}
.app-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(10,18,60,.32); }
.app-tile:active { transform: translateY(0); }
.tile-ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 23px; background: var(--navy-soft); color: var(--navy);
}
.app-tile b { font-family: var(--display); font-size: 17px; font-weight: 800; line-height: 1.15; }
.app-tile small { display: block; color: var(--mute); font-size: 12.5px; margin-top: 2px; line-height: 1.45; font-weight: 400; }
.tile-badge {
  position: absolute; inset-inline-end: 14px; top: 14px; min-width: 22px; height: 22px; line-height: 22px;
  padding: 0 7px; border-radius: 100px; background: var(--alert); color: #fff;
  font-family: var(--mono); font-size: 12px; font-weight: 600; text-align: center;
}
.tile-badge.sun { background: var(--sun); color: #4A3208; }

/* ---- deductions ---- */
.money { font-family: var(--mono); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.warn-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 100px; }
.warn-notice { background: var(--sun-soft); color: #7A5A0A; }
.warn-first  { background: #FCE9CE; color: #8A5A12; }
.warn-second { background: var(--alert-soft); color: #8A2E26; }
.warn-final  { background: var(--alert); color: #fff; }
.sched-row { display: grid; grid-template-columns: 1.6fr .8fr .8fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.sched-row input, .sched-row select { padding: 7px 9px; font-size: 13px; }
.sched-row .del { color: var(--alert); }
@media (max-width: 640px) { .sched-row { grid-template-columns: 1fr 1fr; } }

/* plan posts progress */
.posts-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.posts-head h3 { margin: 0; font-size: 15px; }
.posts-pct { font-family: var(--mono); font-size: 13px; color: var(--navy-2); font-weight: 600; }
.bar-track.big { height: 10px; }
.plan-flag { background: var(--navy-soft); color: var(--navy); }

/* ---- responsive hardening ---- */
@media (max-width: 900px) {
  .home-kpis { grid-template-columns: repeat(2, 1fr); }
  .drawer { grid-template-columns: repeat(2, 1fr); }
  .home-inner { padding: 22px 16px 60px; }
  .home-hi h1 { font-size: 24px; }
  .filters { gap: 6px; }
  .filters select, .filters input { min-width: 0; flex: 1 1 46%; }
}
@media (max-width: 560px) {
  .home-kpis { grid-template-columns: repeat(2, 1fr); }
  .drawer { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .app-tile { padding: 14px; min-height: 104px; border-radius: 15px; }
  .tile-ico { width: 40px; height: 40px; font-size: 20px; }
  .page-head { margin-bottom: 16px; }
  .page-actions { width: 100%; }
  .page-actions .btn, .page-actions select, .page-actions input { flex: 1 1 auto; }
  .modal-foot { flex-direction: column-reverse; align-items: stretch; }
  .modal-foot .btn { width: 100%; }
  .modal-foot .spacer { display: none; }
}

/* ------------------------------------------------------ v1.2.1: packages, tracker, policy PDF */

.pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.pkg-grid .field span { font-size: 12px; }
.pkg-grid .field input { padding: 7px 9px; }
@media (max-width: 560px) { .pkg-grid { grid-template-columns: repeat(2, 1fr); } }

.pkg-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 820px) { .pkg-cards { grid-template-columns: 1fr; } }
.track-card { display: flex; flex-direction: column; gap: 10px; }
.track-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.track-tot { font-size: 13px; color: var(--mute); background: var(--paper); padding: 7px 11px; border-radius: var(--r); }
.track-line { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; }
.track-k { font-size: 13px; font-weight: 600; }
.track-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.track-b small { display: block; font-size: 11.5px; color: var(--mute); margin-bottom: 3px; }
.track-dates { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--mute); border-top: 1px solid var(--rule-2); padding-top: 9px; }
.track-note { font-size: 13px; color: var(--text); background: var(--sun-soft); padding: 8px 11px; border-radius: var(--r); }
.track-edit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.track-edit-row { display: grid; grid-template-columns: 1.4fr .8fr .8fr; gap: 8px; align-items: end; }
.track-edit-row .track-k { align-self: center; }
.track-edit-row label small { display: block; font-size: 11px; color: var(--mute); margin-bottom: 2px; }
.track-edit-row input { width: 100%; padding: 7px 9px; font-size: 13px; }
@media (max-width: 560px) {
  .track-line { grid-template-columns: 52px 1fr; }
  .track-edit-row { grid-template-columns: 1fr; gap: 4px; }
  .track-edit-row .track-k { margin-top: 6px; }
}

/* policy PDF frame */
.pdf-frame {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow); height: min(78dvh, 900px);
}
.pdf-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 560px) { .pdf-frame { height: 68dvh; } }

/* print-only report header */
.print-only { display: none; }
.print-report-head { display: none; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--navy); }
.print-report-head .brand-logo { width: 40px; height: 40px; }
.print-report-head b { font-family: var(--display); font-size: 20px; color: var(--navy); }

@media print {
  .home-actions, .nav-home, #rpClients .btn { display: none !important; }
  .print-only { display: block !important; }
  .print-report-head { display: flex !important; }
  .grid-4 { grid-template-columns: repeat(4, 1fr) !important; }
  .grid-2 { grid-template-columns: 1fr 1fr !important; }
  .card, .sheet { break-inside: avoid; }
  .main { padding: 0 !important; max-width: 100% !important; }
  a[href]:after { content: ''; }
}
