:root {
  font-family: "Cairo", system-ui, sans-serif;
  font-weight: 400;
  --allura-orange: #F39C1E;
  --allura-navy: #14213B;
  color: #1c212c;
  background: #f8f7f4;
  --ink: #1c212c;
  --muted: #4f596c;
  --line: #e1e4e9;
  --primary: var(--allura-navy);
  --deep: #1b2538;
  --soft: #ece9e3;
  --gold: #edb360;
  --white: #fff;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font: inherit; }
button {
  min-height: 42px; padding: 8px 16px; color: #fff; background: var(--primary);
  border: 1px solid transparent; border-radius: 12px; font-weight: 700; cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
button:hover { background: var(--deep); }
button.secondary { color: var(--deep); background: #ece9e3; border-color: var(--line); }
button.secondary:hover { background: #ece9e3; }
button.danger { color: #fff; background: #a03542; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 3px solid #b66a22; outline-offset: 3px; }
[hidden] { display: none !important; }

.app-header {
  position: sticky; inset-block-start: 0; z-index: 8;
  background: #E4F3E8;
}
.header-top {
  min-height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  background: var(--white); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px;
  background: #ece9e3; color: var(--deep); font: 800 21px/1 system-ui, sans-serif;
}
.brand img { width: auto; height: 44px; max-width: 115px; object-fit: contain; }
.brand strong { display: block; font: 800 17px/1.2 system-ui, sans-serif; letter-spacing: .03em; }
.brand small { display: block; margin-block-start: 4px; color: var(--muted); font-size: 11px; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.header-actions button { min-height: 37px; padding: 6px 11px; font-size: 12px; }
nav:empty { display: none; }
nav {
  display: flex; gap: 6px; max-width: 1240px; margin-inline: auto;
  padding: 7px 15px; overflow-x: auto; scrollbar-width: thin;
  background: #fff; border-bottom: 1px solid var(--line);
}
nav button {
  position: relative; display: inline-flex; align-items: center;
  justify-content: center; flex: 0 0 auto; gap: 6px; min-height: 44px;
  padding: 7px 12px; border-radius: 10px; white-space: nowrap;
  background: transparent; color: #4f596c; font-size: 13px;
}
nav button.active, nav button:hover { background: var(--soft); color: #1d2b45; }
nav button svg { flex: none; }
.header-actions .notice-bell { position: relative; display: inline-grid; place-items: center; width: 39px; padding: 0; flex: none; }
.notice-bell[aria-current="page"] { border-color: #78a88a; }
.notice-count { position: absolute; inset-block-start: -5px; inset-inline-end: -5px; min-width: 17px;
  padding: 0 3px; line-height: 17px; border-radius: 20px; background: #a33245; color: #fff; text-align: center; font-size: 10px; }

main { max-width: 1240px; margin-inline: auto; padding: 18px 15px calc(24px + env(safe-area-inset-bottom)); }
h1, h2, h3, p { margin-block-start: 0; }
h1 { font-size: clamp(23px, 3vw, 36px); line-height: 1.4; margin-block-end: 6px; }
h2 { margin-block: 0 10px; font-size: 20px; }
h3 { margin-block: 0 6px; font-size: 16px; }
.page-head { margin-block-end: 16px; }
.page-head .actions { margin: 0; }
.page-head p { margin-block-end: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px; }

.welcome {
  position: relative; isolation: isolate; overflow: hidden; margin-block-end: 15px;
  padding: clamp(18px, 4vw, 38px); border-radius: 22px; color: #fff;
  background: linear-gradient(118deg, #1b2a48, #1d293f 60%, #1b2537);
  box-shadow: 0 12px 26px #1c263821;
}
.welcome::after {
  content: ""; position: absolute; z-index: -1; inset-inline-end: -45px; inset-block-end: -110px;
  width: 310px; aspect-ratio: 1; border: 1px solid #ffffff26; border-radius: 50%;
  box-shadow: 0 0 0 30px #ffffff0a, 0 0 0 62px #ffffff0b, 0 0 0 93px #ffffff07;
}
.welcome .welcome-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: #ece9e3; margin-block-end: 13px; font-size: 13px; }
.welcome-meta span, .task-meta span { display: inline-flex; align-items: center; gap: 5px; }
.welcome p { margin-block-end: 0; color: #ece9e3; }
.welcome .actions { margin: 0; }
.welcome button.primary-create { background: var(--gold); color: #232831; }
.welcome button.primary-create:hover { background: #f5c782; }
.welcome .welcome-link { background: #ffffff13; color: #fff; border-color: #ffffff45; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat, .card { border: 1px solid var(--line); background: #fff; border-radius: 16px; box-shadow: 0 3px 12px #1b253807; }
.stat { padding: 13px; }
.stat b { display: block; font-size: 24px; line-height: 1.35; }
.stat small, .muted { color: var(--muted); font-size: 13px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-icon, .task-icon, .empty-icon {
  width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none;
  background: #ece9e3; color: #283755; border-radius: 11px;
}
.stat-icon.gold { background: #fbefdc; color: #89530f; }
.stat-icon.rose { background: #fce9ed; color: #9b3444; }
.stat-icon.blue { background: #e9effa; color: #31558b; }
.card { margin-block: 9px; padding: 15px; min-width: 0; }
.section-title { margin-block: 20px 7px; }
.section-title h2 { margin: 0; }
.task { cursor: pointer; }
.task:hover { border-color: #aab2c2; box-shadow: 0 5px 17px #1b253813; }
.task-top { display: flex; align-items: flex-start; gap: 10px; }
.task-title { flex: 1; min-width: 0; overflow-wrap: anywhere; margin: 2px 0 0; }
.task p { margin: 8px 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.task .task-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-meta { border-top: 1px solid #ece9e3; padding-top: 9px; margin-top: 10px; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 8px; background: #ece9e3; color: #202f4d; font-size: 11px; font-weight: 700; }
.badge.late { background: #fae7ec; color: #92293d; }
.badge.warning { background: #f9eddc; color: #795018; }
.badge.done { background: #ece9e3; color: #1f3153; }
.badge.working { background: #e7effb; color: #284f86; }
.filterbar { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(100px, .55fr); }
.filterbar label { margin: 0; }
.filterbar input, .filterbar select { margin-block-start: 3px; }
.empty { display: grid; place-items: center; gap: 7px; padding: 32px 14px; color: var(--muted); text-align: center; border: 1px dashed #cacfd8; border-radius: 16px; background: #ffffff75; }

label { display: block; margin-block: 10px 5px; font-weight: 700; }
input:not([type=checkbox]), select, textarea {
  width: 100%; min-width: 0; min-height: 43px; padding: 8px 11px; border-radius: 10px;
  color: var(--ink); border: 1px solid #cacfd9; background: #fff; font-size: 16px;
}
textarea { min-height: 88px; resize: vertical; }
label.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
input[type=checkbox] { width: 19px; height: 19px; margin-block-start: 4px; accent-color: var(--primary); }
dialog {
  position: static; width: min(100%, 875px); max-height: none; margin: 0 auto; padding: clamp(12px, 2vw, 20px);
  border: 1px solid #c7dacd; border-radius: 16px; overflow: visible; color: var(--ink); box-shadow: 0 13px 42px #1421312b;
}
dialog::backdrop { background: #171e2ca6; }
dialog h2 { margin: 0; }
dialog h3 { margin-block-start: 16px; }
dialog form + form { margin-block-start: 13px; }
.event { white-space: pre-wrap; overflow-wrap: anywhere; background: #f8f7f4; border-inline-start: 3px solid #a7b0c1; padding: 9px 12px; margin: 8px 0; border-radius: 7px; }
.attachment { overflow-wrap: anywhere; padding-block: 9px; border-bottom: 1px solid var(--line); }
.error { color: #9c2439; font-size: 14px; margin-block: 6px; }
.error:empty { display: none; }
#toast { position: fixed; inset: auto 12px calc(24px + env(safe-area-inset-bottom)); max-width: 480px; margin-inline: auto; background: var(--deep); color: #fff; padding: 10px 14px; border-radius: 12px; z-index: 12; display: none; }
.login { width: min(100%, 430px); margin: clamp(32px, 9vh, 90px) auto 0; padding: clamp(19px, 5vw, 32px); }
.login form button[type=submit] { width: 100%; margin-block-start: 9px; }
.login .login-icon { margin-block-end: 10px; }
.notice { background: #fff4de; color: #75501a; padding: 9px 12px; border-radius: 10px; }
.stack > * + * { margin-block-start: 12px; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat { padding: 15px; }
}
@media (min-width: 950px) {
  .header-top { padding-inline: 30px; }
  main { padding: 27px 30px 45px; }
  nav { padding-inline: 30px; }
}
@media (max-width: 420px) {
  .header-top { padding-inline: 11px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand strong { font-size: 14px; }
  .brand small { font-size: 10px; }
  .welcome .actions { margin-block-start: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* The same gold and green accents used across the Allura apps. */
:root { background: #f7f7f0; --gold: #efc172; }
.brand img { height: 46px; border-radius: 7px; }
.welcome {
  background: radial-gradient(ellipse at 15% 100%, #50422590, transparent 65%), linear-gradient(118deg, #1c2639, #1f232a 70%, #28261c);
  border-top: 3px solid #dfb46b;
}
button.primary-create { display: inline-flex; align-items: center; gap: 6px; }
.section-title .actions { margin: 0; }
@media (max-width: 420px) {
  .brand img { height: 37px; }
  .header-actions button { padding-inline: 7px; font-size: 11px; }
  nav button { font-size: 12px; padding-inline: 9px; }
}

/* Short, responsive feedback for real changes in the interface. */
:root { font-family: "Cairo", system-ui, sans-serif; }
.brand strong { font-family: "Marcellus", "Cairo", serif; }
.sound-toggle { display: inline-grid; align-items: center; justify-content: center; min-width: 37px; }
.sound-toggle[aria-pressed="true"] { color: #788781; }
.welcome {
  background:
    radial-gradient(ellipse at 9% 10%, #d4a65e36 0%, transparent 42%),
    radial-gradient(ellipse at 92% 105%, #7b879f44 0%, transparent 52%),
    linear-gradient(118deg, #1c2639 0%, #1f232a 62%, #28261c 100%);
}
.welcome .primary-create { box-shadow: 0 5px 16px #efc17225; }
.welcome .primary-create:hover { box-shadow: 0 7px 25px #efc17260; }
nav button.active { box-shadow: inset 0 0 0 1px #cbd0da; }
.task:hover { box-shadow: 0 7px 18px #1b253810, 0 0 0 1px #caad6d45; }
#toast[data-cue="success"] { border-inline-start: 4px solid #9eaac1; box-shadow: 0 5px 22px #2c416a2e; }
#toast[data-cue="notice"] { border-inline-start: 4px solid #efc172; box-shadow: 0 5px 22px #b9944b40; }
@media (max-width: 360px) {
  .brand { gap: 6px; }
  .brand small { display: none; }
  .header-actions { gap: 4px; }
  .sound-toggle { min-width: 31px; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: settle-dialog .19s ease-out; }
  @keyframes settle-dialog { from { opacity: 0; transform: translateY(7px); } }
}

/* Dashboard accents and immediate feedback for interactive controls. */
.welcome {
  border: 1px solid #9c805c80;
  background:
    radial-gradient(ellipse at 90% 115%, #32466e75, transparent 55%),
    radial-gradient(ellipse at 12% 0%, #cc9b5545, transparent 48%),
    linear-gradient(120deg, #2b3549, #252a33 62%, #29271d);
}
.welcome-meta span {
  padding: 4px 9px;
  border: 1px solid #ffffff32;
  border-radius: 99px;
  background: #ffffff12;
}
.dashboard-stat[data-tone="blue"] { --tint: #eff5ff; --accent: #35608d; }
.dashboard-stat[data-tone="rose"] { --tint: #fff1f3; --accent: #9b3444; }
.dashboard-stat[data-tone="gold"] { --tint: #fff6e7; --accent: #8d540d; }
.dashboard-stat[data-tone="green"] { --tint: #ece9e3; --accent: #293a5c; }
button.dashboard-stat {
  text-align: start;
  color: var(--ink);
  background: linear-gradient(145deg, #fff 25%, var(--tint));
  border-block-start: 2px solid var(--accent);
  padding: 13px;
}
.dashboard-stat b { color: var(--accent); }
.dashboard-stat small { display: block; margin-block-start: 5px; }
nav button.active svg { color: #203254; }
nav button.active::after {
  content: "";
  position: absolute;
  inset-block-end: 2px;
  inset-inline-start: calc(50% - 8.5px);
  width: 17px;
  height: 2px;
  border-radius: 10px;
  background: #ba883b;
}
.task[data-status="review"], .task[data-status="blocked"], .task[data-status="done"] { border-inline-start-width: 3px; }
.task[data-status="review"] { border-inline-start-color: #c8984f; }
.task[data-status="blocked"] { border-inline-start-color: #bd697a; }
.task[data-status="done"] { border-inline-start-color: #7886a1; }
@media (hover: hover) {
  button.dashboard-stat:hover { background: var(--tint); border-block-start-color: var(--accent); box-shadow: 0 4px 14px #1b253818; }
}
@media (prefers-reduced-motion: no-preference) {
  button:active:not(:disabled), .task:active { transform: scale(.985); }
}

.home-summary { margin-block: 12px 18px; }
.home-work { margin-block-start: 18px; }
.home-work .empty { padding-block: 16px; }
.home-work-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  max-inline-size: 854px; gap: 16px; align-items: stretch;
}
.home-work-grid > .card {
  display: flex; flex-direction: column; inline-size: 100%; min-inline-size: 0; max-inline-size: 100%;
  margin: 0; padding: 12px; aspect-ratio: 1; overflow-wrap: anywhere;
}
.home-work-grid .board-card-icon { background: #fff5e4; border-color: #edc68e; }
.home-work-grid .board-task-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.home-work-grid .board-card-actions { margin-block-start: auto; }
.operations-grid { max-inline-size: none; grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr)); }
.operations-grid > .operations-card {
  text-align: start; align-items: flex-start; justify-content: center; gap: 7px;
  aspect-ratio: auto; min-height: 122px; background: #fff; color: var(--ink); font-size: 1rem;
}
.operations-card .board-task-title { font-weight: 800; }
.operations-card .muted { font-weight: 500; }
.operations-grid > .operations-card:hover { background: #f3f8f4; border-color: #a4c6aa; }
.operations-heading { margin-block: 4px 12px; }
.operations-heading h2 { margin: 0; }
@media (max-width: 580px) {
  .home-work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-work-grid > .card { padding: 9px; }
}

body.editor-open #screen, body.editor-open nav { display: none; }
body.editor-open main { padding-block-end: 25px; }
.editor-heading { padding-block-end: 8px; margin-block-end: 9px; border-block-end: 1px solid #dce8df; }
.editor-heading h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: clamp(21px, 3vw, 27.2px); }
dialog.task-detail-dialog { width: min(100%, 1000px); padding: clamp(12px, 2vw, 20px); }
.task-detail-dialog .editor-heading { margin-block-end: 8px; padding-block-end: 8px; }
.task-detail-tabs, .task-detail-actions, .task-detail-pagination { display: flex; flex-wrap: wrap; gap: 6px; }
.task-detail-tabs { margin-block-end: 12px; }
dialog button { min-height: 38px; padding: 5px 11px; }
.task-detail-tabs button[aria-pressed="true"] { background: #dcefdc; border-color: #a4c6aa; color: #234733; }
.task-detail-overview { display: grid; gap: 12px; align-items: start; }
.task-detail-text h3 { margin: 5px 0 2px; font-size: .92rem; }
.task-detail-text p { margin-block-end: 5px; }
.task-detail-text .event { padding: 6px 9px; margin: 0; overflow-wrap: anywhere; }
.task-detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; gap: 6px; }
.task-detail-meta div { padding: 6px 8px; border-radius: 9px; background: #eff4ef; min-width: 0; overflow-wrap: anywhere; }
.task-detail-meta dt { font-size: .75rem; color: var(--muted); }
.task-detail-meta dd { margin: 0; font-size: .89rem; font-weight: 700; }
.task-detail-actions { margin: 9px 0 0; }
.task-photo-grid { display: flex; flex-wrap: wrap; gap: 7px; margin-block-start: 8px; }
button.task-photo {
  display: grid; justify-items: center; align-content: center; inline-size: 104px;
  gap: 3px; min-height: 58px; padding: 4px; color: #234733; background: #f2f7f2; border: 1px solid #bcd4c1;
}
.task-photo img { display: block; inline-size: 100%; block-size: 45px; border-radius: 5px; object-fit: cover; }
.task-photo img:not([hidden]) + span { display: none; }
.task-photo .photo-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
.task-detail-files { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 8px; }
.task-detail-files .attachment { border: 1px solid var(--line); border-radius: 9px; padding: 7px; }
.task-detail-files .attachment .actions { margin-block: 5px 0; }
.task-detail-attach { margin-block-start: 9px; }
.task-detail-pagination { align-items: center; justify-content: center; margin-block: 8px; }
.task-image-view { display: grid; place-items: center; min-height: 100px; margin-block-end: 8px; border-radius: 9px; background: #eff4ef; }
.task-image-view img { display: block; max-inline-size: 100%; max-block-size: min(55dvh, 680px); object-fit: contain; }
@media (min-width: 680px) {
  .task-detail-overview { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
dialog form { display: grid; gap: 8px 14px; }
dialog form > * { min-width: 0; margin-block: 0; }
dialog :is(input:not([type="checkbox"]), select) { min-height: 38px; padding-block: 5px; }
.dialog-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 4px 7px; }
.dialog-choices > label { margin: 2px 0; }
dialog label:not(.check) > :is(input, select, textarea) { display: block; margin-block-start: 3px; }
dialog label.result-attachment { grid-column: 1 / -1; padding: 9px 11px; border: 1px dashed #a2bba8; border-radius: 10px; }
.result-attachment input[type="file"] { margin-block: 5px; }
.result-attachment .muted { display: block; font-weight: 400; }
dialog textarea { min-height: 58px; }
dialog form > :is(details, button, .error, label:has(textarea)) { grid-column: 1 / -1; }
dialog details { border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; margin-block: 5px; }
dialog details summary { cursor: pointer; color: var(--deep); font-weight: 800; }
dialog details[open] summary { margin-block-end: 10px; }
@media (min-width: 600px) {
  dialog form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dialog form > button { justify-self: end; min-width: 120px; }
}
h1 { font-weight: 700; line-height: 1.35; }
button { font-weight: 800; }
h1 { font-size: clamp(23px, 3vw, 30.4px); }
h2 { font-size: clamp(19px, 2.6vw, 27.2px); }
h3 { font-size: 16.8px; }

input:not([type=checkbox]), textarea, select { font-weight: 400; }
h1, h2, h3 { font-weight: 700; }
button { font-weight: 800; }
.welcome button.primary-create, button.primary-create,
form button[type="submit"]:not(.secondary):not(.danger) {
  background: var(--allura-orange);
  color: var(--allura-navy);
}
.welcome button.primary-create:hover, button.primary-create:hover,
form button[type="submit"]:not(.secondary):not(.danger):hover {
  background: #FFB447;
}
nav button.active::after { background: var(--allura-orange); }

body { background: #f8f7f4; }
.header-top { background: #E4F3E8; border-bottom-color: #C6E2CE; }
.welcome {
  color: #183B2B;
  background: linear-gradient(120deg, #EDF8EF, #D1EBD9);
  border-color: #B7DCC4;
}
.welcome .welcome-meta, .welcome p { color: #315742; }
.welcome-meta span, .welcome .welcome-link {
  background: #F6FCF8;
  border-color: #B7DCC4;
  color: #234733;
}
.welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: clamp(13px, 2.5vw, 23px); border-radius: 16px;
}
.welcome-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.welcome-person > div { min-width: 0; }
.welcome-avatar {
  display: grid; place-items: center; flex: 0 0 42px; height: 42px;
  border: 1px solid #b7d7be; border-radius: 50%; background: #f6fcf8; color: #2d6948;
}
.welcome-person h1 { margin: 0 0 5px; font-size: clamp(1.05rem, 2.4vw, 1.58rem); overflow-wrap: anywhere; }
.welcome .welcome-meta { margin: 0; gap: 4px 9px; font-size: .8rem; }
.welcome-meta span { padding: 2px 7px; }
nav button.active, nav button:hover { background: #E4F3E8; color: #234733; }
nav button.active svg { color: #2D6948; }



.manager-board { margin-block: 16px; }
.manager-board .dashboard-stats, .home-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-stat[data-tone="purple"] { --accent: #592987; --tint: #f1e8fb; }
.badge.blocked { color: #873b10; background: #fff0d9; }
.badge.review, .stat-icon.purple { color: #592987; background: #f1e8fb; }
.badge.done { color: #1e6034; background: #def4e4; }
.task[data-status="blocked"] { border-inline-start-color: #ce752a; }
.task[data-status="review"] { border-inline-start-color: #8058ac; }
.task[data-status="done"] { border-inline-start-color: #3c8e58; }
.task[data-late="true"] { border-inline-start: 4px solid #b6374d; background: #fff7f8; }
.floating-task.primary-create { display: none; }
.app-active:not(.editor-open) .floating-task {
  display: inline-flex;
  position: fixed;
  z-index: 9;
  inset-inline-end: max(16px, env(safe-area-inset-left));
  inset-block-end: calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 5px 22px #14213b33;
}
.app-active:not(.editor-open) main { padding-block-end: calc(80px + env(safe-area-inset-bottom)); }
.app-active:not(.editor-open) #toast { inset-block-end: calc(72px + env(safe-area-inset-bottom)); }
.manager-board .dashboard-stat[data-tone="green"] { --accent: #1e6034; --tint: #e9f6ed; }
.manager-board .stat-icon.green { color: #1e6034; background: #def4e4; }
@media (max-width: 450px) {
  .manager-board .dashboard-stat, .home-summary .dashboard-stat { padding: 8px; }
  .manager-board .stat-icon, .home-summary .stat-icon { display: none; }
}

button.refresh-icon, button.share-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  flex: none;
}
.welcome .actions { align-items: center; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 238px), 1fr));
  gap: 18px;
}
.settings-grid > .card {
  display: flex;
  flex-direction: column;
  aspect-ratio: 1;
  min-inline-size: 0;
  margin: 0;
  padding: clamp(16px, 2vw, 24px);
  border-color: #cbded0;
  border-radius: 18px;
  overflow-wrap: anywhere;
}
.settings-grid > .settings-tile {
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  font-size: 1.13rem;
  background: #fff;
  color: #234733;
}
.settings-grid > .settings-tile:hover:not(:disabled) {
  background: #edf7ef;
  border-color: #9bbca2;
}
.settings-card-icon {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 48px;
  block-size: 48px;
  border: 1px solid #c4ddcb;
  border-radius: 14px;
  background: #e9f4eb;
  color: #315a45;
}
.settings-tile .settings-card-icon { inline-size: 58px; block-size: 58px; }
.settings-heading { gap: 8px; margin-block: 4px 16px; }
.settings-heading h2, .settings-record h3, .settings-record p { margin: 0; }
.settings-record { align-items: flex-start; gap: 10px; }
.settings-card-top {
  display: flex;
  inline-size: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.settings-record-details { display: grid; gap: 3px; }
.settings-record-details h3 { font-size: 1.1rem; }
.settings-record-details p { line-height: 1.45; }
.settings-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  inline-size: 100%;
  margin-block-start: auto;
}
.settings-actions button {
  padding: 5px 6px;
  line-height: 1.35;
  font-size: .84rem;
}
.settings-actions button:only-child { grid-column: 1 / -1; }
@media (max-width: 540px) {
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
    max-inline-size: 360px;
    margin-inline: auto;
    gap: 14px;
  }
}

.task-filters, .report-filters { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.task-display, .task-statuses { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 8px; }
.task-display button, .task-statuses button { min-height: 35px; padding: 4px 10px; font-size: .84rem; }
.task-display button[aria-pressed="true"], .task-statuses button[aria-pressed="true"] {
  color: #234733; background: #dcefdc; border-color: #9bbca2;
}
.quick-count { margin-block: 8px; color: #43594a; font-size: .82rem; }
.quick-results { display: grid; gap: 7px; }
.quick-results > .card { margin: 0; }
button.quick-task {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-align: start; color: var(--ink); padding: 7px 11px; width: 100%;
}
.quick-task:hover { background: #f0f7f1; }
.quick-task-main { display: grid; min-width: 0; overflow-wrap: anywhere; }
.quick-task-main small { color: var(--muted); font-weight: 500; font-size: .78rem; }

.reports { display: grid; gap: 16px; }
.report-filters { display: grid; gap: 8px; margin: 0; }
.report-filters label { margin: 0; }
.reports h3, .reports h4 { color: #234733; margin-block: 0 6px; }
.report-metrics, .report-branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 8px; }
.report-metric { margin: 0; display: grid; gap: 4px; border-block-start: 3px solid var(--report-tone, #6f9b7f); }
.report-metric[data-tone="blue"] { --report-tone: #7da3c7; }
.report-metric[data-tone="gold"] { --report-tone: #d6a447; }
.report-metric[data-tone="purple"] { --report-tone: #a18ac0; }
.report-metric strong, .report-rate strong { font-size: 1.55rem; color: #234733; }
.report-metric > span:last-child, .report-branch dt { color: var(--muted); font-size: .85rem; }
.report-rate { margin-block-end: 0; }
.report-rate h3, .report-rate p { margin: 0; }
.report-rate progress { width: 100%; height: 14px; accent-color: #4c805c; }
.report-branches { grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); }
.report-branch, .report-branch dl { margin: 0; }
.report-branch dl > div { display: flex; justify-content: space-between; padding: 4px 0; border-block-end: 1px solid var(--line); }
.report-branch dl > div:last-child { border: 0; }
.report-branch dd { margin: 0; font-weight: 700; }
@media (max-width: 450px) {
  .task-filters, .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-filters label:first-child { grid-column: 1 / -1; }
  .welcome-avatar { flex-basis: 34px; height: 34px; }
}

.task-views { display: flex; flex-wrap: wrap; gap: 6px; margin-block-end: 12px; padding: 0; background: transparent; border: 0; }
.task-views [aria-pressed="true"] { background: #e4f3e8; border-color: #78a88a; color: #234733; }
.my-board, .handover-sections {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr);
  align-items: start; gap: 10px; overflow-x: auto; padding: 4px 4px 12px;
}
.my-board { grid-auto-columns: minmax(208px, 1fr); align-items: stretch; }
.board-lane {
  min-block-size: clamp(300px, 55vh, 480px); min-width: 0;
  background: #eff4ef; border: 1px solid #d5e1d6; border-radius: 14px; padding: 10px;
}
.board-lane > h2, .board-lane summary { margin: 0; color: #234733; font-size: 1rem; font-weight: 800; }
.board-lane summary { cursor: pointer; }
.board-lane details + details { margin-block-start: 10px; }
.board-count { margin-inline-start: 6px; font-size: .85em; color: #43594a; }
.board-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-block-start: 8px; }
.board-grid > .card { min-width: 0; margin: 0; }
.board-card { display: grid; gap: 8px; padding: 11px; border-color: #d1ddd3; cursor: pointer; }
.board-card[draggable="true"] { cursor: grab; }
.board-card-heading { display: flex; align-items: flex-start; gap: 8px; }
.board-card-icon {
  display: grid; flex: 0 0 30px; block-size: 30px; place-items: center;
  color: #315a45; background: #e9f4eb; border: 1px solid #cce1d0; border-radius: 50%;
}
.board-task-title { margin: 0; line-height: 1.45; color: #1d3528; overflow-wrap: anywhere; }
.board-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.board-description {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  margin: 0; color: var(--muted); font-size: .83rem; line-height: 1.55; overflow-wrap: anywhere;
}
.board-due {
  display: flex; align-items: flex-start; gap: 5px; padding: 5px 7px; border-radius: 8px;
  background: #f6f7f3; font-size: .73rem; color: var(--muted);
}
.board-due svg { flex: none; margin-block-start: 3px; }
.board-due strong { display: block; color: var(--ink); }
.board-card-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.board-card-actions > * { flex: 1 1 70px; }
.board-card-actions button, .board-card-actions select { min-height: 36px; padding: 4px 7px; font-size: .79rem; }
.board-card-actions select { width: 0; }
button.board-details { background: #dcefdc; border-color: #bfdac2; color: #234733; }
button.board-details:hover { background: #cde7d0; }
button.board-receive { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 4px 7px; background: #2f6548; font-size: .83rem; }
button.board-receive:hover { background: #245038; }
.board-lane [data-more-tasks] { margin-block-start: 8px; }
.board-lane[data-drop-lane] { background: #e1f1e5; border-color: #438259; box-shadow: inset 0 0 0 1px #438259; }
.handover-sections { grid-auto-columns: minmax(250px, 1fr); }
.handover-section { min-width: 0; background: #eff4ef; border: 1px solid #d5e1d6; border-radius: 14px; padding: 10px; }
.handover-request { margin-block-end: 10px; }
.handover-request > .card { margin-block-end: 4px; }
.handover-request > p { margin: 0; padding-inline: 8px; }

/* Allura surfaces and controls */
:root {
  --forest: #123f32;
  --forest-deep: #0c3026;
  --forest-soft: #e7f1eb;
  --ink: #192e26;
  --muted: #4d6359;
  --line: #e5dac7;
  --deep: var(--forest-deep);
  --primary: var(--forest);
  color: var(--ink);
  background: #fbf3e4;
}
body { background: #fbf3e4; }
.app-header {
  background: #fffdf8;
  border-block-end: 1px solid var(--line);
  box-shadow: 0 4px 20px #133b2910;
}
.header-top {
  background: #fff;
  color: #203c32;
  border-bottom-color: #deded8;
}
.header-top .brand img { background: #fff; border-radius: 8px; padding: 3px; }
.brand strong { font-size: clamp(1rem, 2.4vw, 1.45rem); }
.brand small { color: #52665d; font-size: .75rem; }
.header-actions button.secondary {
  color: #264939; background: #faf5eb; border-color: #e5dac7;
}
.header-actions button.secondary:hover { background: #f5ead6; }
.header-actions .sound-toggle[aria-pressed="true"] { color: #506259; }
.header-actions .notice-bell[aria-current="page"] { border-color: var(--allura-orange); }
#nav { background: transparent; border: 0; }
#nav button { font-size: .875rem; color: #315647; }
#nav button.active { background: var(--forest); color: white; box-shadow: none; }
#nav button.active svg { color: #ffd697; }
#nav button:not(.active):hover { background: var(--forest-soft); }
button:not(.secondary, .danger, .card, .stat):not(nav button) {
  background: var(--allura-orange);
  color: var(--allura-navy);
}
button:not(.secondary, .danger, .card, .stat):not(nav button):hover:not(:disabled) {
  background: #ffb344;
  box-shadow: 0 4px 16px #c7731730;
}
button.secondary { color: var(--forest-deep); background: #faf4e8; }
button.secondary:hover:not(:disabled) { background: #f4e7d0; }
:is(input, select, textarea):focus-visible {
  outline: 2px solid #39785e;
  outline-offset: 2px;
}
:focus-visible { outline-color: #bf6814; }
.header-actions :focus-visible, #nav .active:focus-visible { outline-color: #f5ae46; }
.card, .stat { box-shadow: 0 3px 12px #103c2909; }
.task:hover, .board-card:hover, .settings-grid > .settings-tile:hover:not(:disabled) {
  border-color: #92b8a3;
  box-shadow: 0 5px 20px #153d2915;
}
.badge { font-size: .75rem; }
.board-lane, .handover-section { background: #f7eedf; border-color: #e5dac7; }
.page-head, .settings-heading { padding-block-end: 10px; border-block-end: 1px solid var(--line); }
.page-head h1 { margin: 0; }
.brand-panel, .welcome {
  color: #fff;
  background: radial-gradient(ellipse at 8% 130%, #367b576d, transparent 65%), linear-gradient(115deg, #165140, var(--forest-deep));
  border: 1px solid #285f4c;
  box-shadow: 0 8px 24px #103c291a;
}
.welcome { padding: clamp(16px, 3vw, 30px); }
.welcome::after { content: none; }
.welcome .welcome-meta, .welcome p { color: #e2f3e9; }
.welcome-meta span, .welcome-avatar, .brand-panel button.secondary, .welcome button.secondary {
  background: #ffffff14; border-color: #ffffff40; color: #f6fffa;
}
.brand-panel button.secondary:hover:not(:disabled), .welcome button.secondary:hover:not(:disabled) { background: #ffffff29; }

.operations-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  border-radius: 19px; margin-block-end: 18px; padding: clamp(16px, 3vw, 30px);
}
.operations-banner h1, .operations-banner p, .operations-banner .actions { margin: 0; }
.operations-banner p, .operation-parent { color: #d8ede0; }
.operation-parent { font-size: .85rem; }
.operations-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.operations-grid > .operations-card {
  justify-content: flex-start; gap: 5px; padding: clamp(12px, 2vw, 21px);
  border-radius: 17px; min-block-size: 148px;
}
.operations-grid > .operations-card:hover { background: #f5faf6; }
.operations-grid > .operations-featured { grid-column: span 2; background: #e5f1e9; border-color: #aecbb9; }
.operations-grid > [data-ops="exceptions"] { background: #fff6e8; border-color: #ebd2ac; }
.operation-card-top {
  display: flex; justify-content: space-between; align-items: center; gap: 4px;
  width: 100%; margin-block-end: 5px;
}
.operations-card .board-card-icon {
  flex-basis: 42px; block-size: 42px; border-radius: 12px;
  background: #eaf3ed; border-color: #c1dacb; color: var(--forest);
}
.operations-card[data-ops="exceptions"] .board-card-icon, .operation-count {
  background: #ffe6be; color: #713c0d; border-color: #eac48c;
}
.operation-count { border-radius: 999px; padding: 4px 8px; font-size: .78rem; }
.operations-card .muted { line-height: 1.6; }
.operations-content > button { margin-block-end: 5px; }
.operations-content > article { border-inline-start: 3px solid #a8c9b5; }

.reports { gap: 19px; }
.report-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; padding: 15px; }
.report-filters h2 { grid-column: 1 / -1; font-size: 1rem; margin: 0; }
.report-overview > h2, .report-branch-section > h2 { font-size: 1.2rem; }
.report-metrics { gap: 10px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.report-metric { padding: clamp(10px, 2vw, 19px); gap: 6px; border-radius: 14px; }
.report-metric strong { font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.2; }
.report-rate { padding: clamp(14px, 2vw, 24px); }
.report-rate h3, .report-rate strong { color: #fff; }
.report-rate strong { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.report-rate p { color: #dcefe3; font-size: .85rem; }
.report-rate progress {
  display: block; height: 10px; margin-block-start: 12px;
  border: 0; border-radius: 6px; overflow: hidden; background: #ffffff30; accent-color: var(--allura-orange);
}
.report-rate progress::-webkit-progress-bar { background: #ffffff30; }
.report-rate progress::-webkit-progress-value { background: var(--allura-orange); border-radius: 6px; }
.report-rate progress::-moz-progress-bar { background: var(--allura-orange); border-radius: 6px; }
.report-branches { gap: 12px; }
.report-branch h3 { display: flex; align-items: center; gap: 7px; color: var(--forest); }
.report-branch dl > div { padding-block: 6px; }

#toast[data-cue="received"], #toast[data-cue="celebration"] {
  border-inline-start: 4px solid var(--allura-orange);
  background: var(--forest-deep);
  box-shadow: 0 7px 24px #0c302644;
}
.toast-check {
  display: inline-grid; place-items: center; vertical-align: middle;
  width: 25px; height: 25px; margin-inline-end: 8px;
  border-radius: 50%; background: #dcefe3; color: var(--forest-deep);
}
#toast[data-cue="celebration"] .toast-check { background: #ffce82; }
.task-celebration {
  position: absolute; inset-inline-start: 26px; inset-block-start: 4px; pointer-events: none;
}
.task-celebration i {
  position: absolute; width: 7px; height: 7px; border-radius: 2px;
  background: #f39c1e; box-shadow: 0 0 9px #f39c1e88;
  animation: allura-spark .65s ease-out both;
}
.task-celebration i:nth-child(even) { background: #69bc8a; box-shadow: 0 0 8px #55a87688; border-radius: 50%; }
@keyframes allura-spark {
  0% { transform: translate(0, 0) scale(.3); opacity: .4; }
  22% { opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) rotate(var(--turn)) scale(.65); opacity: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  #toast:is([data-cue="received"], [data-cue="celebration"]) .toast-check { animation: allura-confirm .26s ease-out; }
  @keyframes allura-confirm { from { transform: scale(.65); opacity: .55; } }
}
@media (max-width: 740px) {
  .operations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-grid > .operations-featured { grid-column: auto; }
  .report-metrics { grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); }
}
@media (max-width: 560px) {
  .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filters label:last-child { grid-column: 1 / -1; }
}

.settings-sections .board-card-icon { inline-size:42px; flex:none; }
.settings-sections .settings-actions { align-self:stretch; }
@media(max-width:600px){.settings-sections:has(.settings-record){grid-template-columns:1fr}}

.brand strong.arabic-brand{font-family:"Cairo",sans-serif;font-weight:800;letter-spacing:normal;color:#164c38;white-space:nowrap}.brand .arabic-brand span{color:#a55412}

.login-brand-mark { display: none; }
body:not(.app-active) .header-top .brand img { display: none; }
body:not(.app-active):has(.login-entry) { background: #fbf3e4; }
body:not(.app-active) .login-brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  height: 42px;
  border-radius: 11px;
  background: #105136;
  color: white;
  font: 800 29px/1 system-ui, sans-serif;
}
.login-brand-mark span {
  position: absolute;
  inset-inline-end: 5px;
  bottom: 4px;
  color: #f39c1e;
  font-size: 22px;
}
.login-entry {
  margin-block-start: clamp(12px, 4vh, 36px);
  background: white;
  box-shadow: 0 8px 24px #60471815;
}
.login-entry h1 { margin-block: 0 16px; text-align: center; }
.login-entry input { min-height: 44px; font-size: 16px; }
.login-entry .error:empty { display: none; }

.board-empty { display: none; }
@media (min-width: 900px) {
  .my-board {
    grid-auto-columns: minmax(160px, 1fr);
    gap: 14px;
  }
  .my-board .board-lane {
    min-block-size: 245px;
    background: white;
    border-color: #cfb89a;
  }
  .my-board .board-lane[data-drop-lane] {
    background: #e1f1e5;
    border-color: #438259;
  }
  .board-lane > h2, .board-lane summary {
    background: var(--lane-heading, #e2f2e7);
    padding: 6px 9px;
    border-radius: 8px;
  }
  .board-lane[data-board-lane="new"] { --lane-heading: #e4effa; }
  .board-lane[data-board-lane="working"] { --lane-heading: #faebcd; }
  .board-lane[data-board-lane="followup"] { --lane-heading: #eee6f7; }
  .board-lane[data-board-lane="review"] { --lane-heading: #dcefe9; }
  .board-empty { display: block; text-align: center; color: var(--muted); margin-block: 30px; }
  .task-filters { border-color: #cfb89a; }
}
.task-celebration i { animation-duration: 1.05s; }
@media (prefers-reduced-motion: no-preference) {
  #toast[data-cue="celebration"] { animation: allura-celebration-glow .9s ease-out; }
  @keyframes allura-celebration-glow {
    30% { box-shadow: 0 0 0 7px #f39c1e55, 0 8px 32px #18583f77; }
  }
}

@media (max-width: 899px) {
  .my-board { gap: 12px; }
  .my-board .board-lane {
    min-block-size: 220px;
    background: white;
    border-color: #cfb89a;
  }
  .my-board .board-lane[data-drop-lane] {
    background: #e1f1e5;
    border-color: #438259;
  }
  .board-lane > h2, .board-lane summary {
    background: var(--lane-heading, #e2f2e7);
    padding: 6px 9px;
    border-radius: 8px;
  }
  .board-lane[data-board-lane="new"] { --lane-heading: #e4effa; }
  .board-lane[data-board-lane="working"] { --lane-heading: #faebcd; }
  .board-lane[data-board-lane="followup"] { --lane-heading: #eee6f7; }
  .board-lane[data-board-lane="review"] { --lane-heading: #dcefe9; }
  .board-empty { display: block; text-align: center; color: var(--muted); margin-block: 24px; }
  .task-filters { border-color: #cfb89a; }
}


/* --- Fixes (Nov 2026) --- */
/* Reserve the scrollbar space so the header doesn't jump sideways between long and short pages. */
html { scrollbar-gutter: stable; }

/* Dashboard counters: larger Latin digits so a zero isn't read as a dot. */
.stat-number { font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; }

/* Task board: make the sideways scroll obvious and comfortable. */
.my-board, .handover-sections {
  scroll-snap-type: x proximity; scrollbar-width: auto; scrollbar-color: #9bb8a4 transparent;
}
.my-board .board-lane, .handover-sections > * { scroll-snap-align: start; }
@media (min-width: 1200px) {
  .my-board { grid-auto-columns: minmax(150px, 1fr); gap: 10px; }
}
.board-scroll-hint {
  display: none; margin: 0 0 6px; font-size: .85rem; color: var(--muted, #6b6b6b);
}
.board-scroll-hint.visible { display: block; }

/* --- New app logo (Nov 2026): progress-ring icon, "allura" on top and "تاسكي" under it, right-aligned --- */
body .header-top .brand { gap: 10px; align-items: center; }
body .header-top .brand img.app-mark {
  display: block; width: 46px; height: 46px; max-width: none; padding: 0; background: none; border-radius: 12px; flex: 0 0 auto;
}
.header-top .brand .app-wordmark {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  height: 46px; gap: 0; margin: 0; letter-spacing: 0;
}
.header-top .brand .app-wordmark bdi {
  font: 800 25px/1 "Plus Jakarta Sans", system-ui, sans-serif; letter-spacing: -.03em; color: #1a2b27;
}
.header-top .brand .app-wordmark span {
  font: 800 18px/1.1 "Cairo", sans-serif; color: #c66b00; margin-top: 1px;
}
@media (max-width: 520px) {
  body .header-top .brand img.app-mark { width: 40px; height: 40px; border-radius: 10px; }
  .header-top .brand .app-wordmark { height: 40px; }
  .header-top .brand .app-wordmark bdi { font-size: 21px; }
  .header-top .brand .app-wordmark span { font-size: 15px; }
}

/* Task calendar */
.task-calendar { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 14px; align-items: start; }
.cal-month { padding: 12px; display: grid; gap: 8px; }
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal-head h2 { flex: 1; margin: 0; text-align: center; font-size: 1.05rem; }
.cal-head h2 small { display: block; color: var(--muted); font-weight: 500; font-size: .75rem; }
.cal-head button { min-height: 36px; width: 40px; padding: 0; font-size: 1.3rem; line-height: 1; }
.task-calendar .cal-back-today { justify-self: center; min-height: 30px; padding: 2px 12px; font-size: .8rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-weekday { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 2px 0; }
.task-calendar button.cal-day { min-height: 48px; padding: 4px 0; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #fff; border: 1px solid var(--line); color: var(--deep); box-shadow: none; }
.task-calendar button.cal-day:hover { background: #f4f1ea; }
.cal-blank { min-height: 48px; }
.cal-num { font-size: .95rem; font-weight: 700; }
.task-calendar .cal-past { color: #9aa1ad; background: #fafafa; }
.cal-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: .68rem; line-height: 18px; font-weight: 700; background: var(--allura-navy); color: #fff; }
.cal-zero { visibility: hidden; }
.cal-late .cal-count { background: #b6374d; }
.task-calendar button.cal-today { border: 2px solid var(--allura-orange); }
.task-calendar button.cal-selected, .task-calendar button.cal-selected:hover { background: var(--allura-navy); color: #fff; border-color: var(--allura-navy); }
.cal-selected .cal-count { background: var(--allura-orange); color: var(--allura-navy); }
.cal-day-tasks { display: grid; gap: 8px; align-content: start; scroll-margin-top: 90px; }
.cal-day-title { margin: 4px 0; font-size: 1rem; }
.cal-day-title small { color: var(--muted); font-weight: 500; font-size: .8rem; margin-inline-start: 6px; }
.task-calendar button.cal-item { display: flex; align-items: center; gap: 10px; }
.cal-item-time { flex: none; min-width: 62px; font-size: .8rem; font-weight: 700; color: var(--allura-navy); background: #eef1f6; border-radius: 8px; padding: 4px 6px; text-align: center; }
.cal-item[data-late="true"] .cal-item-time { background: #fff0f2; color: #b6374d; }
@media (max-width: 760px) {
  .task-calendar { grid-template-columns: 1fr; }
  .task-calendar button.cal-day, .cal-blank { min-height: 44px; }
}
.task-calendar button.cal-item { margin: 0; text-align: start; }
.cal-item .quick-task-main { flex: 1; text-align: start; }

/* Maintenance contacts */
.maintenance-switch { margin-bottom: 12px; }
.contact-search { display: grid; gap: 4px; max-width: 420px; margin: 8px 0 12px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.contact-card { display: grid; gap: 8px; align-content: start; margin: 0; }
.contact-card[hidden] { display: none; }
.contact-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.contact-head h3 { margin: 0; font-size: 1.05rem; }
.contact-mode { font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: #e8f3ea; color: #1f6b3a; white-space: nowrap; }
.contact-mode[data-mode="send"] { background: #fdf0dc; color: #9a5a00; }
.contact-mode[data-mode="both"] { background: #e8eef8; color: #24467a; }
.contact-specialty { margin: 0; line-height: 1.6; }
.contact-notes { margin: 0; white-space: pre-line; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.contact-actions a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 12px; font-weight: 700; text-decoration: none; }
.contact-call { background: var(--allura-navy); color: #fff; }
.contact-whatsapp { background: #25a35a; color: #fff; }
.contact-actions button { min-height: 40px; }
.contact-modes { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: grid; gap: 6px; }
.contact-modes legend { font-weight: 700; padding: 0 4px; }
.contact-phone { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.contact-actions + .contact-actions { margin-top: -2px; }
.contact-phones { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: grid; gap: 8px; }
.contact-phones legend { font-weight: 700; padding: 0 4px; }
[data-phone-list] { display: grid; gap: 8px; }
.phone-row { display: flex; gap: 8px; align-items: center; }
.phone-row input { flex: 1; }
.phone-row button { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.3rem; }
.contact-add-phone { justify-self: start; }
.contact-actions .contact-plus { font-weight: 800; color: var(--allura-navy); border-style: dashed; }
.contact-branches { margin: 0; font-size: .85rem; color: var(--muted); font-weight: 600; }
.contact-branch-pick .muted { margin: 0; font-size: .8rem; }
/* Compact maintenance contact form */
dialog form[data-dashboard$="_contact"] { gap: 6px 14px; }
dialog form[data-dashboard$="_contact"] :is(.contact-modes, .contact-phones) { padding: 4px 10px 8px; gap: 6px; margin: 0; }
dialog form[data-dashboard$="_contact"] .contact-modes { display: flex; flex-wrap: wrap; align-content: start; gap: 6px; }
dialog form[data-dashboard$="_contact"] .contact-modes legend { font-size: .9rem; }
dialog form[data-dashboard$="_contact"] .contact-modes legend .muted { font-weight: 400; font-size: .78rem; }
dialog form[data-dashboard$="_contact"] .contact-modes label.check { align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .85rem; white-space: nowrap; cursor: pointer; }
dialog form[data-dashboard$="_contact"] .contact-modes label.check:has(input:checked) { border-color: var(--allura-navy); background: #eef1f6; font-weight: 700; }
dialog form[data-dashboard$="_contact"] .contact-modes input { margin: 0; }
dialog form[data-dashboard$="_contact"] .contact-branch-pick { grid-column: 1 / -1; }
dialog form[data-dashboard$="_contact"] [data-phone-list] { gap: 6px; }
dialog form[data-dashboard$="_contact"] .phone-row button { min-width: 38px; min-height: 38px; }
dialog form[data-dashboard$="_contact"] .contact-add-phone { min-height: 32px; padding: 2px 12px; font-size: .85rem; }
dialog form[data-dashboard$="_contact"] textarea { min-height: 44px; }
@media (min-width: 600px) {
  dialog form[data-dashboard$="_contact"] > .contact-notes-field { grid-column: auto; }
  dialog form[data-dashboard$="_contact"] > .contact-modes { grid-column: 1 / -1; }
}
dialog form[data-dashboard$="_contact"] .contact-modes { align-items: center; }
dialog form[data-dashboard$="_contact"] .contact-modes label.check { margin: 0; min-height: 0; line-height: 1.3; }
dialog form[data-dashboard$="_contact"] .contact-notes-field textarea { min-height: 76px; height: calc(100% - 26px); }
/* Contact form: normal text sizes */
dialog form[data-dashboard$="_contact"] { gap: 10px 16px; font-size: 1rem; }
dialog form[data-dashboard$="_contact"] .contact-modes legend, dialog form[data-dashboard$="_contact"] .contact-phones legend { font-size: 1rem; }
dialog form[data-dashboard$="_contact"] .contact-modes legend .muted { font-size: .88rem; }
dialog form[data-dashboard$="_contact"] .contact-modes label.check { font-size: 1rem; padding: 8px 14px; }
dialog form[data-dashboard$="_contact"] .contact-add-phone { min-height: 38px; font-size: .95rem; padding: 4px 14px; }
dialog form[data-dashboard$="_contact"] input:not([type=checkbox]):not([type=radio]) { min-height: 44px; font-size: 1rem; }
dialog form[data-dashboard$="_contact"] :is(.contact-modes, .contact-phones) { padding: 6px 12px 10px; gap: 8px; }
dialog form[data-dashboard$="_contact"] > button[type=submit] { min-height: 46px; min-width: 150px; font-size: 1.05rem; }
dialog form[data-dashboard$="_contact"] .contact-modes input { width: 18px; height: 18px; accent-color: var(--allura-navy); }
/* Compact template form */
dialog form[data-dashboard="new_template"] { gap: 8px 16px; }
@media (min-width: 600px) {
  dialog form[data-dashboard="new_template"] > .template-half { grid-column: auto; }
}
dialog form[data-dashboard="new_template"] textarea { min-height: 64px; }
dialog form[data-dashboard="new_template"] .template-repeat { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px 10px; margin: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
dialog form[data-dashboard="new_template"] .template-repeat legend { font-weight: 700; padding: 0 4px; }
dialog form[data-dashboard="new_template"] .template-chips { display: flex; flex-wrap: wrap; gap: 6px; }
dialog form[data-dashboard="new_template"] .template-chips[hidden] { display: none; }
dialog form[data-dashboard="new_template"] .template-chips label.check { align-items: center; gap: 6px; margin: 0; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; cursor: pointer; white-space: nowrap; }
dialog form[data-dashboard="new_template"] .template-chips label.check:has(input:checked) { border-color: var(--allura-navy); background: #eef1f6; font-weight: 700; }
dialog form[data-dashboard="new_template"] .template-chips input { width: 17px; height: 17px; margin: 0; accent-color: var(--allura-navy); }
dialog form[data-dashboard="new_template"] .template-time { display: flex; align-items: center; gap: 8px; margin: 0; }
dialog form[data-dashboard="new_template"] .template-time[hidden] { display: none; }
dialog form[data-dashboard="new_template"] .template-time input { margin: 0; width: auto; }
dialog form[data-dashboard="new_template"] .template-checks { display: flex; gap: 20px; align-items: center; }
dialog form[data-dashboard="new_template"] .template-checks label { margin: 0; }
dialog form[data-dashboard="new_template"] .template-days { flex-basis: 100%; }
dialog form[data-dashboard="new_template"] textarea { min-height: 52px; }
dialog form[data-dashboard="new_template"] .error:empty { display: none; }
@media (min-width: 600px) {
  dialog form[data-dashboard="new_template"] > button[type=submit] { grid-column: 2; grid-row: auto; justify-self: end; align-self: center; }
  dialog form[data-dashboard="new_template"] > .template-checks { grid-column: 1; }
  dialog form[data-dashboard="new_template"] > .error:not(:empty) { grid-column: 1 / -1; }
}

/* Help tips */
.help-tip { display: inline-block; position: relative; margin-inline-start: 8px; vertical-align: middle; font-size: 1rem; font-weight: 400; }
.help-tip summary { list-style: none; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
  background: #eef1f6; color: var(--allura-navy); font-weight: 800; font-size: .95rem; border: 1px solid var(--line); }
.help-tip summary::-webkit-details-marker { display: none; }
.help-tip[open] summary { background: var(--allura-navy); color: #fff; }
.help-tip p { position: absolute; z-index: 20; inset-inline-start: 0; top: 32px; width: min(360px, 80vw); margin: 0; padding: 10px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); line-height: 1.7; color: var(--deep); }
.brand-panel .help-tip summary { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.35); }

/* Today screen */
.today .today-group { display: grid; gap: 6px; margin-bottom: 14px; }
.today .today-group h3 { margin: 4px 0; font-size: 1rem; }
.today-row { display: flex; align-items: stretch; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  border-inline-start: 5px solid var(--allura-navy); }
.today-row[data-tone="late"] { border-inline-start-color: #b6374d; background: #fff7f8; }
.today-row[data-tone="urgent"] { border-inline-start-color: var(--allura-orange); }
button.today-open { flex: 1; display: flex; align-items: center; gap: 10px; background: transparent; border: 0; box-shadow: none; padding: 4px 6px; text-align: start; color: inherit; min-height: 48px; }
.today-time { flex: none; min-width: 64px; text-align: center; font-weight: 800; font-size: .85rem; color: var(--allura-navy); background: #eef1f6; border-radius: 10px; padding: 6px 4px; }
.today-row[data-tone="late"] .today-time { background: #ffe3e8; color: #b6374d; }
.today-main { display: grid; gap: 2px; min-width: 0; }
.today-main strong { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-main small { color: var(--muted); }
button.today-quick { flex: none; align-self: center; min-height: 44px; padding: 0 16px; font-weight: 800; white-space: nowrap; }

/* Push reminder */
.push-reminder { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px;
  padding: 10px 14px; border-radius: 14px; background: #fff6e6; border: 1px solid #f3d29a; font-weight: 600; }
.push-reminder .actions { margin: 0; }

/* Devices and faults */
.device-stats { margin: 0; font-size: .9rem; }
.device-open { color: #b6374d; }
.badge.device-ok { background: #e8f3ea; color: #1f6b3a; }
.badge.device-expired { background: #fff0f2; color: #b6374d; }
.fault-wrap { display: grid; gap: 4px; }
.fault-meta { margin: 0 8px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.task-technician { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfd; }
.task-technician a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.device-history { display: grid; gap: 8px; }
dialog form[data-dashboard="new_maintenance"] { gap: 8px 16px; }
@media (min-width: 600px) { dialog form[data-dashboard="new_maintenance"] > .template-half { grid-column: auto; } }
dialog form[data-dashboard="new_maintenance"] textarea { min-height: 52px; }
dialog form[data-dashboard="new_template"] .template-device[hidden] { display: none; }

/* Voice notes */
.voice-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.voice-note button.recording { background: #b6374d; color: #fff; border-color: #b6374d; animation: voicePulse 1.2s infinite; }
@keyframes voicePulse { 50% { opacity: .7; } }
.voice-player audio { width: 100%; max-width: 360px; }
.voice-shortcut { margin-top: 8px; }

/* Calendar drag */
.cal-drag-hint { margin: 0; font-size: .82rem; }
.cal-item[draggable="true"] { cursor: grab; }
.task-calendar button.cal-day.cal-drop { outline: 3px dashed var(--allura-orange); outline-offset: -3px; background: #fff6e6; }

/* People report */
.report-table-wrap { overflow-x: auto; padding: 0; }
.report-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.report-table th, .report-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.report-table th { background: #f6f3ec; font-weight: 800; }
.report-table td small { display: block; color: var(--muted); font-size: .78rem; }
.report-table .report-late { color: #b6374d; font-weight: 800; }
.today-row button.secondary.today-open, .today-row button.secondary.today-open:hover { background: transparent; border: 0; box-shadow: none; color: inherit; min-height: 48px; }
.today-row button.secondary.today-open:hover .today-main strong { text-decoration: underline; }
.device-card { display: grid; gap: 8px; align-content: start; margin: 0; }
.device-card .contact-branches, .device-card .device-stats { line-height: 1.6; }
.dictate-button { justify-self: start; margin-top: 6px; min-height: 36px; padding: 4px 14px; font-size: .9rem; }
.dictate-button.recording { background: #b6374d; color: #fff; border-color: #b6374d; animation: voicePulse 1.2s infinite; }
label:has(> .dictate-button) { position: relative; }
label > .dictate-button { position: absolute; inset-inline-end: 8px; bottom: 8px; margin: 0; min-height: 30px; padding: 2px 10px; font-size: .82rem; border-radius: 999px; z-index: 1; }
label:has(> .dictate-button) > textarea { padding-inline-end: 86px; }
/* Attachments: open, pick, share */
.attachment-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.attachment-pick { margin: 0; }
.attachment-pick input { width: 18px; height: 18px; margin: 0; }
button.link-button, button.link-button:hover { background: transparent; border: 0; box-shadow: none; padding: 0; min-height: 0; color: var(--allura-navy);
  font-weight: 800; text-align: start; text-decoration: underline; cursor: pointer; overflow-wrap: anywhere; }
.share-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.picked-files { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.picked-files[hidden] { display: none; }
.picked-files li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; background: #f6f3ec; border-radius: 8px; font-size: .88rem; }
.picked-files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked-files button { min-height: 28px; min-width: 28px; padding: 0 8px; }
.attachment-title button.secondary.link-button, .attachment-title button.secondary.link-button:hover { background: transparent; border: 0; box-shadow: none; padding: 0; min-height: 0; color: var(--allura-navy); text-decoration: underline; }
/* One-window task detail */
.detail-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.detail-section h3 { margin: 0; font-size: 1.02rem; }
.detail-add { display: grid; gap: 6px; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; background: #fcfbf8; }
.detail-add .voice-note { margin: 0; }
.comment-item { padding: 8px 12px; border-radius: 12px; background: #f6f3ec; }
.comment-item p { margin: 4px 0 0; white-space: pre-line; line-height: 1.6; }
.detail-comment-form { display: grid; gap: 6px; }
.detail-history summary { cursor: pointer; font-weight: 800; }
.detail-history[open] summary { margin-bottom: 8px; }
/* Task flow + clearer actions */
.task-flow { list-style: none; margin: 0 0 8px; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; counter-reset: step; }
.task-flow li { flex: 1; min-width: 90px; text-align: center; padding: 6px 8px; border-radius: 10px; background: #f1efe9; color: var(--muted); font-size: .85rem; font-weight: 700; position: relative; }
.task-flow li.done { background: #e8f3ea; color: #1f6b3a; }
.task-flow li.current { background: var(--allura-navy); color: #fff; }
.task-next-hint { margin: 6px 0 0; font-size: .9rem; }
/* Compact attachments toolbar */
.attach-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.attach-toolbar .error:empty { display: none; }
.attach-toolbar .error { flex-basis: 100%; }
label.attach-pick-button { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: #faf3e6; color: var(--deep); font-weight: 700; cursor: pointer; margin: 0; }
label.attach-pick-button:hover { background: #f3ead8; }
.attach-proof { margin: 0; font-size: .9rem; }
.attach-toolbar [data-voice-status]:empty { display: none; }

.attachment { position: relative; }
.share-pick { display: none; position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2; background: #fff; border-radius: 8px; padding: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.share-pick input { width: 22px; height: 22px; margin: 0; accent-color: #174840; }
.share-mode .share-pick { display: flex; }
.share-mode .attachment:has([data-share-pick]:not(:checked)) { opacity: .5; }
.share-bar { align-items: center; }
.share-mode .task-detail-files .attachment { padding-inline-start: 46px; }
.share-mode .share-pick { top: 50%; transform: translateY(-50%); inset-inline-start: 8px; box-shadow: none; }
.share-mode .share-icon { display: none; }

.attach-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#attach.attach-toolbar { flex-direction: column; align-items: stretch; }
.pending-tray { border: 2px dashed #F39C1E; background: #fff8ec; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.pending-tray[hidden] { display: none; }
.pending-note { margin: 0; font-size: .9rem; color: #7a4a00; }
.pending-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.picked-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.picked-files li audio { height: 36px; max-width: 100%; }
.picked-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.picked-remove, .file-delete { min-width: 34px; min-height: 34px; padding: 0 !important; border-radius: 50% !important; font-weight: 800; }
.file-delete { position: absolute; top: 6px; inset-inline-end: 6px; z-index: 3; background: #fff !important; color: #c0392b !important; border: 1px solid #e8c4c0 !important; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.task-detail-files .attachment { padding-inline-end: 44px; }
.submit-files-note { margin: 0; }

nav button { position: relative; }
.nav-badge { position: absolute; inset-block-start: 2px; inset-inline-end: 18%; min-width: 18px; padding: 0 4px; line-height: 18px; border-radius: 20px; background: #a33245; color: #fff; font-size: 11px; font-weight: 800; text-align: center; }
.nav-badge.inline { position: static; display: inline-block; margin-inline-start: 4px; }

.handover-ribbon { border-radius: 10px; padding: 6px 10px; font-weight: 800; font-size: .9rem; }
.handover-ribbon.incoming { background: #fff1dc; color: #8a4b00; border: 1px solid #f3c27a; }
.handover-ribbon.outgoing { background: #eef2f7; color: #3b5b8c; border: 1px solid #c9d5e6; }
.handover-buttons { display: flex; gap: 8px; }
.handover-buttons button { flex: 1; }

/* ---------- Delight: motion & celebrations ---------- */
.confetti-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }
.float-emoji { position: fixed; z-index: 9998; font-size: 28px; pointer-events: none; transform: translate(-50%, 0); animation: float-emoji 1.3s ease-out forwards; }
@keyframes float-emoji { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.5); } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -110px) scale(1); } }
.greeting { display: inline-flex; align-items: center; gap: 6px; }
.greeting-wave { display: inline-block; animation: greeting-wave 2.4s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes greeting-wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg) scale(1.15); } 20%, 40% { transform: rotate(-8deg); } }
.day-progress { background: #fff; border: 1px solid #e6dcc8; border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }
.day-progress-text { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 6px; color: #1A2B27; }
.day-progress-text strong { color: #2f8a4c; }
.day-progress-bar { height: 12px; border-radius: 99px; background: #efe7d6; overflow: hidden; }
.day-progress-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8DC63F, #2f8a4c, #8DC63F); background-size: 200% 100%;
  animation: progress-grow .9s cubic-bezier(.2,.8,.2,1) both, progress-shine 2.5s linear infinite; }
@keyframes progress-grow { from { width: 0 !important; } }
@keyframes progress-shine { to { background-position: -200% 0; } }
button:not(:disabled):active { transform: scale(.96); }
button { transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease; }
.board-card, .today-row { animation: card-in .35s ease-out both; }
.board-grid > :nth-child(2), .today-group > :nth-child(3) { animation-delay: .04s; }
.board-grid > :nth-child(3), .today-group > :nth-child(4) { animation-delay: .08s; }
.board-grid > :nth-child(4), .today-group > :nth-child(5) { animation-delay: .12s; }
.board-grid > :nth-child(n+5) { animation-delay: .16s; }
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.board-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(23,72,64,.12); transition: transform .15s ease, box-shadow .15s ease; }
.handover-ribbon.incoming { animation: ribbon-pulse 1.8s ease-in-out 3; }
@keyframes ribbon-pulse { 50% { box-shadow: 0 0 0 4px #f39c1e40; } }
.nav-badge { animation: badge-pop .45s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes badge-pop { from { transform: scale(0); } }
#toast[data-cue="fanfare"] { background: linear-gradient(135deg, #174840, #2f8a4c); font-weight: 800; animation: toast-bounce .5s cubic-bezier(.3,1.6,.5,1) both; }
#toast[data-cue="start"], #toast[data-cue="submit"] { animation: toast-bounce .45s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes toast-bounce { from { transform: translateY(20px) scale(.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .board-card, .today-row, .greeting-wave, .day-progress-bar i, .handover-ribbon.incoming, .nav-badge, #toast { animation: none !important; }
}

/* ---------- Tasks toolbar ---------- */
.task-toolbar { display: flex; flex-direction: column; gap: 10px; padding: 12px; margin-block-end: 12px; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.task-toolbar .task-views { margin: 0; gap: 0; background: #efe7d6; border-radius: 12px; padding: 3px; }
.task-toolbar .task-views button, .segmented button { border: 0 !important; background: transparent !important; box-shadow: none !important; min-height: 38px; padding: 6px 16px; border-radius: 10px !important; font-weight: 800; color: #4a5a55 !important; }
.task-toolbar .task-views button[aria-pressed="true"], .segmented button[aria-pressed="true"] { background: #174840 !important; color: #fff !important; }
.segmented { display: inline-flex; background: #efe7d6; border-radius: 12px; padding: 3px; gap: 2px; }
.segmented button { padding: 6px 12px; font-size: .86rem; }
.toolbar-search { justify-content: flex-start; flex-wrap: nowrap; }
.search-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #ddd3bf; border-radius: 12px; padding: 0 10px; margin: 0; }
.search-box input { border: 0 !important; box-shadow: none !important; margin: 0 !important; background: transparent; min-width: 0; }
.toolbar-search select { width: auto; max-width: 190px; margin: 0; }
.task-toolbar .task-statuses { flex-wrap: nowrap; overflow-x: auto; margin: 0; padding-block-end: 2px; scrollbar-width: thin; }
.task-statuses .chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px; border-radius: 99px; border: 1px solid #ddd3bf; background: #fff; color: #1A2B27; font-size: .86rem; font-weight: 700; }
.chip-count { min-width: 20px; padding: 0 6px; border-radius: 99px; background: #efe7d6; font-size: .78rem; line-height: 20px; text-align: center; }
.task-toolbar .task-statuses .chip[aria-pressed="true"] { background: #174840 !important; border-color: #174840 !important; color: #fff !important; }
.task-statuses .chip[aria-pressed="true"] .chip-count { background: #8DC63F; color: #174840; }
.task-statuses .chip[data-tone="late"] .chip-count { background: #fde3e3; color: #a33245; }
@media (max-width: 640px) {
  .toolbar-search { flex-wrap: wrap; }
  .toolbar-search .search-box { flex-basis: 100%; }
  .toolbar-search select { flex: 1; max-width: none; }
  .layout-switch button { padding: 6px 9px; }
}

/* ---------- Guide attachments ---------- */
.guide-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 10px 0 4px; }
.guide-item { position: relative; }
.guide-item .file-delete { top: 6px; inset-inline-end: 6px; position: absolute; z-index: 4; }
.guide-doc > button[data-guide-open] { padding-inline-end: 44px; }
.guide-image > button[data-guide-open] { padding: 0 !important; border: 0 !important; background: #efe7d6 !important; border-radius: 12px !important; overflow: hidden; width: 100%; aspect-ratio: 4/3; display: block; }
.guide-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.guide-video { grid-column: span 2; }
.guide-video video { width: 100%; max-height: 420px; border-radius: 12px; background: #000; display: block; }
.guide-play { width: 100%; min-height: 120px; border-radius: 12px !important; background: #174840 !important; color: #fff !important; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 800; }
.guide-play span { font-size: 2rem; }
.guide-play small { font-weight: 400; opacity: .8; font-size: .8rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-doc > button[data-guide-open], .guide-add > button { width: 100%; min-height: 48px; text-align: start; overflow: hidden; text-overflow: ellipsis; }
.guide-full { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; border-radius: 12px; }
.guide-name { display: block; margin-top: 4px; font-size: .78rem; color: #6b6355; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-image img:not([src]) { visibility: hidden; }
/* دليل طريقة الشغل: كروت، ٣ في الصف */
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.guide-card { display: flex; flex-direction: column; padding: 0 !important; overflow: hidden; margin: 0 !important; }
.guide-card-open { all: unset; cursor: pointer; display: flex; flex-direction: column; flex: 1; min-width: 0; background: transparent !important; color: inherit !important; border: 0 !important; padding: 0 !important; border-radius: 0 !important; box-shadow: none !important; min-height: 0 !important; transform: none !important; text-align: start !important; font-weight: 400 !important; }
.guide-card { transition: box-shadow .2s, transform .2s; }
.guide-card:hover { box-shadow: 0 10px 26px rgba(23,72,64,.14); transform: translateY(-2px); }
.guide-card-open:focus-visible { outline: 3px solid #c9a55a; outline-offset: -3px; }
.guide-cover { display: grid; place-items: center; aspect-ratio: 16/9; background: linear-gradient(135deg, #174840, #2c6b5f); overflow: hidden; font-size: 2.6rem; }
.guide-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.guide-card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 6px; min-width: 0; }
.guide-card-body strong { font-size: 1.05rem; line-height: 1.4; }
.guide-excerpt { color: #4a463e; font-size: .9rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.guide-card-body strong { color: #174840; }
.guide-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px 12px; flex-wrap: wrap; }
.guide-chips { display: flex; gap: 8px; font-size: .85rem; color: #6b6355; }
.guide-card-actions { display: flex; gap: 6px; }
.guide-card-actions button { min-height: 36px; padding: 4px 10px; font-size: .85rem; }
.guide-body { white-space: pre-line; }
form[data-dashboard="edit_post"] > * { grid-column: 1 / -1; }
.guide-edit-files { border: 1px solid #e4dccb; border-radius: 12px; padding: 8px 12px 12px; margin: 0; display: grid; gap: 10px; }
.guide-edit-files legend { font-weight: 700; padding: 0 6px; }
@media (max-width: 1000px) { .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .guide-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .guide-video { grid-column: 1 / -1; } }

/* اختيار أكتر من موظف (المهام والقوالب) */
.people-pick { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px 10px; margin: 0; min-width: 0; }
.people-pick legend { font-weight: 700; padding: 0 4px; }
.people-pick legend small { font-weight: 400; font-size: .8rem; }
.people-pick .pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.people-pick .pick-groups { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dashed var(--line); }
.people-pick .pick-people { max-height: 220px; overflow-y: auto; padding: 2px; }
.people-pick label.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 400; }
.people-pick label.check:has(input:checked) { border-color: var(--allura-navy); background: #eef1f6; font-weight: 700; }
.people-pick label.pick-group { background: #fbf6ea; }
.people-pick input { width: 17px; height: 17px; margin: 0; accent-color: var(--allura-navy); }

/* نافذة إنشاء مهمة: عمودين مستقلين (كتابة | مين وإزاي) من غير فراغات */
.badge.claim { background: #fff1dc; color: #8a4b00; border: 1px solid #f3c27a; }
dialog:has(.create-form) { width: min(100%, 940px); padding: 14px 18px; }
dialog:has(.create-form) h2 { font-size: 1.15rem; margin: 0; }
dialog:has(.create-form) #editor-title:focus { outline: none; }
.create-form { display: grid !important; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0 18px; align-items: start; font-size: .9rem; }
.create-form .cf-main, .create-form .cf-side { display: grid; gap: 10px; min-width: 0; align-content: start; }
.create-form .cf-side { background: #fbf8f1; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.create-form .cf-field { margin: 0; font-size: .85rem; display: grid; gap: 4px; }
.create-form .cf-field > :is(input, textarea) { margin: 0 !important; min-height: 38px; padding: 7px 10px; font-size: .92rem; width: 100%; box-sizing: border-box; }
.create-form .cf-field > textarea { min-height: 110px; }
.create-form .cf-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.create-form .cf-group { display: grid; gap: 5px; min-width: 0; }
.create-form .cf-title, .create-form .people-pick legend { font-weight: 700; font-size: .85rem; }
.create-form .cf-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.create-form label.cf-opt { position: relative; margin: 0; display: flex; align-items: center; justify-content: center; min-height: 34px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-weight: 400; font-size: .82rem; text-align: center; line-height: 1.2; cursor: pointer; user-select: none; }
.create-form label.cf-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.create-form label.cf-opt:hover { border-color: #b9ad97; }
.create-form label.cf-opt:has(input:checked) { background: var(--allura-navy); border-color: var(--allura-navy); color: #fff; font-weight: 700; }
.create-form label.cf-opt:has(input:focus-visible) { outline: 3px solid #bf6814; outline-offset: 2px; }
.create-form .cf-hint { color: #7a7264; font-size: .72rem; line-height: 1.4; }
.create-form .people-pick { border: 0; padding: 0; margin: 0; }
.create-form .people-pick legend { padding: 0; margin-bottom: 5px; }
.create-form .people-pick legend small { font-weight: 400; font-size: .72rem; }
.create-form .people-pick .pick-chips { gap: 4px; }
.create-form .people-pick .pick-groups { padding-bottom: 6px; margin-bottom: 6px; }
.create-form .people-pick .pick-people { max-height: 150px; }
.create-form .people-pick label.check { padding: 4px 9px; font-size: .8rem; gap: 5px; margin: 0; min-height: 0; line-height: 1.3; }
.people-pick input { min-height: 0 !important; height: 15px !important; width: 15px !important; padding: 0 !important; flex: none; }
.people-pick label.check { min-height: 0 !important; line-height: 1.3; }
.create-form label.cf-claim { margin: 0; display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border: 1.5px dashed #e0a13a; border-radius: 10px; background: #fff7e8; font-weight: 400; cursor: pointer; }
.create-form label.cf-claim input { width: 17px; height: 17px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: #c27a0e; }
.create-form label.cf-claim span { display: grid; gap: 2px; }
.create-form label.cf-claim b { font-size: .84rem; }
.create-form label.cf-claim small { font-size: .72rem; color: #7a6a52; line-height: 1.4; }
.create-form label.cf-claim:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.create-form label.cf-attach { margin: 0; display: grid; gap: 5px; font-size: .85rem; }
.create-form label.cf-attach input { margin: 0 !important; font-size: .8rem; min-height: 0; padding: 6px; border: 1px dashed var(--line); border-radius: 9px; background: #fff; width: 100%; box-sizing: border-box; }
.create-form > .error { grid-column: 1 / -1; margin: 4px 0 0; }
.create-form > .error:empty { display: none; }
.create-form > .cf-submit { grid-column: 1 / -1; width: 100%; min-height: 44px; margin-top: 12px; font-size: 1rem; }
@media (max-width: 860px) {
  dialog:has(.create-form) { padding: 10px 12px; }
  .create-form { grid-template-columns: 1fr; gap: 10px; }
  .create-form .cf-field > textarea { min-height: 84px; }
  .create-form .cf-pair { gap: 8px; }
}
.notice-branches { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 10px; margin: 0 0 6px; display: grid; gap: 6px; background: #fbf8f1; }
.notice-branches legend { font-weight: 700; padding: 0 4px; }
.notice-branches p { margin: 0 0 4px; font-size: .82rem; line-height: 1.5; }
.notice-branches label.notice-branch { margin: 0; }
.notice-kinds-title { margin: 6px 0 0; }

/* البرنامج الموحّد: زرار التنقل للمخزن + شاشة الاختيار بعد الدخول */
.module-switch { display: inline-flex; align-items: center; gap: 5px; min-height: 37px; padding: 6px 12px; border-radius: 12px;
  background: #174840; color: #fff; font-weight: 800; font-size: 12px; text-decoration: none; white-space: nowrap; }
.module-switch[hidden] { display: none; }
.module-switch:hover { background: #0f3530; }
.launcher { max-width: 760px; margin: 28px auto; text-align: center; }
.launcher h1 { margin-bottom: 4px; }
.launcher-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.launcher-tile { all: unset; box-sizing: border-box; cursor: pointer; display: grid; justify-items: center; gap: 8px; padding: 28px 16px;
  border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(23,72,64,.10); text-align: center; }
.launcher-tile { background: #fff !important; color: inherit !important; min-height: 0 !important; font-weight: 400 !important; }
body.launcher-open .floating-task { display: none !important; }
.launcher-tile:hover, .launcher-tile:focus-visible { border-color: #174840; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(23,72,64,.18); }
.launcher-tile:focus-visible { outline: 3px solid #bf6814; outline-offset: 3px; }
.launcher-icon { font-size: 46px; line-height: 1; }
.launcher-tile strong { font-size: 1.25rem; color: #174840; }
.launcher-tile small { color: #6b6355; line-height: 1.6; }
@media (max-width: 560px) { .launcher-grid { grid-template-columns: 1fr; } .header-actions .module-switch { padding-inline: 8px; font-size: 11px; } }
