/* ============================================================
   Stage Café — "غرفة قيادة هادئة" redesign, adapted from the Manus-delivered
   stage-redesign.css (design-handoff round 1, approved sample: branch-manager
   home, task detail, new-account form). Loaded AFTER style.css during the
   screen-by-screen migration (Phase 12) — a page that hasn't been converted
   yet keeps using style.css's classes untouched, since nothing here overrides
   a class name style.css doesn't also define.
   Reuses this project's existing self-hosted "Plex Arabic" @font-face
   declarations (style.css) instead of redeclaring the same files under
   Manus's "IBM Plex Sans Arabic" family name.
   Dropped from the original file: the prototype-only screen switcher bar
   (.prototype-switcher), the task-detail state switcher (.state-preview/
   .state-dot/.preview-note — Manus's own note: "must not be moved to the
   real system"), and the prototype's own toast (.preview-toast) — this app
   already has showToast()/.flash for that. Every remaining top/height value
   that assumed the switcher bar's 44px has been adjusted back to 0.
   ============================================================ */
:root {
  --radius: 0.8rem;
  --background: #f5f0e7;
  --foreground: #2a211b;
  --card: #fffcf8;
  --card-foreground: #2a211b;
  --popover: #fffdf9;
  --popover-foreground: #2a211b;
  --primary: #2f2119;
  --primary-foreground: #fffaf2;
  --secondary: #eee5d7;
  --secondary-foreground: #44342a;
  --muted-ui: #f0e9de;
  --muted-foreground: #796a5e;
  --accent: #b96e36;
  --accent-foreground: #fffaf4;
  --destructive: #a83d37;
  --destructive-foreground: #fff;
  --border: #e0d5c5;
  --input: #d7c8b5;
  --ring: #b96e36;
  --ivory: #f5f0e7;
  --ivory-soft: #fbf8f2;
  --surface: #fffdf9;
  --espresso: #2f2119;
  --espresso-2: #3b2a20;
  --ink: #2a211b;
  --muted-text: #796a5e;
  --copper: #b96e36;
  --copper-dark: #8f4d22;
  --line-soft: #e5dacc;
  --danger: #ad3e38;
  --danger-soft: #f8e7e3;
  --warning: #a86b2f;
  --warning-soft: #f7ead8;
  --success: #4c765a;
  --success-soft: #e6f0e8;
  --info: #4e6f82;
  --info-soft: #e6eef2;
  --shadow-soft: 0 1px 2px rgba(46, 31, 22, .04), 0 12px 32px rgba(46, 31, 22, .06);
  --shadow-pop: 0 24px 80px rgba(36, 23, 16, .24);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}

.redesign-root * { box-sizing: border-box; }
.redesign-root { min-height: 100vh; background: radial-gradient(circle at 15% 4%, rgba(185, 110, 54, .08), transparent 24rem), var(--ivory); color: var(--ink); font-family: "Plex Arabic", "Segoe UI", Tahoma, sans-serif; font-size: 15px; line-height: 1.55; }
.redesign-root button, .redesign-root input, .redesign-root select, .redesign-root textarea { font: inherit; }
.redesign-root button, .redesign-root a { -webkit-tap-highlight-color: transparent; }
.redesign-root button:not(:disabled), .redesign-root a[href], .redesign-root select:not(:disabled) { cursor: pointer; }
.redesign-root button:focus-visible, .redesign-root a:focus-visible, .redesign-root input:focus-visible, .redesign-root select:focus-visible, .redesign-root textarea:focus-visible { outline: 3px solid rgba(185, 110, 54, .28); outline-offset: 2px; }
.redesign-root a { color: inherit; text-decoration: none; }

.app-frame { min-height: 100vh; display: flex; align-items: stretch; }
.desktop-sidebar { position: sticky; top: 0; width: 252px; height: 100vh; flex: 0 0 252px; overflow: hidden; background: linear-gradient(180deg, #2e2018 0%, #241710 100%); color: #f8f0e5; border-inline-end: 1px solid rgba(255,255,255,.05); }
.sidebar-inner { height: 100%; display: flex; flex-direction: column; padding: 22px 16px 16px; }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; }
.brand-monogram { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #2a1b14; background: linear-gradient(145deg, #efd2b3, #c77f46); box-shadow: inset 0 1px rgba(255,255,255,.45); }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font-size: 17px; letter-spacing: .01em; }
.brand-lockup span { margin-top: 1px; color: #bca99b; font-size: 11px; }
.branch-context { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; margin-bottom: 18px; padding: 10px 11px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.045); }
.branch-context > div span, .branch-context > div strong { display: block; }
.branch-context > div span { color: #af9b8d; font-size: 10px; }
.branch-context > div strong { margin-top: 1px; color: #f8eee3; font-size: 12px; }
.sidebar-nav { min-height: 0; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.nav-group { margin-bottom: 16px; }
.nav-group p { margin: 0 10px 5px; color: #9f8a7c; font-size: 10px; font-weight: 600; }
.nav-item { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: 9px; color: #dccfc4; background: transparent; font-size: 12.5px; text-align: start; transition: color .18s var(--ease-out), background .18s var(--ease-out), transform .15s var(--ease-out); }
.nav-item:hover { color: white; background: rgba(255,255,255,.065); }
.nav-item:active { transform: scale(.98); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, #a45e2d, #c17b43); box-shadow: 0 8px 20px rgba(137,73,31,.24); }
.sidebar-user { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.09); color: #c9b9ad; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: #70401f; background: #efdbc4; font-size: 12px; font-weight: 700; }
.avatar.small { width: 34px; height: 34px; border-radius: 10px; font-size: 10px; }
.sidebar-user strong, .sidebar-user span { display: block; }
.sidebar-user strong { color: #fff8f1; font-size: 11.5px; }
.sidebar-user span { margin-top: 2px; color: #9f8d80; font-size: 10px; }
.sidebar-user a { color: inherit; }

.app-main { min-width: 0; flex: 1; }
.app-topbar { position: sticky; top: 0; z-index: 90; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 11px; padding-inline: clamp(20px, 3vw, 40px); padding-top: max(11px, env(safe-area-inset-top)); border-bottom: 1px solid rgba(210,196,178,.7); background: rgba(255,253,249,.9); backdrop-filter: blur(18px); }
.page-heading > span { display: block; margin-bottom: 1px; color: var(--muted-text); font-size: 11px; }
.page-heading h1 { margin: 0; color: var(--ink); font-size: clamp(18px, 2vw, 23px); line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }
.mobile-brand { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid var(--line-soft); border-radius: 11px; color: #59493f; background: rgba(255,255,255,.78); transition: transform .15s var(--ease-out), border-color .18s, background .18s; }
.icon-button:hover { border-color: #cdb9a2; background: #fff; }
.icon-button:active { transform: scale(.96); }
.topbar-actions > .icon-button { display: none; }
.push-button { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line-soft); border-radius: 10px; color: #5a473a; background: #fff; font-size: 12px; font-weight: 600; }
.notification-wrap { position: relative; }
.notification-wrap > span { position: absolute; top: -4px; left: -3px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: var(--danger); font-size: 9px; font-weight: 700; }
.page-content { width: min(100%, 1340px); margin: 0 auto; padding: 30px clamp(20px, 3vw, 40px) 56px; }

.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.welcome-row > div:first-child > span { color: var(--copper-dark); font-size: 12px; font-weight: 600; }
.welcome-row h2 { margin: 3px 0 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; letter-spacing: -.035em; }
.welcome-row p { margin: 5px 0 0; color: var(--muted-text); font-size: 12px; }
.quick-actions { display: flex; align-items: center; gap: 8px; }
.quick-actions a, .quick-actions button { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid var(--line-soft); border-radius: 12px; color: #55443a; background: rgba(255,253,249,.86); box-shadow: 0 3px 10px rgba(48,32,22,.03); font-size: 12px; font-weight: 600; transition: .18s var(--ease-out); }
.quick-actions a:hover, .quick-actions button:hover { transform: translateY(-1px); border-color: #cbb69d; background: #fff; }
.quick-actions strong { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: var(--copper); font-size: 10px; }

.command-grid { display: grid; grid-template-columns: minmax(280px, .82fr) minmax(520px, 1.7fr); gap: 16px; margin-bottom: 18px; }
.commitment-card { position: relative; min-height: 178px; display: grid; grid-template-columns: 1fr auto; gap: 16px; overflow: hidden; padding: 23px; border-radius: 18px; color: #fff8f1; background: linear-gradient(145deg, #35241b 0%, #251811 68%, #512d1b 150%); box-shadow: 0 18px 38px rgba(43,29,19,.14); }
.commitment-card::after { content: ""; position: absolute; width: 180px; height: 180px; inset-inline-end: -75px; top: -70px; border: 38px solid rgba(214,141,82,.11); border-radius: 50%; }
.commitment-copy { position: relative; z-index: 1; }
.commitment-copy > span { color: #d8c5b7; font-size: 11px; }
.commitment-copy > strong { display: block; margin-top: 5px; font-size: 40px; line-height: 1; letter-spacing: -.04em; }
.commitment-copy p { margin: 8px 0 0; color: #efdfd1; font-size: 12px; }
.commitment-ring { position: relative; z-index: 1; width: 76px; height: 76px; display: grid; place-items: center; align-self: start; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; color: #e7ae7c; background: rgba(255,255,255,.05); }
.commitment-ring span { position: absolute; bottom: 8px; color: #fff; font-size: 10px; font-weight: 700; }
.commitment-foot { position: relative; z-index: 1; grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; margin-top: 4px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.1); color: #f0c5b9; font-size: 11px; }
.commitment-foot strong { color: #fff; font-size: 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.metric-card { min-height: 82px; display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 15px; background: rgba(255,253,249,.9); box-shadow: var(--shadow-soft); }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: #806551; background: #f0e8dc; }
.metric-card strong, .metric-card span { display: block; }
.metric-card strong { font-size: 23px; line-height: 1.1; }
.metric-card span { margin-top: 3px; color: var(--muted-text); font-size: 11px; }
.metric-success .metric-icon { color: var(--success); background: var(--success-soft); }
.metric-warning .metric-icon { color: var(--warning); background: var(--warning-soft); }
.metric-danger { border-color: #e9c3bd; background: linear-gradient(145deg, #fffaf7, #faebe7); }
.metric-danger .metric-icon { color: var(--danger); background: #f4d6d1; }
.metric-danger strong { color: var(--danger); }

.content-card, .task-detail-card, .audit-card { margin-bottom: 18px; padding: 22px; border: 1px solid rgba(219,206,188,.9); border-radius: 18px; background: rgba(255,253,249,.9); box-shadow: var(--shadow-soft); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.section-heading > div:first-child > span { display: block; margin-bottom: 2px; color: var(--copper-dark); font-size: 10.5px; font-weight: 600; }
.section-heading h2 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -.02em; }
.quiet-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; color: var(--info); background: var(--info-soft); font-size: 10.5px; font-weight: 600; }
.personal-task { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; transition: .18s var(--ease-out); }
.personal-task:hover { transform: translateY(-1px); border-color: #cbb49b; box-shadow: 0 8px 24px rgba(56,37,24,.06); }
.task-leading, .task-trailing { display: flex; align-items: center; gap: 11px; }
.task-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: var(--copper-dark); background: #f3e4d3; }
.task-icon.large { width: 48px; height: 48px; border-radius: 14px; }
.task-leading strong, .task-leading span { display: block; }
.task-leading strong { font-size: 13.5px; }
.task-leading span { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--muted-text); font-size: 10.5px; }
.inline-link, .back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--copper-dark); font-size: 11.5px; font-weight: 600; }
.inline-link:hover, .back-link:hover { text-decoration: underline; }
.status-pill { width: fit-content; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-new { color: #995823; background: #f4e3cf; }
.status-progress { color: var(--info); background: var(--info-soft); }
.status-review { color: var(--warning); background: var(--warning-soft); }
.status-danger { color: var(--danger); background: var(--danger-soft); }
.status-success { color: var(--success); background: var(--success-soft); }
.status-neutral { color: #6d655f; background: #ece9e5; }
.status-info { color: #4e6b77; background: #e7eff2; }

.filter-row { display: flex; align-items: center; gap: 8px; }
.filter-row label { position: relative; min-width: 150px; display: flex; align-items: center; }
.filter-row label > svg { position: absolute; inset-inline-start: 11px; color: #826d5d; pointer-events: none; }
.filter-row select { width: 100%; height: 38px; padding: 0 35px 0 30px; border: 1px solid var(--line-soft); border-radius: 10px; color: #59483d; background: #fff; font-size: 11px; }
.filter-row.compact select { min-width: 116px; height: 40px; padding: 0 11px; }
.team-table { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; }
.team-row { min-height: 60px; display: grid; grid-template-columns: 2fr repeat(4, minmax(80px, .7fr)); align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #eee5da; color: #57483e; font-size: 12px; }
/* branch-manager-home shows 6 stat columns per employee (not the 4-stat demo data) — an additive
   modifier so the base 5-column .team-row stays available for any future screen with fewer columns. */
.team-row.cols-7 { grid-template-columns: 1.8fr repeat(6, minmax(72px, .65fr)); }
.team-row:last-child { border-bottom: 0; }
.team-row:not(.team-header):hover { background: #fdf9f4; }
.team-header { min-height: 40px; color: #817063; background: #f2ece3; font-size: 10px; font-weight: 700; }
.employee-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.employee-cell strong, .employee-cell small { display: block; }
.employee-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #342820; font-size: 12px; }
.employee-cell small { margin-top: 2px; color: var(--muted-text); font-size: 9.5px; }
.percentage-pill { display: inline-flex; min-width: 42px; justify-content: center; padding: 3px 8px; border-radius: 999px; color: var(--danger); background: var(--danger-soft); font-size: 10px; font-weight: 700; }
.danger-number { color: var(--danger); font-weight: 700; }
.empty-inline { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 28px; color: var(--muted-text); font-size: 12px; }
.split-grid { display: grid; grid-template-columns: 1.35fr .8fr; gap: 18px; align-items: start; }
.text-button { padding: 4px; border: 0; color: var(--copper-dark); background: transparent; font-size: 11px; font-weight: 600; }
.timeline-list { display: flex; flex-direction: column; }
.timeline-item { min-height: 58px; display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eee5da; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-time { display: flex; align-items: center; gap: 5px; color: var(--copper-dark); font-size: 10.5px; font-weight: 700; }
.timeline-item > div:nth-child(2) strong, .timeline-item > div:nth-child(2) span { display: block; }
.timeline-item > div:nth-child(2) strong { font-size: 12px; }
.timeline-item > div:nth-child(2) span { margin-top: 2px; color: var(--muted-text); font-size: 9.5px; }
.action-notification { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 13px; border: 1px solid #ebcbc5; border-radius: 13px; background: #fcf0ed; }
.notification-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--danger); background: #f2d9d4; }
.action-notification strong, .action-notification span { display: block; }
.action-notification strong { font-size: 11.5px; line-height: 1.45; }
.action-notification div > span { margin-top: 3px; color: #876961; font-size: 9.5px; }
.action-notification button { min-height: 34px; padding: 6px 11px; border: 1px solid #d8a79e; border-radius: 9px; color: #7f2f2a; background: #fff; font-size: 10px; font-weight: 700; }
.notification-empty { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 10px 3px 0; color: var(--success); font-size: 10.5px; }

.detail-topline { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.back-link { margin: 0; }
.task-detail-card { padding: 0; overflow: hidden; }
.task-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 25px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(180deg, #fffdf9, #fcf8f2); }
.task-title-group { display: flex; align-items: flex-start; gap: 14px; }
.task-kicker { display: block; margin-bottom: 4px; color: var(--copper-dark); font-size: 10px; font-weight: 700; }
.task-title-group h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); line-height: 1.25; letter-spacing: -.03em; }
.task-title-group p { max-width: 720px; margin: 7px 0 0; color: #6e5e53; font-size: 12px; }
.task-facts { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; padding: 17px 25px; border-bottom: 1px solid var(--line-soft); }
.task-facts > div { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 5px 13px; border-inline-start: 1px solid #eee4d8; color: #8c7463; }
.task-facts > div:first-child { border-inline-start: 0; padding-inline-start: 0; }
.task-facts span, .task-facts strong { display: block; }
.task-facts span { font-size: 9.5px; }
.task-facts strong { margin-top: 2px; overflow: hidden; color: #3c2d24; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.context-message { display: flex; align-items: flex-start; gap: 10px; margin: 18px 25px 0; padding: 13px 14px; border-radius: 12px; }
.context-message strong { display: block; font-size: 11.5px; }
.context-message p { margin: 3px 0 0; font-size: 10.5px; }
.context-message.danger { color: #812e2a; background: var(--danger-soft); }
.context-message.review { color: #7d531f; background: var(--warning-soft); }
.context-message.success { color: #3e664c; background: var(--success-soft); }
.context-message.neutral { color: #5f5853; background: #efebe6; }
.task-evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 22px 25px; }
.task-evidence-grid article { min-height: 122px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 13px; background: #fff; }
.subsection-title { display: flex; align-items: center; gap: 8px; color: var(--copper-dark); }
.subsection-title h3 { margin: 0; color: var(--ink); font-size: 13px; }
.task-evidence-grid p { margin: 12px 0 7px; color: #594b41; font-size: 11px; }
.task-evidence-grid article > span { color: var(--muted-text); font-size: 9.5px; }
.task-evidence-grid a { display: flex; align-items: center; gap: 9px; margin-top: 15px; color: var(--copper-dark); }
.task-evidence-grid a strong, .task-evidence-grid a small { display: block; }
.task-evidence-grid a strong { font-size: 11px; }
.task-evidence-grid a small { margin-top: 2px; color: var(--muted-text); font-size: 9px; }
.task-action-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 25px; border-top: 1px solid var(--line-soft); background: #f8f3eb; }
.primary-actions, .secondary-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 11px; font-weight: 700; transition: .16s var(--ease-out); }
.button:active { transform: scale(.97); }
.button.primary { color: #fff; background: linear-gradient(135deg, #39271d, #2a1c15); box-shadow: 0 8px 18px rgba(48,29,19,.15); }
.button.primary:hover { background: #20140f; }
.button.secondary { border-color: #d6c6b3; color: #59473b; background: #fff; }
.button.danger { color: #fff; background: var(--danger); }
.secondary-actions button { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 0; border-radius: 9px; color: #6b584c; background: transparent; font-size: 10px; font-weight: 600; }
.secondary-actions button:hover { background: #eee5d8; }
.secondary-actions button:disabled { opacity: .55; cursor: default; }
.secondary-actions .problem-action { color: var(--danger); }
.action-status { display: flex; align-items: center; gap: 7px; color: #70655d; font-size: 10.5px; }
.audit-card { padding: 19px 22px; }
/* my-tasks.php reuses task-detail-card's building blocks per list item (per the Manus handoff's
   own integration note: apply the card language to each item, not one hero card) — .compact
   tightens the paddings/grids that assumed a single full-width hero card, since a task list can
   hold many of these stacked. Higher specificity than the base rules below (two classes vs one),
   so it wins regardless of where it's declared in the cascade. */
.task-detail-card.compact { margin-bottom: 14px; }
.task-detail-card.compact .task-detail-header { padding: 16px 18px; }
.task-detail-card.compact .task-title-group h2 { font-size: 16px; }
.task-detail-card.compact .task-title-group p { margin-top: 4px; font-size: 11px; }
.task-detail-card.compact .task-facts { grid-template-columns: repeat(3, 1fr); padding: 10px 18px; }
.task-detail-card.compact .task-evidence-grid { grid-template-columns: 1fr; gap: 10px; padding: 14px 18px; }
.task-detail-card.compact .task-evidence-grid article { min-height: auto; }
.task-detail-card.compact .task-action-bar { padding: 12px 18px; flex-wrap: wrap; }
.audit-list { margin-top: 14px; }
.audit-list > div { display: grid; grid-template-columns: 14px 1fr; gap: 8px; min-height: 50px; }
.audit-dot { position: relative; width: 9px; height: 9px; margin-top: 5px; border: 2px solid #c9b8a6; border-radius: 50%; background: #fff; }
.audit-dot::after { content: ""; position: absolute; top: 10px; right: 2px; width: 1px; height: 35px; background: #ded1c2; }
.audit-list > div:last-child .audit-dot::after { display: none; }
.audit-dot.active { border-color: var(--copper); background: var(--copper); }
.audit-list p { margin: 0; }
.audit-list strong, .audit-list small { display: block; }
.audit-list strong { font-size: 11px; }
.audit-list small { margin-top: 2px; color: var(--muted-text); font-size: 9.5px; }

.modal-layer, .user-modal-layer, .drawer-layer { position: fixed; inset: 0; z-index: 160; display: flex; align-items: center; justify-content: center; padding: 18px; }
/* The mobile media query below re-sets .drawer-layer's own `display` for its slide-in layout —
   an author rule of equal specificity always beats the browser's built-in `[hidden]{display:none}`
   regardless of source order, so without this !important the drawer showed open immediately on
   every page load on mobile, and closeMobileDrawer()'s `hidden = true` had no visible effect. */
.modal-layer[hidden], .user-modal-layer[hidden], .drawer-layer[hidden] { display: none !important; }
/* Every real modal in the app (create-user, task transfer, etc.) reuses the app's existing
   openModal()/closeModal() class-toggle convention (every other modal in the app works this way)
   instead of the prototype's `hidden` attribute, so their default-hidden state keys off the same
   `.open` class rather than the `[hidden]` rule above. Only .drawer-layer still uses `hidden`
   (layout.php's mobile drawer sets it directly). */
.modal-layer, .user-modal-layer { display: none; }
.modal-layer.open, .user-modal-layer.open { display: flex; }
.modal-backdrop, .drawer-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(39,25,17,.48); backdrop-filter: blur(4px); }
.action-modal { position: relative; z-index: 1; width: min(100%, 500px); max-height: calc(100vh - 80px); overflow-y: auto; padding: 20px; border-radius: 18px; background: #fffdf9; box-shadow: var(--shadow-pop); animation: modal-in .22s var(--ease-out); }
.modal-title { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 17px; }
.modal-title > span { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; color: var(--copper-dark); background: #f3e3d2; }
.modal-title small, .modal-title h3 { display: block; margin: 0; }
.modal-title small { color: var(--muted-text); font-size: 9.5px; }
.modal-title h3 { margin-top: 2px; font-size: 17px; }
.field-control { display: block; margin-bottom: 14px; }
.field-control > span { display: block; margin-bottom: 5px; color: #49382e; font-size: 11px; font-weight: 700; }
.field-control b { color: var(--danger); }
.field-control input, .field-control select, .field-control textarea, .account-field input, .account-field select, .account-field textarea, .search-box input { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #d9cbbb; border-radius: 10px; color: #382b23; background: #fff; transition: border-color .16s, box-shadow .16s; font-family: inherit; }
.field-control textarea { min-height: 110px; resize: vertical; }
.field-control input:focus, .field-control select:focus, .field-control textarea:focus, .account-field input:focus, .account-field select:focus { border-color: var(--copper); outline: none; box-shadow: 0 0 0 3px rgba(185,110,54,.13); }
.upload-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 190px; padding: 22px; border: 1.5px dashed #cdb9a2; border-radius: 14px; color: #745f4f; background: #fbf7f1; text-align: center; }
.upload-zone strong { margin-top: 10px; font-size: 12px; }
.upload-zone span { margin-top: 4px; color: var(--muted-text); font-size: 9.5px; }
.upload-zone button { margin-top: 13px; padding: 7px 12px; border: 1px solid #cbb69f; border-radius: 9px; color: #624b3c; background: #fff; font-size: 10px; font-weight: 700; }
.notice-copy { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; color: #7d4b34; background: #f7eadf; font-size: 10px; }
.camera-button { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px dashed #cdb9a2; border-radius: 10px; color: #604c3f; background: #fbf8f3; font-size: 10.5px; font-weight: 700; }
.camera-button span { color: var(--muted-text); font-size: 9px; font-weight: 500; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.users-background { min-height: 620px; }
.users-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-box { position: relative; min-width: 240px; flex: 1; }
.search-box svg { position: absolute; top: 12px; inset-inline-start: 12px; color: #8b7667; }
.search-box input { padding-inline-start: 38px; background: rgba(255,255,255,.84); }
.mock-user-table { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 15px; background: #fff; box-shadow: var(--shadow-soft); }
.mock-user-head, .mock-user-row { display: grid; grid-template-columns: 1.4fr 1fr .8fr .9fr .5fr; align-items: center; gap: 12px; min-height: 62px; padding: 10px 15px; border-bottom: 1px solid #eee5da; font-size: 11px; }
.mock-user-head { min-height: 40px; color: #79685b; background: #f2ebe2; font-size: 9.5px; font-weight: 700; }
.mock-user-row:last-child { border-bottom: 0; }
.user-modal-layer { align-items: stretch; padding: 22px; }
.user-form-sheet { position: relative; z-index: 1; width: min(100%, 780px); max-height: calc(100vh - 88px); display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: #fffdf9; box-shadow: var(--shadow-pop); animation: modal-in .22s var(--ease-out); }
.user-form-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 24px 15px; border-bottom: 1px solid var(--line-soft); background: #fffdf9; }
.user-form-header > div > span { color: var(--copper-dark); font-size: 10px; font-weight: 700; }
.user-form-header h2 { margin: 2px 0 0; font-size: 24px; }
.user-form-header p { margin: 4px 0 0; color: var(--muted-text); font-size: 10.5px; }
.form-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 24px; color: #6a5749; background: #f5eee4; font-size: 9.5px; }
.form-progress strong { color: #8d4a24; }
.account-form { min-height: 0; flex: 1; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 15px 18px; overflow-y: auto; padding: 19px 24px 26px; scrollbar-width: thin; scrollbar-color: #cbb9a4 transparent; }
.account-field { min-width: 0; display: block; }
.field-label { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; color: #49382e; font-size: 10.5px; font-weight: 700; }
.field-label i { width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; color: #8c5b36; background: #f1e2d2; font-size: 9px; font-style: normal; }
.field-label b { color: var(--danger); }
.account-field input, .account-field select { min-height: 42px; font-size: 11px; }
.account-field textarea { font-size: 11px; resize: vertical; }
.account-field input[readonly] { color: #6c5c50; background: #f2ede7; }
.account-field select:disabled { color: #9d928a; background: #f2efeb; }
.account-field small { display: block; margin-top: 4px; color: var(--muted-text); font-size: 8.8px; }
.account-field .invalid { border-color: var(--danger); background: #fffafa; }
.conditional-field { min-width: 0; }
.conditional-field.muted-field { display: none; }
.user-form-footer { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 24px; border-top: 1px solid var(--line-soft); background: rgba(255,253,249,.96); box-shadow: 0 -8px 24px rgba(47,31,21,.06); }
.user-form-footer > div { display: flex; align-items: center; gap: 7px; color: #756358; font-size: 9.5px; }

.mobile-bottom-nav { display: none; }
.drawer-layer { display: none; }

@media (max-width: 1100px) {
  .desktop-sidebar { width: 228px; flex-basis: 228px; }
  .command-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(4,1fr); }
  .split-grid { grid-template-columns: 1fr; }
  .task-facts { grid-template-columns: repeat(2,1fr); row-gap: 10px; }
  .task-facts > div:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
}

@media (max-width: 900px) {
  .redesign-root { padding-bottom: 68px; }
  .desktop-sidebar { display: none; }
  .app-topbar { top: 0; min-height: 62px; padding-block: 8px; padding-inline: 14px; padding-top: max(8px, env(safe-area-inset-top)); }
  .mobile-brand { display: flex; align-items: center; gap: 7px; color: var(--espresso); }
  .mobile-brand strong { font-size: 13px; }
  .page-heading { flex: 1; text-align: center; }
  .page-heading > span { display: none; }
  .page-heading h1 { font-size: 16px; }
  .topbar-actions > .icon-button { display: inline-grid; }
  .push-button { display: none; }
  .page-content { padding: 18px 14px 34px; }
  .mobile-bottom-nav { position: fixed; z-index: 120; bottom: 0; inset-inline: 0; height: 68px; display: grid; grid-template-columns: repeat(4,1fr); padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid var(--line-soft); background: rgba(255,253,249,.96); backdrop-filter: blur(16px); box-shadow: 0 -8px 24px rgba(49,32,21,.08); }
  .mobile-bottom-nav a, .mobile-bottom-nav button { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 9px; color: #7a6a5e; background: transparent; font-size: 9px; }
  .mobile-bottom-nav a.active { color: var(--copper-dark); background: #f6eadf; }
  .drawer-layer { display: flex; align-items: stretch; justify-content: flex-start; padding: 0; }
  .mobile-drawer { position: relative; z-index: 1; width: min(88vw, 345px); height: 100%; display: flex; flex-direction: column; color: #fff; background: linear-gradient(180deg, #2e2018, #21150f); box-shadow: var(--shadow-pop); animation: drawer-in .22s var(--ease-out); }
  .mobile-drawer .sidebar-inner { min-height: 0; flex: 1; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: max(15px, env(safe-area-inset-top)) 16px 0; }
  .drawer-head span, .drawer-head strong { display: block; }
  .drawer-head span { color: #aa9688; font-size: 9px; }
  .drawer-head strong { margin-top: 2px; font-size: 12px; }
  .drawer-head .icon-button { border-color: rgba(255,255,255,.12); color: #fff; background: rgba(255,255,255,.05); }
  .drawer-language { display: flex; align-items: center; gap: 8px; padding: 12px 24px 18px; color: #bda99c; font-size: 11px; }
  @keyframes drawer-in { from { opacity: .7; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
  .welcome-row { display: block; margin-bottom: 17px; }
  .welcome-row h2 { font-size: 25px; }
  .quick-actions { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-top: 15px; }
  .quick-actions a, .quick-actions button { min-width: 0; min-height: 62px; flex-direction: column; justify-content: center; gap: 4px; padding: 7px 4px; font-size: 9px; }
  .quick-actions strong { position: absolute; }
  .command-grid { gap: 12px; }
  .commitment-card { min-height: 166px; padding: 19px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); gap: 9px; }
  .metric-card { min-height: 79px; padding: 12px; }
  .metric-card strong { font-size: 20px; }
  .content-card, .audit-card { padding: 16px; border-radius: 16px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-heading h2 { font-size: 18px; }
  .filter-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .filter-row label { min-width: 0; }
  .team-table { border: 0; overflow: visible; background: transparent; }
  .team-header { display: none; }
  .team-row:not(.team-header) { grid-template-columns: 1fr 1fr; gap: 9px 12px; margin-bottom: 9px; padding: 13px; border: 1px solid var(--line-soft); border-radius: 13px; background: #fff; }
  .team-row .employee-cell { grid-column: 1 / -1; padding-bottom: 9px; border-bottom: 1px solid #eee5da; }
  .team-row > span[data-label] { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
  .team-row > span[data-label]::before { content: attr(data-label); color: var(--muted-text); font-size: 9px; }
  .timeline-item { grid-template-columns: 52px 1fr; }
  .timeline-item > .status-pill { grid-column: 2; }
  .action-notification { grid-template-columns: auto 1fr; }
  .action-notification button { grid-column: 1 / -1; width: 100%; }
  .detail-topline { margin-bottom: 10px; }
  .task-detail-header { display: block; padding: 18px; }
  .task-title-group { gap: 10px; }
  .task-title-group h2 { font-size: 22px; }
  .task-detail-header > .status-pill { margin-top: 14px; }
  .task-facts { grid-template-columns: 1fr 1fr; padding: 13px 17px; }
  .task-facts > div { align-items: flex-start; padding: 6px 9px; }
  .task-facts > div:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
  .task-facts strong { white-space: normal; }
  .context-message { margin: 14px 17px 0; }
  .task-evidence-grid { grid-template-columns: 1fr; padding: 16px 17px; }
  .task-action-bar { align-items: stretch; flex-direction: column; padding: 14px 17px; }
  .primary-actions .button { width: 100%; }
  .secondary-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .secondary-actions button { justify-content: flex-start; min-height: 40px; background: #f0e8dc; }
  .secondary-actions .problem-action { grid-column: 1 / -1; justify-content: center; background: var(--danger-soft); }
  .action-status { padding: 8px 0; }
  .modal-layer, .user-modal-layer, .drawer-layer { inset: 0; }
  .modal-layer { align-items: flex-end; padding: 0; }
  .action-modal { width: 100%; max-height: calc(100vh - 70px); padding: 18px 16px max(18px, env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
  .users-toolbar { flex-wrap: wrap; }
  .search-box { min-width: 100%; }
  .filter-row.compact { order: 3; grid-template-columns: repeat(3,1fr); overflow-x: auto; }
  .filter-row.compact select { min-width: 100px; }
  .mock-user-head { display: none; }
  .mock-user-row { grid-template-columns: 1fr 1fr; min-height: 118px; }
  .mock-user-row .employee-cell { grid-column: 1 / -1; }
  .user-modal-layer { align-items: stretch; padding: 0; }
  .user-form-sheet { width: 100%; max-height: none; border-radius: 0; }
  .user-form-header { padding: max(16px, env(safe-area-inset-top)) 16px 13px; }
  .user-form-header h2 { font-size: 21px; }
  .form-progress { padding: 8px 16px; }
  .account-form { grid-template-columns: 1fr; gap: 15px; padding: 17px 16px 28px; }
  .user-form-footer { align-items: stretch; flex-direction: column; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); }
  .user-form-footer > div:last-child { display: grid; grid-template-columns: .7fr 1.3fr; }
  .user-form-footer .button { width: 100%; }
}

@media (max-width: 430px) {
  .mobile-brand strong { display: none; }
  .welcome-row h2 { font-size: 23px; }
  .metric-icon { width: 34px; height: 34px; }
  .metric-card { gap: 9px; }
  .metric-card span { font-size: 9.5px; }
  .quiet-badge { width: 100%; justify-content: center; }
  .personal-task { align-items: flex-start; }
  .task-trailing { flex-direction: column; align-items: flex-end; }
  .task-facts { grid-template-columns: 1fr; }
  .task-facts > div { border-inline-start: 0; padding-inline: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .redesign-root *, .redesign-root *::before, .redesign-root *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.icon { width: 1.15em; height: 1.15em; display: inline-block; flex: 0 0 auto; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
