:root {
  --ink: #17352f;
  --muted: #667b76;
  --line: #e2ebe8;
  --paper: #f6f8f7;
  --panel: #ffffff;
  --soft: #edf7f4;
  --teal: #0ca994;
  --teal-2: #087a6c;
  --green: #13995c;
  --gold: #d2a12a;
  --gold-soft: #fff4cf;
  --danger: #b53b3b;
  --danger-soft: #fff0f0;
  --info: #26708d;
  --info-soft: #e8f5fb;
  --shadow: 0 16px 36px rgba(23, 53, 47, .08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% 20%, rgba(210, 161, 42, .16), transparent 17rem),
    radial-gradient(circle at 16% 12%, rgba(67, 216, 202, .18), transparent 18rem),
    #e9fbf7;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% 20%, rgba(210, 161, 42, .16), transparent 17rem),
    radial-gradient(circle at 16% 12%, rgba(67, 216, 202, .18), transparent 18rem),
    #e9fbf7;
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(12, 169, 148, .08), rgba(246, 248, 247, 0) 300px),
    var(--paper);
}

.login-page {
  min-height: 100vh;
  min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(320px, 624px);
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  background:
    radial-gradient(circle at 72% 20%, rgba(210, 161, 42, .26), transparent 17rem),
    radial-gradient(circle at 16% 12%, rgba(67, 216, 202, .22), transparent 18rem),
    linear-gradient(135deg, rgba(12, 169, 148, .16), rgba(255, 255, 255, .78) 44%, rgba(12, 169, 148, .1)),
    var(--paper);
}

.login-page,
.login-page button,
.login-page input,
.login-page select,
.login-page textarea {
  font-family: "Plus Jakarta Sans", "Segoe UI", Arial, Helvetica, sans-serif;
}

.brand-panel {
  position: relative;
  min-height: 520px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(7, 72, 65, .1), rgba(7, 72, 65, .24)),
    linear-gradient(145deg, #087a6c 0%, #0ca994 58%, #72d8cb 100%);
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), transparent 42%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 44px);
}

.brand-header,
.hero-copy {
  position: relative;
  z-index: 1;
}

.brand-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
}

.brand-header img,
.side-brand img,
.login-logo,
.logo-fallback {
  flex: none;
  display: block;
  border-radius: 14px;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}

.logo-fallback {
  display: grid;
  place-items: center;
  color: var(--teal-2);
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
  border: 3px solid rgba(210, 161, 42, .8);
}

.brand-header img {
  width: 58px;
  height: 58px;
}

.brand-header .logo-fallback {
  width: 58px;
  height: 58px;
  font-size: 12px;
}

.brand-header strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.brand-header small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, .82);
  font-style: italic;
  font-size: 13px;
  line-height: 1.35;
}

@media (min-width: 1180px) {
  .brand-header strong { font-size: 19px; }
}

.hero-copy {
  max-width: 360px;
  margin: 0;
  text-align: left;
  align-self: center;
  padding: 24px 0 20px;
}

.hero-copy span,
.hero-panel span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 8px;
  color: rgba(255, 255, 255, .9);
  font-weight: 800;
  letter-spacing: .6px;
  font-size: 11px;
}

.hero-copy h1 {
  margin: 20px 0 12px;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.08;
  font-weight: 800;
}

.hero-copy p {
  max-width: 330px;
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .84);
}

.login-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  padding: 38px 36px 36px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card::before {
  display: none;
}

.login-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 0;
  margin-bottom: 28px;
  padding: 0;
}

.login-logo {
  width: 66px;
  height: 66px;
  margin-bottom: 0;
  border-radius: 14px;
  object-position: center;
}

.logo-fallback.login-logo {
  width: 66px;
  height: 66px;
  margin-bottom: 0;
  font-size: 13px;
  border-radius: 14px;
}

.login-brand h1,
.login-card h2,
.section-title h2,
.modal-title h3,
.hero-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-brand h1 {
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1.1;
  color: var(--ink);
}

.login-brand p {
  max-width: 390px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.login-kicker {
  width: 100%;
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.login-card h2 {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 24px;
  font-size: clamp(34px, 5vw, 44px);
  line-height: 1.05;
  color: var(--ink);
}

.login-card form,
.login-card .demo-box {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.hint,
.muted,
.field span {
  color: var(--muted);
}

.login-card .hint {
  margin: 8px 0 20px;
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field span {
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 169, 148, .14);
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 56px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: var(--teal-2);
  background: transparent;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle.is-active {
  background: var(--soft);
  outline: none;
}

.btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn .button-icon-image {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.top-actions .top-icon .button-icon-image {
  width: 24px;
  height: 24px;
}

.user-logout-icon .button-icon-image {
  width: 22px;
  height: 22px;
}

.btn.primary {
  background: #43d8ca;
  color: var(--ink);
}

.login-card .btn.primary {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  font-size: 18px;
}

.btn.ghost {
  border-color: var(--line);
}

.btn.ghost.light {
  border-color: var(--line);
  background: #fff;
  color: var(--teal-2);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.compact {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
}

.btn.icon-only {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--teal-2);
}

.btn.icon-only.primary-icon {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.btn.icon-only:hover,
.btn.compact:hover {
  border-color: rgba(0, 124, 111, .28);
  background: #f7fffd;
}

.btn.icon-only.primary-icon:hover {
  border-color: var(--teal-2);
  background: #37d0c2;
  color: #fff;
}

.actions .btn.icon-only,
.actions .btn.compact {
  width: auto;
}

.title-line {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.demo-box,
.notice {
  margin-top: 24px;
  padding: 14px 16px;
  background: #f8fbfa;
  border: 1px dashed #cddfda;
  border-radius: 8px;
  color: #48615b;
  font-size: 13px;
  line-height: 1.55;
}

.notice {
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}

.layout {
  min-height: 100vh;
  min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  background: linear-gradient(90deg, #ffffff 0 310px, #e9fbf7 310px 100%);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 16px 12px;
  color: var(--ink);
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: none;
  overflow-y: auto;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.side-brand img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.side-brand .logo-fallback {
  width: 48px;
  height: 48px;
  font-size: 10px;
  border-radius: 14px;
}

.side-brand strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.side-brand small,
.user-box small {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-section {
  margin: 8px 8px 0;
  color: #78918b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.nav-section:first-child {
  margin-top: 0;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
  font-size: 18px;
}

.nav button.active,
.nav button:hover {
  background: #fbfffe;
  border-color: #d1e8e2;
  color: var(--teal-2);
}

.nav-icon,
.tile-icon,
.stat-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--teal-2);
  background: #d8f6f1;
  border-radius: 8px;
}

.nav-icon {
  width: 36px;
  height: 36px;
}

.nav-icon svg,
.tile-icon svg,
.stat-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-box {
  margin-top: auto;
  flex: none;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.user-box strong,
.user-box small {
  display: block;
}

.user-box .btn {
  width: 100%;
  margin-top: 14px;
}

.user-box .btn.icon-only.user-logout-icon {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  margin-left: auto;
}

.main {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  min-height: 88px;
  padding: 22px 28px;
  margin-bottom: 26px;
  background: #ebfbf8;
  border-bottom: 1px solid #d9efeb;
}

.top-summary {
  max-width: 440px;
}

.top-summary .muted {
  font-size: 16px;
  line-height: 1.45;
}

.dashboard-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  min-height: 168px;
  align-items: center;
}

.dashboard-topbar .top-summary {
  display: grid;
  align-content: center;
  min-height: 98px;
  max-width: none;
  padding-left: 0;
}

.dashboard-topbar .top-summary .muted {
  max-width: 720px;
}

.topbar.dashboard-topbar h1 {
  max-width: none;
  font-size: clamp(42px, 3.2vw, 54px);
  white-space: nowrap;
}

.topbar h1 {
  max-width: 610px;
  margin: 6px 0 6px;
  font-size: clamp(30px, 2.4vw, 38px);
  line-height: 1.08;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.eyebrow {
  color: var(--teal-2);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-label {
  margin-bottom: 10px;
  font-size: clamp(22px, 1.8vw, 28px);
  line-height: 1.1;
  text-transform: none;
}

.top-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 46px;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: min(100%, 430px);
  min-width: 0;
  flex: 0 1 430px;
}

.top-actions .top-icon {
  flex: 0 0 46px;
  width: 46px;
  min-width: 46px;
  min-height: 46px;
}

.search-box {
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.search-box input {
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid #d5e8e4;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  text-align: left;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #d5e8e4;
  border-radius: 999px;
  background: #fff;
  color: var(--teal-2);
  font-size: 16px;
  font-weight: 800;
}

.danger-zone {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.date-pill {
  flex: none;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 0 28px;
  margin-bottom: 22px;
  overflow: visible;
}

.stat,
.panel,
.item-card,
.modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(23, 53, 47, .05);
}

.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 116px;
  padding: 20px 18px;
}

.stat > div span {
  display: block;
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
}

.stat strong {
  display: block;
  margin: 0 0 4px;
  font-size: 32px;
  line-height: 1;
  color: var(--ink);
}

.stat-icon {
  width: 50px;
  height: 50px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 18px;
  color: #fff;
  background: linear-gradient(135deg, #079885, #65d8ca);
}

.hero-panel h2 {
  margin-top: 18px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.15;
}

.hero-panel p {
  max-width: 740px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .88);
}

.hero-panel img {
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: #fff;
}

.hero-panel .logo-fallback {
  width: 110px;
  height: 110px;
  font-size: 20px;
}

.brand-preview {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.brand-preview img,
.brand-preview .logo-fallback {
  width: 112px;
  height: 112px;
}

.branding-form {
  margin-bottom: 18px;
}

.section-title,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title h2 {
  font-size: 24px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.panel {
  padding: 20px;
  margin: 0 28px 22px;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 18px;
  margin: 0 28px 22px;
}

.panel-grid .panel {
  margin: 0;
}

.work-panel {
  padding-bottom: 24px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 16px;
}

.work-tile {
  position: relative;
  min-height: 124px;
  padding: 24px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(23, 53, 47, .05);
}

.work-tile::before {
  content: "";
  position: absolute;
  inset: 0 28px auto 0;
  height: 10px;
  background: #2f9bea;
}

.work-tile::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 0 30px 30px;
  border-color: transparent transparent #d7edf4 transparent;
}

.work-tile.green::before { background: #22c26a; }
.work-tile.gold::before { background: #f5a400; }
.work-tile.purple::before { background: #8b5cf6; }
.work-tile.red::before { background: #ef6a70; }
.work-tile.cyan::before { background: #09b6cb; }
.work-tile.orange::before { background: #ff7a1a; }
.work-tile.slate::before { background: #475569; }
.work-tile.pink::before { background: #ec4899; }

.work-tile strong {
  display: block;
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.16;
}

.tile-icon {
  width: 32px;
  height: 32px;
  color: var(--ink);
  background: transparent;
}

@media (max-width: 1500px) {
  .work-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 260px minmax(0, 1fr);
    background: linear-gradient(90deg, #ffffff 0 260px, #e9fbf7 260px 100%);
  }

  .nav button {
    font-size: 16px;
  }

  .side-brand strong {
    font-size: 18px;
  }

  .topbar {
    display: grid;
  }

  .dashboard-topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .search-box {
    width: min(100%, 420px);
  }
}

.list {
  display: grid;
  gap: 12px;
}

.item-card {
  padding: 14px;
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.item-head > div:first-child {
  min-width: 0;
}

.dashboard-log-card .actions {
  display: grid;
  flex: none;
  grid-template-columns: repeat(3, 40px);
  width: auto;
  min-width: max-content;
}

.dashboard-log-card .item-head {
  display: block;
}

.item-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.item-card p {
  margin: 8px 0 0;
  color: #314d47;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.card-subtitle {
  color: var(--muted);
  font-size: 15px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--teal-2);
  font-size: 12px;
  font-weight: 800;
}

.tag.gold {
  background: var(--gold-soft);
  color: #765a0d;
}

.tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag.info {
  background: var(--info-soft);
  color: var(--info);
}

.photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.photo-strip a {
  width: 92px;
  height: 72px;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.photo-strip img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.journal-card .item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.journal-actions {
  display: grid;
  grid-template-columns: repeat(3, 40px);
  justify-content: end;
  justify-self: end;
  gap: 8px;
  width: max-content;
  min-width: max-content;
}

.journal-actions .btn.icon-only {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
}

.dashboard-log-card .journal-actions {
  grid-template-columns: repeat(3, 40px);
  justify-content: end;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  margin-top: 12px;
}

.detail-view {
  display: grid;
  gap: 14px;
}

.detail-view h4 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 21px;
}

.detail-block {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfffe;
}

.detail-block strong {
  display: block;
  margin-bottom: 6px;
  color: var(--teal-2);
}

.detail-block p {
  margin: 0;
  color: #263f39;
  line-height: 1.65;
}

.detail-actions {
  justify-content: flex-start;
  padding-top: 4px;
}

.room-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.room-chip {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 18px rgba(23, 53, 47, .04);
}

.room-chip strong,
.room-chip span {
  display: block;
}

.room-chip strong {
  font-size: 15px;
  line-height: 1.15;
}

.room-chip span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.room-chip.active {
  border-color: rgba(0, 137, 123, .55);
  background: #effdfa;
  box-shadow: 0 0 0 3px rgba(66, 211, 199, .2);
}

.profile-editor {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.schedule-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.schedule-card h3 {
  margin: 10px 0 6px;
  font-size: 18px;
}

.schedule-card p {
  margin: 0 0 12px;
  color: #314d47;
  line-height: 1.45;
}

.attachment-preview {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.attachment-preview img {
  width: 100%;
  max-height: 260px;
  display: block;
  object-fit: cover;
}

.attachment-link {
  margin-top: 10px;
}

.attachment-note {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.weekly-report-card .actions,
.schedule-actions {
  margin-top: 12px;
}

.weekly-recap {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfffe;
}

.weekly-recap-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.weekly-recap-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.weekly-recap-head span,
.weekly-recap-card small,
.weekly-recap-card > div > span {
  color: var(--muted);
}

.weekly-recap-head span {
  font-weight: 700;
}

.weekly-recap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.weekly-recap-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.weekly-recap-card strong,
.weekly-recap-card span,
.weekly-recap-card small {
  display: block;
}

.weekly-recap-card strong {
  overflow-wrap: anywhere;
}

.weekly-recap-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.weekly-recap-count b {
  font-size: 28px;
  line-height: 1;
}

.weekly-recap-count span {
  font-weight: 700;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfffe;
  color: var(--ink);
  font-weight: 800;
}

.check-field input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--teal-2);
  flex: none;
}

.check-field span {
  line-height: 1.35;
}

.task-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfffe;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap th:last-child,
.table-wrap td:last-child {
  width: 1%;
  white-space: nowrap;
}

.table-wrap .actions {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: max-content;
}

.table-wrap .actions .btn {
  min-width: 48px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.table-wrap .actions .btn.icon-only {
  min-width: 34px;
  width: 34px;
  min-height: 34px;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #fff;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--soft);
  color: var(--teal-2);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, .7);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 38, 34, .54);
}

.modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
}

.modal-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-title h3 {
  max-width: 520px;
  font-size: 24px;
  line-height: 1.15;
  color: var(--teal-2);
  overflow-wrap: normal;
}

.modal-close {
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  border-color: var(--teal);
  border-radius: 11px;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 12px 26px rgba(0, 137, 123, .18);
}

.modal-close svg {
  width: 22px;
  height: 22px;
  color: #fff;
  stroke: #fff !important;
  transform: rotate(45deg);
  transform-origin: center;
  pointer-events: none;
}

.modal-close svg * {
  stroke: #fff !important;
}

.modal-close:hover,
.modal-close:focus,
.modal-close:active {
  border-color: var(--teal-2);
  background: var(--teal-2);
  color: #fff;
}

.modal-close:active {
  transform: scale(.96);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: 360px;
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

@media print {
  .sidebar,
  .topbar,
  .btn,
  .modal-backdrop {
    display: none !important;
  }

  .layout,
  .main {
    display: block;
    padding: 0;
  }
}

@media (max-width: 1020px) {
  .login-page,
  .layout,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .layout {
    display: block;
    width: 100%;
    max-width: 100%;
    background: #e9fbf7;
    overflow-x: hidden;
  }

  .sidebar,
  .main,
  .topbar,
  .stats-grid,
  .panel-grid,
  .work-grid {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .login-page {
    max-width: 620px;
    margin: 0 auto;
  }

  .brand-panel {
    min-height: auto;
  }

  .login-card {
    min-height: auto;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .nav button {
    min-height: 58px;
    font-size: 18px;
  }

  .nav-icon {
    width: 38px;
    height: 38px;
  }

  .nav-section {
    grid-column: 1 / -1;
  }

  .stats-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .topbar {
    display: grid;
    min-height: auto;
  }

  .top-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }

  .top-actions > * {
    min-width: 0;
  }

  .status-pill {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .search-box {
    width: 100%;
    min-width: 0;
  }

  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-wrap table {
    border-collapse: separate;
    background: transparent;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody {
    display: grid;
    gap: 12px;
  }

  .table-wrap tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(23, 53, 47, .05);
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 7px 0;
    border-bottom: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--teal-2);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
  }

  .table-wrap td[colspan] {
    display: block;
    padding: 14px;
  }

  .table-wrap td[colspan]::before {
    content: none;
  }

  .table-wrap th:last-child,
  .table-wrap td:last-child {
    width: 100%;
    white-space: normal;
  }

  .table-wrap td[data-label="Aksi"] {
    grid-template-columns: 1fr;
    padding-top: 12px;
  }

  .table-wrap td[data-label="Aksi"]::before {
    content: none;
  }

  .table-wrap td[data-label="Aksi"] .actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .table-wrap td[data-label="Aksi"] .btn {
    min-width: 46px;
    min-height: 40px;
  }

  .table-wrap td[data-label="Aksi"] .btn.icon-only {
    width: 46px;
    min-width: 46px;
    min-height: 40px;
  }
}

@media (max-width: 660px) {
  .brand-panel,
  .login-card,
  .main {
    padding: 20px;
  }

  .layout .main {
    padding: 0;
  }

  .brand-header {
    align-items: center;
    gap: 12px;
  }

  .brand-header img {
    width: 54px;
    height: 54px;
  }

  .brand-header .logo-fallback {
    width: 54px;
    height: 54px;
    font-size: 11px;
  }

  .brand-header strong {
    font-size: 18px;
    line-height: 1.18;
  }

  .brand-header small {
    font-size: 12px;
    line-height: 1.35;
  }

  .hero-copy {
    text-align: left;
    padding: 30px 0 4px;
  }

  .hero-copy h1 {
    margin: 16px 0 10px;
    font-size: 34px;
    line-height: 1.08;
  }

  .hero-copy p {
    max-width: 300px;
    font-size: 14px;
    line-height: 1.55;
  }

  .hero-copy span,
  .hero-panel span {
    min-height: 32px;
    padding: 5px 14px;
    font-size: 10px;
    letter-spacing: 1.8px;
    text-align: center;
  }

  .login-page {
    align-items: center;
    max-width: none;
    padding: 14px;
    background:
      radial-gradient(circle at 76% 16%, rgba(210, 161, 42, .22), transparent 12rem),
      linear-gradient(135deg, rgba(12, 169, 148, .14), rgba(255, 255, 255, .78)),
      var(--paper);
  }

  .brand-panel {
    min-height: auto;
    margin: 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .login-card {
    margin: 0;
    min-height: 0;
    padding: 26px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .login-card::before {
    display: none;
  }

  .login-brand {
    align-items: center;
    gap: 14px;
    min-height: 0;
    margin-bottom: 22px;
    padding: 0;
  }

  .login-logo {
    display: block;
    width: 58px;
    height: 58px;
  }

  .logo-fallback.login-logo {
    display: grid;
    width: 58px;
    height: 58px;
  }

  .login-brand h1 {
    font-size: 28px;
  }

  .login-brand p {
    font-size: 14px;
  }

  .login-card h2 {
    font-size: 36px;
  }

  .login-kicker,
  .login-card h2,
  .login-card form,
  .login-card .demo-box {
    width: 100%;
  }

  .login-card .btn.primary {
    min-height: 54px;
  }

  .topbar,
  .section-title,
  .panel-head,
  .item-head,
  .hero-panel {
    display: grid;
    max-width: 100%;
    min-width: 0;
  }

  .topbar {
    gap: 16px;
    padding: 22px 18px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .topbar.dashboard-topbar {
    min-height: 156px;
  }

  .dashboard-topbar .top-summary {
    min-height: 82px;
    padding-left: 0;
  }

  .topbar.dashboard-topbar h1 {
    font-size: 36px;
    white-space: normal;
  }

  .eyebrow {
    font-size: 13px;
  }

  .dashboard-label {
    font-size: 24px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px 52px;
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }

  .top-summary {
    max-width: none;
  }

  .top-summary .muted {
    font-size: 17px;
  }

  .top-actions .search-box {
    grid-column: 1 / -1;
  }

  .search-box input {
    min-height: 52px;
    font-size: 18px;
  }

  .status-pill {
    justify-content: center;
    min-height: 44px;
    font-size: 15px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 18px;
    margin-bottom: 18px;
  }

  .stat {
    min-height: 104px;
    padding: 18px;
  }

  .stat > div span {
    font-size: 17px;
  }

  .stat strong {
    font-size: 30px;
  }

  .panel {
    margin: 0 18px 18px;
    padding: 20px;
    width: auto;
    max-width: calc(100vw - 36px);
    overflow-x: hidden;
  }

  .panel-grid {
    margin-left: 18px;
    margin-right: 18px;
    max-width: calc(100vw - 36px);
  }

  .section-title h2 {
    font-size: 24px;
  }

  .section-title p {
    font-size: 17px;
  }

  .weekly-recap {
    padding: 14px;
  }

  .weekly-recap-head {
    display: grid;
    gap: 4px;
  }

  .weekly-recap-grid {
    grid-template-columns: 1fr;
  }

  .work-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .work-tile {
    min-height: 118px;
  }

  .work-tile strong {
    font-size: 21px;
  }

  .date-pill,
  .actions,
  .btn {
    width: 100%;
  }

  .modal-close {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
  }

  .modal-title h3 {
    max-width: min(420px, calc(100vw - 128px));
  }

  .top-actions .btn.icon-only.top-icon,
  .actions .btn.icon-only,
  .actions .btn.compact {
    width: auto;
  }

  .top-actions .btn.icon-only.top-icon {
    width: 52px;
    min-width: 52px;
    min-height: 52px;
  }

  .table-wrap .actions,
  .table-wrap .actions .btn {
    width: auto;
  }

  html,
  body,
  .app-shell,
  .layout,
  .main {
    max-width: 100%;
    overflow-x: hidden;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-wrap table {
    border-collapse: separate;
    background: transparent;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody {
    display: grid;
    gap: 12px;
  }

  .table-wrap tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(23, 53, 47, .05);
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 7px 0;
    border-bottom: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--teal-2);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
  }

  .table-wrap td[colspan] {
    display: block;
    padding: 14px;
  }

  .table-wrap td[colspan]::before {
    content: none;
  }

  .table-wrap th:last-child,
  .table-wrap td:last-child {
    width: 100%;
    white-space: normal;
  }

  .table-wrap td[data-label="Aksi"] {
    grid-template-columns: 1fr;
    padding-top: 12px;
  }

  .table-wrap td[data-label="Aksi"]::before {
    content: none;
  }

  .table-wrap td[data-label="Aksi"] .actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .table-wrap td[data-label="Aksi"] .btn {
    min-width: 46px;
    min-height: 40px;
  }

  .table-wrap td[data-label="Aksi"] .btn.icon-only {
    width: 46px;
    min-width: 46px;
    min-height: 40px;
  }

  .stats-grid,
  .form-grid,
  .nav,
  .task-block {
    grid-template-columns: 1fr;
  }

  .journal-card .item-head {
    grid-template-columns: 1fr;
  }

  .journal-card .journal-actions {
    grid-template-columns: repeat(3, 52px);
    justify-content: end;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    margin-top: 14px;
  }

  .journal-card .journal-actions .btn.icon-only {
    width: 52px;
    min-width: 52px;
    min-height: 52px;
  }

  .dashboard-log-card .journal-actions {
    grid-template-columns: repeat(3, 52px);
    justify-content: end;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    margin-top: 14px;
  }
}
