/* FILE: styles.css */

:root {
  --bg: #FAF9F7;
  --surface: #FFFFFF;
  --ink: #1B2D4F;
  --text: #1C1C1C;
  --muted: #64748B;
  --faint: #94A3B8;
  --line: #EEF2F7;
  --soft: #F1F5F9;
  --blue: #1B6CA8;
  --blue-soft: #E8F2FB;
  --red: #C8392B;
  --red-soft: #FBF0EF;
  --orange: #E89024;
  --orange-soft: #FFF3E4;
  --green: #1A7A4A;
  --green-soft: #EAF6EF;
  --graphite: #141819;
  --graphite-2: #1A1D1F;
  --graphite-soft: #252A2D;
  --surface-warm: #F7F3EE;
  --border-warm: #E8E4DF;
  --border-medium: #D8D2CB;
  --text-secondary: #5A5A5A;
  --text-muted: #9A9690;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #FAF9F7;
  color: var(--text);
  font-family: "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
  background: #FAF9F7;
}

.grid-bg {
  background-color: #FAF9F7;
  background-image:
    linear-gradient(rgba(0, 0, 0, .042) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, .042) 1px, transparent 1px);
  background-size: 32px 32px;
}

.content-area,
.page-dashboard,
.page-customers,
.page-teams,
.page-analytics {
  background-color: #FAF9F7;
  background-image:
    linear-gradient(rgba(0, 0, 0, .042) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, .042) 1px, transparent 1px);
  background-size: 32px 32px;
}

.s-pending {
  background: #FEF3E8;
  color: #E07B2A;
}

.s-traveling {
  background: #E3F2FD;
  color: #1565C0;
}

.s-working {
  background: #E8F5E9;
  color: #2E7D32;
}

.s-done {
  background: #F3E5F5;
  color: #6A1B9A;
}

.s-paid {
  background: #E8F5E9;
  color: #1A7A4A;
}

.busy-block {
  background: #FEF3E8;
  border-color: #E07B2A;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .62;
  cursor: wait;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  vertical-align: middle;
  line-height: 1;
}

.material-symbols-outlined.filled,
.filled {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.auth-shell {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FAF9F7;
}

.brand-card {
  width: min(420px, 100%);
  background: #FFFFFF;
  border: 0.5px solid #E8E4DF;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 18px 50px rgba(28, 28, 28, .08);
}

.brand-logo {
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.brand-logo span {
  color: #C8392B;
}

.brand-tagline {
  color: #5A5A5A;
  font-size: 14px;
  margin-bottom: 28px;
}

.brand-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.35;
}

.brand-card p {
  margin: 0 0 22px;
  color: #5A5A5A;
  font-size: 14px;
  line-height: 1.65;
}

.spinner {
  width: 32px;
  height: 32px;
  margin: 0 0 18px;
  border: 3px solid #E8E4DF;
  border-top-color: #C8392B;
  border-radius: 999px;
  animation: spin .8s linear infinite;
}

.initial-loader-mascot {
  width: 78px;
  height: 78px;
  margin: 0 0 18px;
  display: grid;
  place-items: center;
  padding: 7px;
  overflow: hidden;
  border-radius: 22px;
  background: #FBF0EF;
  box-shadow: 0 0 0 1px rgba(200, 57, 43, .10);
  animation: beavyLoaderPulse 1.3s ease-in-out infinite;
}

.initial-loader-mascot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes beavyLoaderPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(200, 57, 43, .18);
  }

  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 10px rgba(200, 57, 43, 0);
  }
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: #5A5A5A;
  font-size: 13px;
  font-weight: 700;
}

.field input {
  width: 100%;
  border: 0.5px solid #D8D3CD;
  border-radius: 12px;
  padding: 13px 14px;
  background: #FFFFFF;
  color: var(--text);
  outline: none;
  font-size: 15px;
}

.field input:focus {
  border-color: #C8392B;
  box-shadow: 0 0 0 3px rgba(200, 57, 43, .10);
}

.primary-btn {
  margin-top: 4px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  color: #FFFFFF;
  background: #C8392B;
  font-size: 15px;
  font-weight: 800;
}

.login-links {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-top: 14px;
}

.auth-text-link {
  border: 0;
  background: transparent;
  color: #64748B;
  cursor: pointer;
  font-family: "Noto Sans Thai", sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
}

.auth-text-link:hover,
.auth-text-link:focus {
  color: #C8392B;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-text-link.strong {
  color: #1B2D4F;
}

.forgot-password-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #EEF2F7;
  border-radius: 14px;
  background: #FFFFFF;
}

.forgot-password-panel[hidden] {
  display: none;
}

.secondary-auth-btn {
  width: 100%;
  min-height: 42px;
  border: 1px solid #E8E4DF;
  border-radius: 11px;
  background: #FAF9F7;
  color: #1B2D4F;
  cursor: pointer;
  font-family: "Noto Sans Thai", sans-serif;
  font-size: 13px;
  font-weight: 900;
}

.secondary-auth-btn:disabled {
  cursor: wait;
  opacity: .68;
}

.auth-neutral-message {
  padding: 10px 12px;
  border: 1px solid rgba(26, 122, 74, .18);
  border-radius: 11px;
  background: #F0FAF5;
  color: #1A7A4A;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.auth-neutral-message[hidden] {
  display: none;
}

.error-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #FBF0EF;
  border: 0.5px solid rgba(200, 57, 43, .25);
  color: #C8392B;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.dashboard-error {
  margin: 0 0 16px;
}

#view-dashboard.is-active {
  min-height: 100vh;
  background: var(--bg);
}

.expired-shell {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FAF9F7;
}

.expired-card {
  width: min(440px, 100%);
  border: 0.5px solid #E8E4DF;
  border-radius: 20px;
  padding: 34px 28px;
  background: #FFFFFF;
  text-align: center;
  box-shadow: 0 18px 50px rgba(28, 28, 28, .08);
}

.expired-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--red);
  background: var(--red-soft);
}

.expired-icon span {
  font-size: 30px;
}

.expired-card h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.3;
  font-weight: 800;
}

.expired-card p {
  margin: 0 auto 22px;
  max-width: 330px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.expired-cta {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  color: #FFFFFF;
  background: var(--red);
  font-size: 14px;
  font-weight: 800;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-brand {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.app-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--blue);
}

.app-mark span {
  color: #FFFFFF;
  font-size: 18px;
}

.header-shop {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.tier-badge {
  flex: 0 0 auto;
  border-radius: 20px;
  padding: 2px 8px;
  background: var(--soft);
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
}

.header-actions {
  min-width: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.app-header .primary,
.app-header .primary-btn,
.app-header .btn.red,
.app-header .ledger-btn.primary,
.topbar > .primary,
.topbar > .primary-btn,
.topbar > .btn.red,
.header > .primary,
.header > .primary-btn {
  color: #FFFFFF !important;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 10px 20px;
  white-space: nowrap;
  gap: 6px;
}

.app-header .primary span,
.app-header .primary-btn span,
.app-header .btn.red span,
.app-header .ledger-btn.primary span,
.topbar > .primary span,
.topbar > .primary-btn span,
.topbar > .btn.red span,
.header > .primary span,
.header > .primary-btn span {
  color: #FFFFFF !important;
  font-size: 15px;
  font-weight: 600;
}

.date-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 20px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.date-pill span:first-child {
  font-size: 15px;
}

.refresh-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  width: 220px;
  height: 100vh;
  padding-top: 72px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #FFFFFF;
  border-right: 1px solid var(--line);
}

.nav-wrap {
  flex: 1;
  padding: 16px 12px;
}

.nav-title {
  padding: 8px 14px;
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.nav-link {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  transition: all .15s;
}

.nav-link:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.nav-link.active {
  background: var(--blue);
  color: #FFFFFF;
  font-weight: 700;
}

.nav-link span:first-child {
  font-size: 20px;
}

.sidebar-profile {
  padding: 16px;
  border-top: 1px solid var(--line);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--blue);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
}

.profile-copy {
  min-width: 0;
}

.profile-copy div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.profile-copy span {
  color: var(--faint);
  font-size: 11px;
}

.logout-btn {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 13px;
  font-weight: 800;
}

.logout-btn span:first-child {
  font-size: 16px;
}

.dashboard-main {
  min-height: 100vh;
  padding-top: 72px;
  padding-bottom: 100px;
  margin-left: 220px;
}

.master-main {
  min-height: 100vh;
  padding-top: 72px;
  padding-bottom: 80px;
  background: var(--bg);
}

.master-content {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px 20px 0;
}

.expiry-banner {
  margin: 0 20px 16px;
  border: 1px solid #FFE7BF;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #9A5B00;
  background: #FFF9ED;
}

.expiry-banner[hidden] {
  display: none;
}

.expiry-banner.urgent {
  border-color: var(--red-soft);
  color: var(--red);
  background: #FEF9F9;
}

.expiry-banner-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.expiry-banner-copy .material-symbols-outlined {
  flex: 0 0 auto;
  font-size: 20px;
}

.expiry-banner button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  color: #FFFFFF;
  background: var(--orange);
  font-size: 13px;
  font-weight: 800;
}

.expiry-banner.urgent button {
  background: var(--red);
}

.dashboard-content {
  padding: 24px 20px 0;
}

.page-title {
  margin-bottom: 24px;
}

.page-title h1 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
}

.page-title p {
  margin: 0;
  color: var(--faint);
  font-size: 14px;
}

.card {
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.master-panel {
  overflow: hidden;
}

.master-panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.master-panel-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.master-panel-head p {
  margin: 5px 0 0;
  color: var(--faint);
  font-size: 13px;
}

.tenant-list {
  display: grid;
}

.tenant-row {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.tenant-row:last-child {
  border-bottom: 0;
}

.tenant-main {
  min-width: 0;
}

.tenant-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tenant-title-row h3 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.tenant-status {
  flex: 0 0 auto;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
}

.tenant-status.active {
  color: #1A7A4A;
  background: var(--green-soft);
}

.tenant-status.expiring {
  color: #9A5B00;
  background: #FFF9ED;
}

.tenant-status.expired {
  color: var(--red);
  background: var(--red-soft);
}

.tenant-meta {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 12px;
}

.tenant-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.extend-btn,
.slip-link,
.no-slip {
  min-height: 34px;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.extend-btn {
  border: 0;
  color: #FFFFFF;
  background: var(--blue);
}

.slip-link {
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  text-decoration: none;
}

.no-slip {
  display: inline-flex;
  align-items: center;
  color: var(--faint);
  background: var(--soft);
}

.tenant-skeleton {
  padding: 20px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  max-width: min(360px, calc(100vw - 40px));
  border-radius: 14px;
  padding: 12px 14px;
  color: #FFFFFF;
  background: var(--ink);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 28px rgba(15, 23, 42, .24);
}

.toast[hidden] {
  display: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 22px 24px;
  border-left: 4px solid var(--blue);
}

.stat-card.orange {
  border-left-color: var(--orange);
}

.stat-card.green {
  border-left-color: var(--green);
}

.stat-card.gray {
  border-left-color: var(--faint);
}

.stat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.stat-head > .material-symbols-outlined {
  color: var(--blue);
  font-size: 22px;
}

.stat-card.orange .stat-head > .material-symbols-outlined {
  color: var(--orange);
}

.stat-card.green .stat-head > .material-symbols-outlined {
  color: var(--green);
}

.stat-card.gray .stat-head > .material-symbols-outlined {
  color: var(--faint);
}

.stat-chip,
.live-chip {
  border-radius: 20px;
  padding: 2px 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.stat-card.orange .stat-chip {
  background: var(--orange-soft);
  color: var(--orange);
}

.stat-card.gray .stat-chip {
  background: var(--soft);
  color: var(--muted);
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--green);
}

.live-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--green);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

.stat-value {
  color: var(--ink);
  font-size: 36px;
  line-height: 1;
  font-weight: 800;
}

.stat-label {
  margin-top: 4px;
  color: var(--faint);
  font-size: 13px;
}

.income-section {
  padding: 0 20px 8px;
}

.income-card {
  margin-bottom: 12px;
  border: .5px solid #E8E4DF;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-eyebrow {
  margin-bottom: 8px;
  color: #AAAAAA;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.income-today {
  color: var(--text);
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.income-today .currency-symbol {
  font-size: 1em;
  line-height: 1;
  font-weight: inherit;
}

.money-positive {
  color: #1A7A4A;
}

.income-foot {
  margin-top: 4px;
  color: #AAAAAA;
  font-size: 12px;
}

.income-month-summary {
  text-align: right;
}

.income-month {
  color: #5A5A5A;
  font-size: 18px;
  font-weight: 600;
}

.small-blue-btn {
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.spark-card {
  border: .5px solid #E8E4DF;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.spark-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.spark-head span {
  color: #AAAAAA;
  font-size: 11px;
  font-weight: 400;
}

.spark-bars {
  height: 44px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.spark-bars > .skel {
  width: 100%;
  height: 44px;
}

.spark-bar-wrap {
  min-width: 0;
  height: 44px;
  flex: 1;
  display: flex;
  align-items: flex-end;
}

.spark-bar-wrap span {
  width: 100%;
  min-width: 3px;
  border-radius: 3px 3px 0 0;
  background: #E8E4DF;
}

.spark-bar-wrap span.has-income {
  background: #1A7A4A;
}

.spark-bar-wrap span.today {
  background: #C8392B;
  box-shadow: 0 0 0 1.5px #C8392B;
}

.spark-empty {
  width: 100%;
  color: #AAAAAA;
  font-size: 12px;
  text-align: center;
  align-self: center;
}

.spark-labels {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.spark-labels div {
  min-width: 0;
  flex: 1;
  color: #AAAAAA;
  font-size: 9px;
  text-align: center;
}

.spark-labels div.today {
  color: #C8392B;
  font-weight: 700;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  align-items: start;
}

.jobs-card,
.compact-card {
  padding: 20px;
}

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

.panel-title-row h2,
.compact-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.compact-card h3 {
  margin-bottom: 16px;
  font-size: 15px;
}

.link-btn {
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--blue);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.link-btn .material-symbols-outlined {
  font-size: 16px;
}

.job-list-box {
  display: grid;
  gap: 0;
}

.job-row {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  text-align: left;
  transition: background .12s;
}

.job-row:hover {
  background: var(--bg);
}

.job-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.job-icon span {
  font-size: 18px;
}

.job-copy {
  min-width: 0;
  flex: 1;
  display: block;
}

.job-copy strong,
.job-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.job-copy small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 12px;
}

.job-side {
  flex: 0 0 auto;
  text-align: right;
}

.job-side small {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.team-load-box {
  display: grid;
}

.team-load-row {
  margin-bottom: 16px;
}

.team-load-row:last-child {
  margin-bottom: 0;
}

.team-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.team-name-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.team-name-wrap span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
}

.team-name-wrap strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.team-line b {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 13px;
}

.progress-bar {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--blue-soft);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.reminder-card {
  border: 1.5px solid var(--red-soft);
}

.reminder-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.reminder-heading span {
  color: var(--red);
  font-size: 20px;
}

.reminder-heading h3 {
  margin: 0;
  color: var(--red);
  font-size: 15px;
  font-weight: 800;
}

.reminder-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.reminder-summary strong {
  color: var(--red);
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
}

.reminder-summary span {
  color: var(--faint);
  font-size: 12px;
}

.reminder-item {
  border: 1px solid #FFE7BF;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #FFF9ED;
  color: var(--ink);
  font-size: 13px;
}

.reminder-item.overdue {
  border-color: var(--red-soft);
  background: #FEF9F9;
}

.reminder-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.reminder-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.reminder-top span {
  flex: 0 0 auto;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
}

.reminder-item.overdue .reminder-top span {
  color: var(--red);
}

.reminder-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.reminder-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.reminder-actions a,
.reminder-actions button {
  border: 0;
  border-radius: 20px;
  padding: 4px 10px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.reminder-actions a {
  color: var(--blue);
  background: var(--blue-soft);
}

.reminder-actions button {
  color: var(--green);
  background: var(--green-soft);
}

.reminder-more {
  padding: 4px 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.cache-note {
  margin-top: 2px;
  color: #CBD5E1;
  font-size: 10px;
  text-align: center;
}

.empty-box {
  padding: 40px;
  color: var(--faint);
  text-align: center;
}

#view-dashboard.is-active {
  background: var(--bg);
}

#view-dashboard .app-header {
  left: 248px;
  height: 72px;
  padding: 0 30px;
  background: rgba(250, 249, 247, .88);
  border-bottom: 0;
  backdrop-filter: blur(14px);
}

#view-dashboard .app-mark {
  background: var(--graphite);
}

#view-dashboard .header-shop {
  color: var(--text);
}

#view-dashboard .tier-badge {
  background: var(--surface-warm);
  color: var(--text-muted);
  border: 1px solid var(--border-warm);
}

#view-dashboard .refresh-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

#view-dashboard .date-pill {
  height: 40px;
  border: 1px solid var(--border-warm);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
}

#view-dashboard .sidebar {
  width: 248px;
  padding: 26px 18px;
  gap: 28px;
  background: var(--graphite);
  border-right: 1px solid rgba(255, 255, 255, .08);
}

#view-dashboard .nav-wrap {
  padding: 0;
}

.sidebar-logo {
  padding: 0 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-logo-word {
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 31px;
  line-height: 1;
  font-weight: 700;
}

.sidebar-logo-word .logo-b {
  color: #FFFFFF;
}

.sidebar-logo-word .logo-eavy {
  color: var(--red);
}

.sidebar-logo-sub {
  margin-top: 8px;
  color: rgba(244, 241, 236, .58);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

#view-dashboard .nav-title {
  padding: 0 10px;
  margin: 0 0 8px;
  color: rgba(244, 241, 236, .42);
  font-size: 11px;
  letter-spacing: .08em;
}

#view-dashboard .nav-link {
  min-height: 42px;
  border-radius: 10px;
  color: rgba(244, 241, 236, .72);
  font-weight: 600;
  text-decoration: none;
}

#view-dashboard .nav-link:hover {
  background: rgba(255, 255, 255, .06);
  color: #FFFFFF;
}

#view-dashboard .nav-link.active {
  position: relative;
  background: rgba(200, 57, 43, .13);
  color: #FFFFFF;
}

#view-dashboard .nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--red);
}

#view-dashboard .nav-link span:first-child {
  color: rgba(244, 241, 236, .58);
}

#view-dashboard .nav-link.active span:first-child {
  color: var(--red);
}

#view-dashboard .sidebar-profile {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}

#view-dashboard .profile-card {
  padding: 0;
  background: transparent;
}

#view-dashboard .profile-avatar {
  border-radius: 12px;
  background: var(--surface-warm);
  color: var(--red);
}

#view-dashboard .profile-copy div {
  color: #F4F1EC;
}

#view-dashboard .profile-copy span {
  color: rgba(244, 241, 236, .52);
}

#view-dashboard .logout-btn {
  background: rgba(200, 57, 43, .14);
  color: #F4F1EC;
}

.dashboard-main {
  margin-left: 248px;
  padding-top: 72px;
  background: var(--bg);
}

.dashboard-content {
  max-width: 1480px;
  margin: 0 auto;
  padding: 12px 30px 34px;
}

.dashboard-topbar {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-eyebrow {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dashboard-topbar h1 {
  margin: 0;
  color: var(--text);
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
}

.dashboard-topbar p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.dashboard-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ledger-btn {
  min-height: 40px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.ledger-btn.primary {
  border-color: var(--red);
  background: var(--red);
  color: #FFFFFF;
}

.ledger-btn .material-symbols-outlined {
  font-size: 18px;
}

.dashboard-ledger-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 326px;
  gap: 22px;
  align-items: start;
}

.dashboard-ledger-stack,
.dashboard-right-rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ledger-panel,
.rail-panel {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-warm);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(20, 24, 25, .06);
}

.ledger-panel-header,
.rail-header {
  min-height: 58px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-warm);
  background: linear-gradient(180deg, #FFFFFF 0%, #FEFCFA 100%);
}

.ledger-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 900;
}

.ledger-title span {
  min-width: 24px;
  color: var(--red);
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 12px;
  letter-spacing: .08em;
}

.ledger-meta {
  color: var(--text-muted);
  font-size: 12px;
}

.ledger-panel-body {
  padding: 0 18px 18px;
}

.kpi-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border-warm);
}

.stat-card {
  min-height: 132px;
  padding: 18px 18px 16px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
  position: relative;
}

.stat-card.important::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 999px;
  background: var(--red);
}

.stat-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.stat-value {
  margin-top: 8px;
  color: var(--text);
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 36px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

.stat-note {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.jobs-card,
.compact-card {
  padding: 0;
}

.job-list-box {
  position: relative;
  display: flex;
  flex-direction: column;
}

.job-board-head {
  min-height: 38px;
  display: grid;
  grid-template-columns: 104px minmax(160px, 1.15fr) minmax(130px, 1fr) 112px 116px;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--border-warm);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.job-board-head span:last-child {
  text-align: right;
}

.job-status-group + .job-status-group {
  border-top: 1px solid var(--border-warm);
}

.job-status-heading {
  min-height: 34px;
  padding: 0 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}

.job-status-heading b {
  color: var(--red);
}

.ledger-job-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: 104px minmax(160px, 1.15fr) minmax(130px, 1fr) 112px 116px;
  gap: 14px;
  align-items: center;
  border-radius: 0;
  border-bottom: 1px solid rgba(232, 228, 223, .72);
  padding: 0;
  position: relative;
}

.ledger-job-row:last-child {
  border-bottom: 0;
}

.ledger-job-row:hover {
  background: #FEFCFA;
}

.job-time {
  height: 100%;
  padding-left: 18px;
  display: flex;
  align-items: center;
  color: var(--text);
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 15px;
  font-weight: 700;
  position: relative;
}

.job-time::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #D8D2CB;
  box-shadow: 0 0 0 4px #FAF9F7;
  transform: translateY(-50%);
}

.job-time::after {
  content: "";
  position: absolute;
  left: 5px;
  top: -50%;
  bottom: -50%;
  width: 1px;
  background: rgba(216, 210, 203, .58);
  z-index: 0;
}

.job-time {
  z-index: 1;
}

.job-copy strong,
.job-customer strong,
.team-name-wrap strong {
  color: var(--text);
}

.job-copy small,
.job-customer small,
.team-name-wrap small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.job-team {
  color: var(--text-secondary);
  font-weight: 700;
}

.stamp {
  justify-self: end;
  min-width: 92px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--surface-warm);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.stamp-pending {
  color: #87500B;
  background: #FFF3E4;
  border-color: #F0D2A4;
}

.stamp-traveling {
  color: #155D92;
  background: #EAF3FA;
  border-color: #CDE2F1;
}

.stamp-working {
  color: #8A4514;
  background: #FFF0DE;
  border-color: #F3CEA1;
}

.stamp-done {
  color: var(--green);
  background: #EAF6EF;
  border-color: #CDECD7;
}

.stamp-paid {
  color: #FFFFFF;
  background: var(--green);
  border-color: var(--green);
}

.stamp-cancelled {
  color: var(--red);
  background: var(--red-soft);
  border-color: #F1C9C5;
}

.dashboard-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  gap: 18px;
}

.income-section {
  padding: 0;
}

.revenue-body {
  padding: 20px 20px 18px;
}

.revenue-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.income-today {
  color: var(--text);
  font-size: 34px;
  letter-spacing: 0;
}

.income-month,
.data-value {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.income-foot {
  color: var(--text-muted);
}

.spark-card {
  width: min(260px, 48%);
  min-width: 210px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.spark-bars {
  height: 58px;
  gap: 4px;
}

.spark-bar-wrap {
  height: 58px;
}

.spark-bar-wrap span {
  border-radius: 99px 99px 0 0;
  background: #DDD7D0;
}

.spark-bar-wrap span.has-income {
  background: var(--green);
}

.spark-bar-wrap span.today {
  background: var(--red);
  box-shadow: none;
}

.revenue-lines {
  margin-top: 18px;
  border-top: 1px solid var(--border-warm);
}

.data-line {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-warm);
}

.data-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.dashboard-cost-summary { display: grid; gap: 4px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.dashboard-cost-summary a { color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }
.cost-negative { color: #E07B2A; }
.monthly-cost-summary { display: grid; gap: 8px; }
.monthly-cost-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 10px 0; color: var(--text-secondary); font-weight: 800; }
.monthly-cost-row:last-child { border-bottom: 0; }
.monthly-cost-row strong { color: var(--text); }
.monthly-cost-row.cost-negative strong { color: #E07B2A; }
.monthly-cost-row.net strong { color: #1A7A4A; font-size: 20px; }
.monthly-cost-breakdown { padding-left: 18px; color: var(--text-muted); font-size: 12px; }

.data-label {
  color: var(--text-secondary);
}

.team-load-box {
  padding: 6px 18px 18px;
}

.team-card-row {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-warm);
}

.team-card-row:last-child {
  border-bottom: 0;
}

.team-line {
  margin: 0 0 8px;
}

.team-name-wrap span {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-warm);
  border: 1px solid var(--border-warm);
  color: var(--red);
}

.progress-bar {
  height: 3px;
  background: #ECE7E1;
}

.rail-panel {
  box-shadow: 0 20px 50px rgba(20, 24, 25, .06);
}

.rail-header {
  min-height: 58px;
}

.rail-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.rail-body,
#reminderBox .rail-body {
  padding: 8px 17px 17px;
}

.rail-body > .muted-text,
#reminderBox .rail-body > .muted-text {
  padding: 12px 0 0;
  background: transparent;
}

.reminder-card {
  border: 1px solid rgba(255, 255, 255, .08);
  background: var(--graphite-2);
  color: #F4F1EC;
}

.reminder-card .rail-header {
  border-bottom-color: rgba(255, 255, 255, .08);
  background: transparent;
}

.reminder-card .rail-title {
  color: #FFFFFF;
}

.reminder-card .muted-text,
.reminder-card .reminder-summary span,
.reminder-card .cache-note {
  color: rgba(244, 241, 236, .55);
}

.reminder-summary strong {
  color: #FFFFFF;
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0;
}

.reminder-item {
  margin: 0;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  border-radius: 0;
  background: transparent;
  color: #F4F1EC;
}

.reminder-item:last-child {
  border-bottom: 0;
}

.reminder-top strong {
  color: #FFFFFF;
}

.reminder-item small {
  color: rgba(244, 241, 236, .55);
}

.reminder-actions a,
.reminder-actions button,
.rail-action {
  min-height: 32px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 6px 11px;
  display: inline-flex;
  align-items: center;
  background: #FFFFFF;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.reminder-actions a {
  background: var(--red);
  border-color: var(--red);
  color: #FFFFFF;
}

.reminder-widget-rows {
  display: grid;
  gap: 10px;
}

.reminder-widget-row {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 4px 10px;
  align-items: center;
  background: rgba(255, 255, 255, .06);
  color: #FFFFFF;
  text-align: left;
  cursor: pointer;
}

.reminder-widget-row .material-symbols-outlined {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.reminder-widget-row strong {
  color: #FFFFFF;
  font-size: 13px;
  line-height: 1.45;
}

.reminder-widget-row small {
  color: rgba(244, 241, 236, .68);
  font-weight: 800;
}

.reminder-widget-row.overdue {
  border-color: rgba(200, 57, 43, .35);
  background: rgba(200, 57, 43, .16);
}

.reminder-widget-row.overdue .material-symbols-outlined {
  background: rgba(200, 57, 43, .25);
  color: #FFD9D4;
}

.reminder-widget-row.warning {
  border-color: rgba(224, 123, 42, .36);
  background: rgba(224, 123, 42, .16);
}

.reminder-widget-row.warning .material-symbols-outlined {
  background: rgba(224, 123, 42, .25);
  color: #FFE3C7;
}

.rail-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-warm);
}

.rail-item:last-child {
  border-bottom: 0;
}

.rail-main {
  color: var(--text);
  font-weight: 900;
}

.rail-sub {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.low-stock-card {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #F0D4B8;
  border-radius: 10px;
  background: #FEF3E8;
  color: #1C1C1C;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.low-stock-card-head,
.low-stock-card-head strong,
.low-stock-card-item {
  display: flex;
  align-items: center;
}

.low-stock-card-head {
  justify-content: space-between;
  gap: 12px;
  color: #1B6CA8;
  font-size: 12px;
  font-weight: 800;
}

.low-stock-card-head strong {
  gap: 5px;
  color: #E07B2A;
  font-size: 13px;
  font-weight: 900;
}

.low-stock-card-head .material-symbols-outlined {
  font-size: 18px;
}

.low-stock-card-list {
  display: grid;
  gap: 9px;
  margin-top: 11px;
}

.low-stock-card-item {
  align-items: flex-start;
  gap: 9px;
}

.low-stock-card-item i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: #E07B2A;
}

.low-stock-card-item.out i {
  background: #C8392B;
}

.low-stock-card-item > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.low-stock-card-item strong,
.low-stock-card-item small,
.low-stock-card-item em,
.low-stock-card-item b {
  color: #1C1C1C;
  font-style: normal;
  text-decoration: none;
}

.low-stock-card-item strong {
  font-size: 13px;
  font-weight: 500;
}

.low-stock-card-item small,
.low-stock-card-item em {
  font-size: 11px;
  font-weight: 700;
}

.low-stock-card-item em {
  color: #E07B2A;
}

.low-stock-card-item.warning small {
  color: #E07B2A;
}

.low-stock-card-item.out small {
  color: #C8392B;
}

.low-stock-card-item b {
  width: fit-content;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(200, 57, 43, .12);
  color: #C8392B;
  font-size: 10px;
  font-weight: 900;
}

.empty-box .material-symbols-outlined {
  display: block;
  margin-bottom: 10px;
  font-size: 42px;
}

.muted-text {
  color: var(--faint);
  font-size: 13px;
}

.skel {
  border-radius: 8px;
  background: linear-gradient(90deg, #F1F5F9 25%, #E8EEF6 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton-text.is-loading {
  color: transparent;
  border-radius: 8px;
  background: linear-gradient(90deg, #F1F5F9 25%, #E8EEF6 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.inline-amount {
  display: inline-block;
  width: 70px;
  height: 18px;
}

.job-skeleton {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--soft);
}

.job-skeleton .icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.line {
  height: 12px;
  margin-bottom: 14px;
}

.line.wide {
  width: 100%;
}

.line.medium {
  width: 80%;
}

.line.short {
  width: 60%;
}

.job-skeleton .line {
  height: 14px;
  margin-bottom: 8px;
}

.job-skeleton .line:not(.wide):not(.medium):not(.short) {
  width: 40%;
  height: 11px;
  margin-bottom: 0;
}

.reminder-skel {
  height: 44px;
  border-radius: 10px;
}

.mobile-dashboard-console {
  display: block;
  margin-bottom: 18px;
}

.command-center .dashboard-ledger-grid {
  display: none;
}

.mobile-command-head {
  margin-bottom: 12px;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border: 0.5px solid var(--border-warm);
  border-radius: 14px;
  background:
    linear-gradient(rgba(232, 228, 223, .45) 1px, transparent 1px),
    #FFFFFF;
  background-size: 100% 30px;
  box-shadow: 0 14px 34px rgba(20, 24, 25, .06);
}

.mobile-command-kicker {
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mobile-command-head h2 {
  margin: 0;
  color: var(--text);
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
}

.mobile-command-head p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.mobile-command-cta {
  min-width: 112px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--red);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(200, 57, 43, .22);
}

.mobile-command-cta .material-symbols-outlined {
  font-size: 19px;
}

.mobile-dashboard-tabs {
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-tab {
  min-height: 38px;
  border: 1px solid var(--border-warm);
  border-radius: 999px;
  padding: 0 14px;
  flex: 1 1 140px;
  background: #FFFFFF;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.mobile-tab.is-active {
  border-color: var(--red);
  background: var(--red);
  color: #FFFFFF;
}

.mobile-panel {
  display: none;
}

.mobile-panel.is-active {
  display: block;
}

.mobile-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mobile-metric,
.mobile-ledger-card,
.mobile-job-card,
.mobile-team-card,
.mobile-alert-card {
  border: 0.5px solid var(--border-warm);
  border-radius: 10px;
  background: #FFFFFF;
  box-shadow: 0 12px 30px rgba(20, 24, 25, .055);
}

.mobile-metric {
  min-height: 118px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.mobile-metric.important::before,
.mobile-metric.money::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  width: 3px;
  border-radius: 999px;
  background: var(--red);
}

.mobile-metric.money::before {
  background: var(--green);
}

.mobile-metric span,
.mobile-ledger-card span {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 900;
}

.mobile-metric strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
}

.mobile-metric small,
.mobile-ledger-card small {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.mobile-ledger-card {
  margin-top: 10px;
  padding: 15px;
}

.mobile-today-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-today-command strong,
.mobile-revenue-card strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 28px;
  line-height: 1.05;
}

.mobile-section-title {
  margin: 17px 2px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 900;
}

.mobile-section-title b {
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--surface-warm);
  color: var(--red);
  font-size: 12px;
}

.mobile-job-card {
  width: 100%;
  min-height: 76px;
  margin-bottom: 9px;
  padding: 12px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  border-left: 3px solid var(--red);
  text-align: left;
}

.mobile-job-time {
  color: var(--text);
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.mobile-job-main {
  min-width: 0;
}

.mobile-job-main strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.mobile-job-main small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.mobile-job-status {
  justify-self: start;
  min-height: 25px;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--text-secondary);
  background: var(--surface-warm);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.mobile-revenue-card.secondary {
  background:
    linear-gradient(rgba(232, 228, 223, .52) 1px, transparent 1px),
    #FFFFFF;
  background-size: 100% 30px;
}

.mobile-panel-action {
  margin-top: 12px;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  padding: 0 13px;
  background: var(--blue);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 900;
}

.expense-tab-card {
  padding: 0;
  overflow: hidden;
}

.expense-tab-head {
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-warm);
  background: var(--surface-warm);
}

.expense-tab-head strong {
  color: var(--text);
  font-size: 14px;
}

.expense-section {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border-warm);
}

.expense-section-total,
.expense-breakdown-row,
.expense-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.expense-section-total span,
.expense-section-total strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.expense-breakdown-row {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.expense-breakdown-row span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.expense-breakdown-row span:last-child {
  flex-shrink: 0;
}

.expense-tab-empty {
  padding: 24px 15px;
  border-bottom: 1px solid var(--border-warm);
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.expense-tab-totals {
  padding: 8px 15px;
  border-bottom: 1px solid var(--border-warm);
}

.expense-total-row {
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 900;
}

.expense-total-row strong {
  color: var(--text);
  font-size: 15px;
}

.expense-total-row.positive strong {
  color: #1A7A4A;
}

.expense-total-row.neutral strong {
  color: #5A5A5A;
}

.expense-total-row.negative strong {
  color: #C8392B;
}

.expense-report-link {
  width: 100%;
  min-height: 44px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.dashboard-week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-week-day {
  min-height: 72px;
  border: 0.5px solid var(--border-warm);
  border-radius: 10px;
  padding: 9px 8px;
  display: grid;
  align-content: center;
  justify-items: center;
  background: #FFFFFF;
  color: var(--text-muted);
  font-weight: 900;
}

.dashboard-week-day strong {
  color: var(--text);
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 22px;
  line-height: 1;
}

.dashboard-week-day small {
  margin-top: 5px;
  font-size: 11px;
}

.dashboard-week-day.today {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.dashboard-week-day.active {
  border-color: var(--blue);
  color: var(--blue);
  background: #E8F2FB;
}

.dashboard-week-day.today.active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-soft);
}

.mobile-empty {
  min-height: 72px;
  padding: 20px 14px;
  display: grid;
  place-items: center;
  border: 0.5px dashed var(--border-warm);
  border-radius: 10px;
  background: rgba(255, 255, 255, .66);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 1180px) {
  .dashboard-ledger-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-right-rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .job-board-head,
  .ledger-job-row {
    grid-template-columns: 82px minmax(160px, 1fr) minmax(130px, .8fr) 104px 112px;
  }
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-lower-grid,
  .dashboard-right-rail {
    grid-template-columns: 1fr;
  }

  .job-board-head,
  .ledger-job-row {
    grid-template-columns: 78px minmax(0, 1fr) auto;
  }

  .job-board-head span:nth-child(3),
  .job-board-head span:nth-child(4),
  .job-customer,
  .job-team {
    display: none;
  }
}

@media (max-width: 768px) {
  .auth-shell {
    padding: 18px;
    align-items: flex-start;
    padding-top: 58px;
  }

  .brand-card {
    padding: 26px 22px;
  }

  .app-header {
    padding: 0 14px;
  }

  .date-pill {
    display: none;
  }

  #view-dashboard .app-header {
    left: 0;
    height: 60px;
    padding: 0 14px;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
  }

  .sidebar {
    display: none;
  }

  .dashboard-main {
    margin-left: 0;
    padding-top: 60px;
  }

  .master-content {
    padding: 20px 14px 0;
  }

  .expiry-banner {
    margin: 0 14px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-content {
    padding: 16px 14px 110px;
  }

  .dashboard-topbar {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 12px;
  }

  .dashboard-topbar h1 {
    font-size: 24px;
  }

  .dashboard-top-actions {
    display: none;
  }

  .ledger-btn {
    width: 100%;
    justify-content: center;
  }

  .dashboard-ledger-grid {
    display: none;
  }

  .mobile-dashboard-console {
    display: block;
  }

  .mobile-command-head {
    margin-bottom: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border: 0.5px solid var(--border-warm);
    border-radius: 14px;
    background:
      linear-gradient(rgba(232, 228, 223, .5) 1px, transparent 1px),
      #FFFFFF;
    background-size: 100% 30px;
    box-shadow: 0 14px 34px rgba(20, 24, 25, .06);
  }

  .mobile-command-kicker {
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .mobile-command-head h2 {
    margin: 0;
    color: var(--text);
    font-family: "Prompt", "Noto Sans Thai", sans-serif;
    font-size: 25px;
    line-height: 1.15;
    font-weight: 700;
  }

  .mobile-command-head p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-command-cta {
    min-width: 104px;
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--red);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(200, 57, 43, .22);
  }

  .mobile-command-cta .material-symbols-outlined {
    font-size: 19px;
  }

  .mobile-dashboard-tabs {
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .mobile-tab {
    min-height: 38px;
    border: 1px solid var(--border-warm);
    border-radius: 999px;
    padding: 0 14px;
    flex: 0 0 auto;
    background: #FFFFFF;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    flex: 1 1 calc(33.333% - 8px);
  }

  .mobile-tab.is-active {
    border-color: var(--red);
    background: var(--red);
    color: #FFFFFF;
  }

  .mobile-panel {
    display: none;
  }

  .mobile-panel.is-active {
    display: block;
  }

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

  .mobile-metric,
  .mobile-ledger-card,
  .mobile-job-card,
  .mobile-team-card,
  .mobile-alert-card {
    border: 0.5px solid var(--border-warm);
    border-radius: 10px;
    background: #FFFFFF;
    box-shadow: 0 12px 30px rgba(20, 24, 25, .055);
  }

  .mobile-metric {
    min-height: 118px;
    padding: 14px;
    position: relative;
    overflow: hidden;
  }

  .mobile-metric.important::before,
  .mobile-metric.money::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15px;
    bottom: 15px;
    width: 3px;
    border-radius: 999px;
    background: var(--red);
  }

  .mobile-metric.money::before {
    background: var(--green);
  }

  .mobile-metric span,
  .mobile-ledger-card span {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-metric strong {
    display: block;
    margin-top: 7px;
    color: var(--text);
    font-family: "Prompt", "Noto Sans Thai", sans-serif;
    font-size: 34px;
    line-height: 1;
    font-weight: 700;
  }

  .mobile-metric small,
  .mobile-ledger-card small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-ledger-card {
    margin-top: 10px;
    padding: 15px;
  }

  .mobile-today-command {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-today-command strong,
  .mobile-revenue-card strong {
    display: block;
    margin-top: 3px;
    color: var(--text);
    font-family: "Prompt", "Noto Sans Thai", sans-serif;
    font-size: 28px;
    line-height: 1.05;
  }

  .mobile-today-command button {
    border: 0;
    border-radius: 10px;
    min-height: 40px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--red);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
  }

  .mobile-section-title {
    margin: 17px 2px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-section-title b {
    min-width: 28px;
    height: 24px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: var(--surface-warm);
    color: var(--red);
    font-size: 12px;
  }

  .mobile-job-card {
    width: 100%;
    min-height: 76px;
    margin-bottom: 9px;
    padding: 12px;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 11px;
    border-left: 3px solid var(--red);
    text-align: left;
  }

  .mobile-job-time {
    color: var(--text);
    font-family: "Prompt", "Noto Sans Thai", sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
  }

  .mobile-job-main {
    min-width: 0;
  }

  .mobile-job-main strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.35;
  }

  .mobile-job-main small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-job-status {
    grid-column: 2;
    justify-self: start;
    min-height: 25px;
    border-radius: 999px;
    padding: 4px 9px;
    color: var(--text-secondary);
    background: var(--surface-warm);
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-revenue-card.secondary {
    background:
      linear-gradient(rgba(232, 228, 223, .52) 1px, transparent 1px),
      #FFFFFF;
    background-size: 100% 30px;
  }

  .mobile-team-card {
    margin-bottom: 10px;
    padding: 13px;
  }

  .mobile-team-top {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
  }

  .mobile-team-top > span {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: #FFFFFF;
    font-weight: 900;
  }

  .mobile-team-top strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
  }

  .mobile-team-top small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-team-top b {
    color: var(--red);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
  }

  .mobile-team-bar {
    height: 4px;
    margin-top: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: #ECE7E1;
  }

  .mobile-team-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
  }

  .mobile-alert-card {
    min-height: 64px;
    margin-bottom: 9px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-alert-card.urgent {
    border-color: rgba(200, 57, 43, .28);
    background: var(--red-soft);
  }

  .mobile-alert-card strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
  }

  .mobile-alert-card small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-alert-card a,
  .mobile-alert-card button {
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    background: var(--red);
    color: #FFFFFF;
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
  }

  .mobile-empty {
    min-height: 72px;
    padding: 20px 14px;
    display: grid;
    place-items: center;
    border: 0.5px dashed var(--border-warm);
    border-radius: 10px;
    background: rgba(255, 255, 255, .66);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 800;
    text-align: center;
  }

  .mobile-command-bar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    min-height: 62px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    background: rgba(20, 24, 25, .96);
    box-shadow: 0 18px 42px rgba(20, 24, 25, .26);
    backdrop-filter: blur(16px);
  }

  .mobile-command-item {
    min-width: 0;
    min-height: 48px;
    border: 0;
    border-radius: 13px;
    padding: 5px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    color: rgba(244, 241, 236, .58);
    text-decoration: none;
    font-size: 11px;
    font-weight: 900;
  }

  .mobile-command-item .material-symbols-outlined {
    font-size: 22px;
  }

  .mobile-command-item.is-active {
    color: #FFFFFF;
    background: rgba(200, 57, 43, .12);
  }

  .mobile-command-item.is-active .material-symbols-outlined {
    color: var(--red);
  }

  .dashboard-fab {
    bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .income-section {
    padding: 0 0 8px;
  }

  .revenue-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .spark-card {
    width: 100%;
  }

  .income-month-summary {
    text-align: left;
  }

  .ledger-job-row {
    align-items: flex-start;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 0;
  }

  .stamp {
    justify-self: start;
  }

  .tenant-row {
    grid-template-columns: 1fr;
  }

  .tenant-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.ledger-shell-view.is-active {
  min-height: 100vh;
  background: var(--bg);
}

.ledger-shell-view .app-header {
  left: 248px;
  height: 72px;
  padding: 0 30px;
  background: rgba(250, 249, 247, .88);
  border-bottom: 0;
  backdrop-filter: blur(14px);
}

.ledger-shell-view .app-mark {
  background: var(--graphite);
}

.ledger-shell-view .header-shop {
  color: var(--text);
}

.ledger-shell-view .tier-badge {
  background: var(--surface-warm);
  color: var(--text-muted);
  border: 1px solid var(--border-warm);
}

.ledger-shell-view .refresh-btn,
.ledger-shell-view .date-pill {
  height: 40px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.ledger-shell-view .refresh-btn {
  width: 40px;
}

.ledger-shell-view .sidebar {
  width: 248px;
  padding: 26px 18px;
  gap: 28px;
  background: var(--graphite);
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.ledger-shell-view .nav-wrap {
  padding: 0;
}

.ledger-shell-view .nav-title {
  padding: 0 10px;
  margin: 0 0 8px;
  color: rgba(244, 241, 236, .42);
  font-size: 11px;
  letter-spacing: .08em;
}

.ledger-shell-view .nav-link {
  min-height: 42px;
  border-radius: 10px;
  color: rgba(244, 241, 236, .72);
  font-weight: 600;
  text-decoration: none;
}

.ledger-shell-view .nav-link:hover {
  background: rgba(255, 255, 255, .06);
  color: #FFFFFF;
}

.ledger-shell-view .nav-link.active {
  position: relative;
  background: rgba(200, 57, 43, .13);
  color: #FFFFFF;
}

.ledger-shell-view .nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--red);
}

.ledger-shell-view .nav-link span:first-child {
  color: rgba(244, 241, 236, .58);
}

.ledger-shell-view .nav-link.active span:first-child {
  color: var(--red);
}

.ledger-shell-view .sidebar-profile {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}

.ledger-shell-view .profile-card {
  padding: 0;
  background: transparent;
}

.ledger-shell-view .profile-avatar {
  border-radius: 12px;
  background: var(--surface-warm);
  color: var(--red);
}

.ledger-shell-view .profile-copy div {
  color: #F4F1EC;
}

.ledger-shell-view .profile-copy span {
  color: rgba(244, 241, 236, .52);
}

.ledger-shell-view .logout-btn {
  background: rgba(200, 57, 43, .14);
  color: #F4F1EC;
}

.monthly-main {
  margin-left: 248px;
  padding-top: 72px;
  background: var(--bg);
}

.monthly-content {
  max-width: 1480px;
  margin: 0 auto;
  padding: 12px 30px 34px;
}

.monthly-topbar {
  margin-bottom: 18px;
}

.monthly-section + .monthly-section,
.monthly-grid + .monthly-section {
  margin-top: 16px;
}

.monthly-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border-warm);
}

.monthly-chart-wrap {
  padding: 18px;
  border-top: 1px solid var(--border-warm);
  background:
    linear-gradient(90deg, rgba(232, 228, 223, .34) 1px, transparent 1px),
    linear-gradient(180deg, rgba(232, 228, 223, .28) 1px, transparent 1px);
  background-size: 26px 26px;
}

.monthly-daily-bars {
  min-height: 170px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
}

.monthly-day-bar {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-rows: 1fr 18px;
  align-items: end;
  gap: 6px;
}

.monthly-day-bar span {
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 1px 1px;
  background: rgba(216, 210, 203, .68);
}

.monthly-day-bar span.has-income {
  background: var(--green);
}

.monthly-day-bar span.peak {
  background: var(--graphite-soft);
}

.monthly-day-bar span.today {
  background: var(--red);
  box-shadow: 0 0 0 1px rgba(200, 57, 43, .22);
}

.monthly-day-bar small {
  color: var(--text-muted);
  font-size: 10px;
  text-align: center;
}

.monthly-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  gap: 16px;
}

.monthly-list {
  padding: 6px 18px 18px;
}

.monthly-list-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-warm);
}

.monthly-list-row:last-child {
  border-bottom: 0;
}

.monthly-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
}

.monthly-row-sub {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.monthly-line {
  height: 5px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-warm);
}

.monthly-line span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red) 0%, var(--graphite-soft) 100%);
}

.monthly-insight-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border-warm);
}

.monthly-insight-card {
  min-height: 118px;
  padding: 16px;
  background: var(--surface);
}

.monthly-insight-card div {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.monthly-insight-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-family: "Prompt", "Noto Sans Thai", sans-serif;
  font-size: 30px;
  line-height: 1;
}

.monthly-insight-card span {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.monthly-job-ledger {
  padding: 0 18px 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.monthly-ledger-head,
.monthly-ledger-row {
  display: grid;
  grid-template-columns: 132px minmax(160px, 1fr) minmax(190px, 1.2fr) 110px 122px;
  gap: 14px;
  align-items: center;
}

.monthly-ledger-head {
  min-height: 38px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-warm);
}

.monthly-ledger-row {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-bottom: 1px solid rgba(232, 228, 223, .72);
  padding: 0;
  background: transparent;
  text-align: left;
}

.monthly-ledger-row:hover {
  background: #FEFCFA;
}

.monthly-ledger-row span {
  min-width: 0;
}

.monthly-ledger-row strong,
.monthly-ledger-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monthly-ledger-row strong {
  color: var(--text);
  font-weight: 800;
}

.monthly-ledger-row small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.monthly-money {
  color: var(--green);
  font-weight: 900;
}

.monthly-empty {
  width: 100%;
  padding: 34px 18px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .monthly-grid {
    grid-template-columns: 1fr;
  }

  .monthly-ledger-head {
    display: none;
  }

  .monthly-ledger-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 0;
  }
}

@media (max-width: 768px) {
  .ledger-shell-view .app-header {
    left: 0;
    height: 60px;
    padding: 0 14px;
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
  }

  .ledger-shell-view .sidebar {
    display: none;
  }

  .monthly-main {
    margin-left: 0;
    padding-top: 60px;
  }

  .monthly-content {
    padding: 20px 14px 34px;
  }

  .monthly-topbar {
    align-items: flex-start;
  }

  .monthly-topbar .dashboard-top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .monthly-topbar .ledger-btn {
    min-width: 0;
    width: 100%;
    justify-content: center;
  }

  .monthly-section {
    min-width: 0;
    overflow: hidden;
  }

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

  .monthly-metric-grid .stat-card {
    min-width: 0;
    padding: 16px 12px;
  }

  .monthly-metric-grid .stat-value {
    font-size: 28px;
    overflow-wrap: anywhere;
  }

  .monthly-grid,
  .monthly-insight-grid {
    grid-template-columns: 1fr;
  }

  .monthly-grid > .monthly-section {
    width: 100%;
    min-width: 0;
  }

  .monthly-daily-bars {
    overflow-x: auto;
  }

  .monthly-day-bar {
    min-width: 16px;
  }

  .monthly-job-ledger {
    padding: 0 14px 14px;
  }

  .monthly-ledger-head,
  .monthly-ledger-row {
    min-width: 720px;
    display: grid;
    grid-template-columns: 112px minmax(150px, 1fr) minmax(170px, 1.15fr) 104px 112px;
    gap: 12px;
  }

  .monthly-ledger-head {
    min-height: 36px;
    padding: 0;
  }

  .monthly-ledger-row {
    min-height: 62px;
    padding: 0;
  }
}

.beaver-backdrop {
  display: none;
}

#beaver-bubble {
  position: fixed;
  right: 16px;
  bottom: 80px;
  z-index: 9000;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #C8392B;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(200, 57, 43, .35);
  cursor: pointer;
}

#beaver-bubble img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  padding: 4px;
}

#beaver-bubble.pulse {
  animation: beaverPulse 520ms ease-in-out 3;
}

.beaver-drawer {
  position: fixed;
  right: 16px;
  bottom: 140px;
  z-index: 9001;
  width: 340px;
  max-height: 480px;
  min-height: 360px;
  border: 1px solid #E8E4DF;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0 22px 52px rgba(27, 45, 79, .18);
  font-family: "Noto Sans Thai", sans-serif;
}

.beaver-drawer.hidden,
.beaver-backdrop.hidden {
  display: none;
}

.beaver-drawer-header {
  min-height: 52px;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid #EEF2F7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #1B2D4F;
  font-weight: 900;
}

.beaver-drawer-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.beaver-drawer-title img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex: 0 0 auto;
}

.beaver-drawer-header button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: #F5F5F5;
  color: #1B2D4F;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.beaver-messages {
  flex: 1;
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  background: #FAF9F7;
}

.beaver-message {
  max-width: 86%;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.beaver-message.user {
  align-self: flex-end;
  border-radius: 12px 12px 2px 12px;
  background: #C8392B;
  color: #FFFFFF;
}

.beaver-message.assistant {
  align-self: flex-start;
  border-radius: 12px 12px 12px 2px;
  background: #F5F5F5;
  color: #1C1C1C;
}

.beaver-input-row {
  padding: 10px;
  border-top: 1px solid #EEF2F7;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
  background: #FFFFFF;
}

.beaver-input-row input {
  min-width: 0;
  height: 40px;
  border: 1px solid #EEF2F7;
  border-radius: 10px;
  padding: 0 12px;
  color: #1B2D4F;
  font: 500 14px "Noto Sans Thai", sans-serif;
  outline: none;
}

.beaver-input-row input:focus {
  border-color: rgba(200, 57, 43, .38);
  box-shadow: 0 0 0 3px rgba(200, 57, 43, .08);
}

.beaver-input-row button {
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: #C8392B;
  color: #FFFFFF;
  font: 900 14px "Noto Sans Thai", sans-serif;
  cursor: pointer;
}

.beaver-input-row button:disabled {
  opacity: .62;
  cursor: wait;
}

@keyframes beaverPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

@media (max-width: 768px) {
  .beaver-backdrop {
    position: fixed;
    inset: 0;
    z-index: 8999;
    display: block;
    background: rgba(27, 45, 79, .34);
  }

  .beaver-backdrop.hidden {
    display: none;
  }

  #beaver-bubble {
    right: 16px;
    bottom: calc(156px + env(safe-area-inset-bottom, 0px));
  }

  .beaver-drawer {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: none;
    height: 70vh;
    border-radius: 18px 18px 0 0;
    animation: beaverSlideUp 180ms ease-out;
  }
}

@keyframes beaverSlideUp {
  from {
    transform: translateY(18px);
    opacity: .7;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.shared-sidebar-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar .sidebar-logo {
  flex-shrink: 0;
}

.shared-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 16px;
  color: #FFFFFF;
  text-decoration: none;
}

.sidebar .sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
}

.sidebar .sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar .sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar .sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.shared-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #C8392B;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  font-weight: 900;
}

.shared-brand-copy strong {
  display: block;
  font-family: Prompt, "Noto Sans Thai", sans-serif;
  font-size: 20px;
  line-height: 1.05;
}

.shared-brand-copy small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 700;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #AAAAAA;
  padding: 16px 20px 6px;
  display: block;
}

.nav-group.has-active .nav-group-label {
  color: #C8C4BF;
}

.nav-item {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 14px;
  color: #C8C4BF;
  cursor: pointer;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  text-align: left;
  font-weight: 700;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.nav-item.active {
  border-left-color: #C8392B;
  background: rgba(200, 57, 43, 0.12);
  color: #FFFFFF;
  font-weight: 800;
}

.nav-item.action-item {
  color: #F06B5F;
  font-weight: 900;
}

.nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-icon {
  width: 18px;
  flex: 0 0 18px;
  text-align: center;
  font-weight: 900;
}

.nav-coming-soon-badge {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #AAAAAA;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
  white-space: nowrap;
}

.sidebar .sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
}

.shared-profile-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.shared-sidebar-avatar {
  flex: 0 0 auto;
}

.shared-sidebar-tenant {
  min-width: 0;
}

.shared-sidebar-tenant strong,
.shared-sidebar-tenant span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-sidebar-tenant span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 700;
}

.shared-tier-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 900;
}

.shared-sidebar-logout {
  width: 100%;
  margin-top: 12px;
}

.page-action-btn,
.header-action-btn,
button.btn-primary,
a.btn-primary {
  color: #FFFFFF !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

.page-action-btn span,
.header-action-btn span,
button.btn-primary span,
a.btn-primary span {
  color: inherit !important;
}

#nav-skeleton-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg, #FAF9F7);
  padding: 32px 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#nav-skeleton-overlay .skeleton-line {
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    #E8E4DF 25%,
    #F5F2EF 50%,
    #E8E4DF 75%
  );
  background-size: 200% 100%;
  animation: beavy-nav-shimmer 1.2s infinite;
}

#nav-skeleton-overlay .skeleton-line.wide {
  width: 80%;
}

#nav-skeleton-overlay .skeleton-line.medium {
  width: 55%;
}

#nav-skeleton-overlay .skeleton-line.narrow {
  width: 35%;
}

.navigating-away .main-content > :not(#nav-skeleton-overlay),
.navigating-away main > :not(#nav-skeleton-overlay),
.navigating-away .content-area > :not(#nav-skeleton-overlay) {
  opacity: 0;
  transition: opacity 0.1s ease;
}

@keyframes beavy-nav-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}
