/* src/styles.css */
:root {
  --brand: #0c7a3f;
  --brand-dark: #085c2f;
  --brand-darker: #06351e;
  --brand-light: #15a85a;
  --brand-glow: #34d27e;
  --bg: #eef4f0;
  --surface: #fff;
  --surface-2: #f4f9f6;
  --sidebar-top: #0c7a3f;
  --sidebar-bottom: #06351e;
  --sidebar-text: #d8efe1;
  --sidebar-muted: #a7d6bc;
  --sidebar-hover: #ffffff24;
  --sidebar-active: #fff3;
  --primary: #0c7a3f;
  --primary-dark: #085c2f;
  --on-primary: #fff;
  --text: #13241b;
  --muted: #5e7268;
  --border: #dde8e1;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warn: #c98a14;
  --warn-soft: #fdf2dc;
  --ok: #0c7a3f;
  --ok-soft: #e3f3ea;
  --badge-bg: #e3f3ea;
  --shadow: 0 1px 3px #06351e14, 0 1px 2px #06351e0d;
  --shadow-md: 0 6px 22px #06351e1f;
  --blob-opacity: .5;
}

[data-theme="dark"] {
  --bg: #0a130e;
  --surface: #13201a;
  --surface-2: #182a21;
  --sidebar-top: #0b1b13;
  --sidebar-bottom: #061009;
  --sidebar-text: #d5e8dd;
  --sidebar-muted: #84a995;
  --sidebar-hover: #34d27e1f;
  --sidebar-active: #34d27e2e;
  --primary: #18a657;
  --primary-dark: #128048;
  --on-primary: #fff;
  --text: #e7f1ea;
  --muted: #93a89c;
  --border: #21362b;
  --danger: #f87171;
  --danger-soft: #3a1a1a;
  --warn: #e0b057;
  --warn-soft: #3a2f15;
  --ok: #34d27e;
  --ok-soft: #14352340;
  --badge-bg: #14352340;
  --shadow: 0 1px 3px #0006;
  --shadow-md: 0 8px 28px #00000080;
  --blob-opacity: .6;
}

* {
  box-sizing: border-box;
}

html, body, #root {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  transition: background .3s, color .3s;
  font-family: Calibri, Segoe UI, system-ui, -apple-system, BlinkMacSystemFont, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
  font-size: 14.5px;
}

.bg-anim {
  position: fixed;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  inset: 0;
}

.bg-anim .blob {
  position: absolute;
  filter: blur(70px);
  opacity: var(--blob-opacity);
  will-change: transform;
  border-radius: 50%;
}

.blob-1 {
  background: radial-gradient(circle at 30% 30%, var(--brand-glow), transparent 70%);
  animation: drift1 18s ease-in-out infinite;
  width: 460px;
  height: 460px;
  top: -120px;
  left: -100px;
}

.blob-2 {
  background: radial-gradient(circle at 50% 50%, var(--brand-light), transparent 70%);
  animation: drift2 22s ease-in-out infinite;
  width: 540px;
  height: 540px;
  bottom: -180px;
  right: -140px;
}

.blob-3 {
  background: radial-gradient(circle at 50% 50%, var(--brand), transparent 70%);
  animation: drift3 26s ease-in-out infinite;
  width: 360px;
  height: 360px;
  top: 40%;
  left: 55%;
}

.blob-4 {
  background: radial-gradient(circle at 50% 50%, var(--brand-glow), transparent 70%);
  animation: drift1 30s ease-in-out infinite reverse;
  width: 300px;
  height: 300px;
  top: 10%;
  right: 20%;
}

.bg-grid {
  position: absolute;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  opacity: .25;
  mask-image: radial-gradient(circle at 50% 40%, #000 10%, #0000 80%);
  background-size: 48px 48px;
  inset: 0;
}

@keyframes drift1 {
  0%, 100% {
    transform: translate(0)scale(1);
  }

  50% {
    transform: translate(60px, 50px)scale(1.12);
  }
}

@keyframes drift2 {
  0%, 100% {
    transform: translate(0)scale(1);
  }

  50% {
    transform: translate(-70px, -40px)scale(1.08);
  }
}

@keyframes drift3 {
  0%, 100% {
    transform: translate(0)scale(1);
  }

  33% {
    transform: translate(-50px, 30px)scale(1.1);
  }

  66% {
    transform: translate(40px, -50px)scale(.95);
  }
}

.app {
  display: flex;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bottom) 100%);
  color: var(--sidebar-text);
  display: flex;
  position: sticky;
  flex-direction: column;
  width: 256px;
  height: 100vh;
  top: 0;
  box-shadow: 4px 0 24px #06351e1f;
}

.brand {
  display: flex;
  border-bottom: 1px solid #ffffff1f;
  align-items:  center;
  padding: 22px 18px;
}

.brand-logo-img {
  filter: drop-shadow(0 2px 6px #00000040);
  width: 100%;
  max-width: 188px;
  height: auto;
}

.nav {
  overflow-y: auto;
  flex: 1;
  padding: 16px 12px;
}

.nav-item {
  display: flex;
  color: var(--sidebar-text);
  cursor: pointer;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid #0000;
  border-radius: 10px;
  align-items:  center;
  gap: 12px;
  width: 100%;
  margin-bottom: 4px;
  padding: 11px 14px;
  transition: background .18s, color .18s, border-color .18s, transform .1s;
  font-family: inherit;
  font-size: 14.5px;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item:active {
  transform: scale(.98);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--brand-glow);
  font-weight: 600;
}

.nav-icon {
  display: grid;
  flex-shrink: 0;
  place-items:  center;
  width: 24px;
  height: 24px;
}

.nav-item.active .nav-icon {
  color: var(--brand-glow);
}

.sidebar-footer {
  color: var(--sidebar-muted);
  border-top: 1px solid #ffffff1f;
  padding: 14px 18px;
  font-size: 11px;
}

.content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.topbar {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  position: sticky;
  z-index: 5;
  justify-content: space-between;
  align-items:  center;
  gap: 16px;
  padding: 16px 28px;
  top: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  margin: 2px 0 0;
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items:  center;
  gap: 12px;
}

.theme-toggle {
  display: grid;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: 10px;
  place-items:  center;
  width: 38px;
  height: 38px;
  transition: background .15s, color .15s, border-color .15s;
}

.theme-toggle:hover {
  background: var(--badge-bg);
  color: var(--brand);
  border-color: var(--brand);
}

.app-switch {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  gap: 3px;
  padding: 3px;
}

.app-switch-btn {
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 6px 13px;
  transition: background .15s, color .15s;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
}

.app-switch-btn:hover:not(.active) {
  color: var(--brand);
}

.app-switch-btn.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow);
  cursor: default;
}

.user-chip {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 22px;
  align-items:  center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
}

.user-avatar {
  display: grid;
  background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
  color: #fff;
  border-radius: 50%;
  place-items:  center;
  width: 30px;
  height: 30px;
  font-size: 13px;
  font-weight: 700;
}

.user-name {
  text-transform: capitalize;
  font-size: 13.5px;
  font-weight: 600;
}

.view {
  position: relative;
  z-index: 1;
  padding: 26px 28px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  display: flex;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 14px;
  align-items:  center;
  gap: 14px;
  padding: 18px;
  transition: transform .15s, box-shadow .15s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.card-icon {
  display: grid;
  background: var(--badge-bg);
  color: var(--brand);
  border-radius: 12px;
  flex-shrink: 0;
  place-items:  center;
  width: 48px;
  height: 48px;
}

.card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-value {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.1;
}

.card-label {
  color: var(--muted);
  margin-top: 2px;
  font-size: 12.5px;
}

.tone-green {
  border-left-color: #0c7a3f;
}

.tone-green .card-icon {
  color: #0c7a3f;
}

.tone-emerald {
  border-left-color: #15a85a;
}

.tone-emerald .card-icon {
  color: #15a85a;
}

.tone-teal {
  border-left-color: #0e9488;
}

.tone-teal .card-icon {
  color: #0e9488;
}

.tone-lime {
  border-left-color: #4d9e1f;
}

.tone-lime .card-icon {
  color: #4d9e1f;
}

.tone-amber {
  border-left-color: #c98a14;
}

.tone-amber .card-icon {
  color: #c98a14;
}

.tone-red {
  border-left-color: var(--danger);
}

.tone-red .card-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}

.chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 14px;
  padding: 18px;
}

.chart-box h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}

.chart {
  width: 100%;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--muted);
  font-size: 11px;
}

.chart-refline {
  stroke: var(--warn);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  opacity: .9;
}

.chart-refline-label {
  fill: var(--warn);
  font-size: 10.5px;
  font-weight: 700;
}

.chart-legend {
  display: flex;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 12.5px;
}

.legend-item {
  display: inline-flex;
  align-items:  center;
  gap: 7px;
}

.legend-dot {
  border-radius: 3px;
  width: 11px;
  height: 11px;
}

.chart-pie {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 18px;
}

.chart-svg-pie {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
}

.pie-legend {
  list-style: none;
  flex: 1;
  min-width: 160px;
  margin: 0;
  padding: 0;
}

.pie-legend li {
  display: flex;
  border-bottom: 1px solid var(--border);
  align-items:  center;
  gap: 9px;
  padding: 5px 0;
  font-size: 13px;
}

.pie-legend li:last-child {
  border-bottom: none;
}

.pie-dot {
  border-radius: 3px;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.pie-name {
  flex: 1;
}

.pie-val {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.crud-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-right {
  display: flex;
  align-items:  center;
  gap: 12px;
}

.search-wrap {
  display: flex;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 10px;
  align-items:  center;
  gap: 8px;
  min-width: 280px;
  padding: 0 12px;
  transition: border-color .15s, box-shadow .15s;
}

.search-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.search {
  color: var(--text);
  outline: none;
  background: none;
  border: none;
  flex: 1;
  padding: 10px 0;
  font-family: inherit;
  font-size: 14.5px;
}

.badge {
  background: var(--badge-bg);
  color: var(--brand);
  white-space: nowrap;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow-x: auto;
  border-radius: 14px;
}

.table {
  border-collapse: collapse;
  width: 100%;
}

.table th, .table td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  padding: 13px 16px;
}

.table th {
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 700;
}

.table tbody tr {
  transition: background .12s;
}

.table tbody tr:hover {
  background: var(--surface-2);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.col-actions {
  text-align: right;
  width: 1%;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px;
}

.pill {
  display: inline-block;
  white-space: nowrap;
  border: 1px solid #0000;
  border-radius: 20px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 700;
}

.pill-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}

.pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}

.pill-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.pill-neutral {
  background: var(--badge-bg);
  color: var(--muted);
  border-color: var(--border);
}

.error-state {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  text-align: center;
  border-radius: 16px;
  max-width: 620px;
  margin: 20px auto;
  padding: 40px;
}

.error-icon {
  margin-bottom: 8px;
  font-size: 48px;
}

.error-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.error-msg {
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

.setup-box {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 20px;
  padding: 18px 22px;
}

.setup-box strong {
  display: block;
  margin-bottom: 10px;
}

.setup-box ol {
  color: var(--text);
  margin: 0;
  padding-left: 20px;
  line-height: 1.9;
}

.setup-box code {
  background: var(--brand-darker);
  color: #d8efe1;
  border-radius: 5px;
  padding: 2px 7px;
  font-family: Consolas, Courier New, monospace;
  font-size: 12.5px;
}

.btn-primary, .btn-secondary {
  display: inline-flex;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  justify-content: center;
  align-items:  center;
  gap: 7px;
  padding: 10px 17px;
  transition: background .15s, opacity .15s, transform .1s, box-shadow .15s;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
  color: var(--on-primary);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent);
}

.btn-primary:hover {
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 45%, transparent);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: .6;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--badge-bg);
}

.icon-btn {
  display: inline-grid;
  cursor: pointer;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 8px;
  place-items:  center;
  padding: 7px;
  transition: background .15s, color .15s;
}

.icon-btn:hover {
  background: var(--badge-bg);
  color: var(--brand);
}

.icon-btn-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.modal-overlay {
  position: fixed;
  backdrop-filter: blur(4px);
  display: grid;
  z-index: 100;
  animation: fadeIn .18s ease;
  background: #06351e80;
  place-items:  center;
  padding: 16px;
  inset: 0;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-y: auto;
  animation: popIn .2s ease;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  box-shadow: 0 24px 60px #06351e59;
}

.modal-head {
  display: flex;
  border-bottom: 1px solid var(--border);
  justify-content: space-between;
  align-items:  center;
  padding: 18px 22px;
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.modal-body {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

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

.field span {
  color: var(--muted);
  font-weight: 600;
}

.req {
  color: var(--danger);
  font-style: normal;
}

.field input, .field select, .field textarea {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  border-radius: 9px;
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
  font-size: 14.5px;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 8px;
  margin: 12px 0;
  padding: 10px 14px;
  font-size: 13px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(12px)scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.login {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
  min-height: 100vh;
}

.login-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  color: #eafaf1;
  background: linear-gradient(160deg, #0c7a3f 0%, #06351e 100%);
  flex-direction: column;
  justify-content: space-between;
  padding: 46px 52px;
}

.login-aside-top, .login-aside-mid, .login-aside-foot {
  position: relative;
  z-index: 1;
}

.login-aside-top {
  display: flex;
  align-items:  center;
}

.login-aside-logo {
  filter: drop-shadow(0 6px 16px #0000004d);
  width: 260px;
  max-width: 60%;
  height: auto;
}

.login-aside-mid, .login-aside-top, .login-aside-foot {
  max-width: 360px;
}

.login-badge {
  display: inline-block;
  letter-spacing: .4px;
  background: #ffffff29;
  border: 1px solid #ffffff40;
  border-radius: 30px;
  margin-bottom: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
}

.login-aside-mid h2 {
  margin: 0 0 14px;
  font-size: 33px;
  font-weight: 700;
  line-height: 1.18;
}

.login-aside-mid p {
  color: #c6e9d4;
  margin: 0 0 26px;
  font-size: 15px;
  line-height: 1.6;
}

.login-highlights {
  list-style: none;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
}

.login-highlights li {
  display: flex;
  align-items:  center;
  gap: 13px;
  font-size: 14.5px;
}

.lh-icon {
  display: grid;
  color: #d6f6e3;
  background: #ffffff24;
  border-radius: 10px;
  flex-shrink: 0;
  place-items:  center;
  width: 36px;
  height: 36px;
}

.login-aside-foot {
  color: #9fd8ba;
  font-size: 12px;
}

.login-main {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items:  center;
  padding: 40px 24px;
}

.login-theme {
  position: absolute;
  z-index: 3;
  top: 24px;
  right: 24px;
}

.login-form-wrap {
  animation: popIn .3s ease;
  width: 100%;
  max-width: 380px;
}

.login-mobile-logo {
  display: none;
  width: 200px;
  max-width: 70%;
  height: auto;
  margin: 0 auto 24px;
}

.login-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
}

.login-sub {
  color: var(--muted);
  margin: 0 0 30px;
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-field > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.input-icon {
  display: flex;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 12px;
  align-items:  center;
  gap: 10px;
  padding: 0 14px;
  transition: border-color .15s, box-shadow .15s;
}

.input-icon:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}

.input-icon input {
  outline: none;
  color: var(--text);
  background: none;
  border: none;
  flex: 1;
  min-width: 0;
  padding: 13px 0;
  font-family: inherit;
  font-size: 15px;
}

.pass-toggle {
  display: grid;
  cursor: pointer;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 6px;
  place-items:  center;
  padding: 4px;
}

.pass-toggle:hover {
  color: var(--brand);
}

.login-btn {
  border-radius: 12px;
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  font-size: 15.5px;
}

.login-error {
  background: var(--danger-soft);
  color: var(--danger);
  text-align: center;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
}

.login-demo {
  display: flex;
  border: 1px dashed var(--border);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 11px;
  align-items:  center;
  gap: 9px;
  margin-top: 26px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.4;
}

.login-demo svg {
  color: var(--brand);
  flex-shrink: 0;
}

.login-demo strong {
  color: var(--brand);
}

.table-compact {
  table-layout: auto;
}

.table-compact th, .table-compact td {
  white-space: normal;
  word-break: break-word;
  vertical-align: middle;
  padding: 8px 10px;
  font-size: 12.5px;
}

.table-compact th {
  letter-spacing: .02em;
  font-size: 10.5px;
}

.table-compact .pill {
  padding: 3px 8px;
  font-size: 11px;
}

.table-compact .col-actions {
  white-space: nowrap;
}

.agenda-banner {
  background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
  color: #fff;
  letter-spacing: .04em;
  box-shadow: var(--shadow);
  text-transform: uppercase;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 800;
}

.agenda-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  margin: 16px 0 12px;
}

.agenda-nav {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 8px;
}

.agenda-nav .btn-secondary {
  padding: 8px 13px;
  font-size: 13px;
}

.agenda-periodo {
  color: var(--text);
  margin-left: 6px;
  font-weight: 700;
}

.agenda-span select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13.5px;
}

.agenda-legend {
  display: flex;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
  font-size: 12px;
}

.agenda-legend-item {
  display: inline-flex;
  align-items:  center;
  gap: 7px;
}

.agenda-swatch {
  border: 1px solid #00000026;
  border-radius: 4px;
  width: 16px;
  height: 16px;
}

.agenda-grid-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: auto;
  border-radius: 14px;
  max-height: calc(100vh - 280px);
}

.agenda-grid {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.agenda-grid th, .agenda-grid td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.agenda-grid thead th {
  position: sticky;
  z-index: 3;
  background: var(--surface-2);
  text-align: center;
  min-width: 116px;
  padding: 8px 10px;
  top: 0;
}

.ag-head {
  display: table-cell;
}

.ag-head-dow {
  display: block;
  text-transform: capitalize;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.ag-head-date {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: 11px;
}

.ag-head.ag-today {
  box-shadow: inset 0 -3px 0 var(--brand);
}

.ag-head.ag-today .ag-head-dow {
  color: var(--brand);
}

.ag-corner, .ag-name {
  position: sticky;
  z-index: 2;
  background: var(--surface-2);
  text-align: left;
  color: var(--text);
  min-width: 168px;
  max-width: 200px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  left: 0;
}

.ag-corner {
  z-index: 4;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  font-size: 11px;
  top: 0;
}

.agenda-grid tbody tr:hover .ag-name {
  background: var(--badge-bg);
}

.ag-cell {
  cursor: pointer;
  vertical-align: middle;
  background: var(--surface);
  height: 52px;
  padding: 4px;
  transition: background .12s;
}

.ag-cell:hover {
  background: var(--surface-2);
}

.ag-cell.ag-weekend, .ag-head.ag-weekend {
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

.ag-add {
  display: grid;
  color: #0000;
  place-items:  center;
  height: 100%;
  font-size: 18px;
  font-weight: 700;
}

.ag-cell:hover .ag-add {
  color: var(--muted);
}

.ag-block {
  display: flex;
  text-align: center;
  word-break: break-word;
  border-radius: 7px;
  justify-content: center;
  align-items:  center;
  height: 100%;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.ag-pessego {
  color: #6b3d12;
  background: #f6cba2;
}

.ag-marrom {
  color: #fff;
  background: #c2641b;
}

.ag-lavanda {
  color: #1f2d63;
  background: #c3cdee;
}

.ag-rosa {
  color: #6e1346;
  background: #f4a6d6;
}

.ag-rosa-forte {
  color: #fff;
  background: #e85fb0;
}

.ag-verde {
  color: #244d10;
  background: #93d06a;
}

.ag-laranja {
  color: #5c3800;
  background: #f6a51f;
}

.ag-ciano {
  color: #064a4c;
  background: #2fe3e3;
}

.ag-azul {
  color: #fff;
  background: #2f6ed4;
}

.ag-amarelo {
  color: #5c5200;
  background: #f6e017;
}

.ag-branco {
  color: #20303a;
  background: #fff;
  border: 1px solid #d7dee4;
}

.agenda-swatch.ag-branco {
  background: #fff;
}

.agenda-modal {
  max-width: 480px;
}

.agenda-modal-info {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 16px;
  padding: 10px 14px;
}

.agenda-modal-info strong {
  font-size: 15px;
}

.agenda-cor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.agenda-cor-opt {
  cursor: pointer;
  text-align: center;
  opacity: .85;
  border: 2px solid #0000;
  border-radius: 8px;
  padding: 9px 10px;
  transition: opacity .12s, transform .1s, box-shadow .12s;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

.agenda-cor-opt:hover {
  opacity: 1;
}

.agenda-cor-opt.selected {
  opacity: 1;
  border-color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
  transform: translateY(-1px);
}

.btn-danger-text {
  color: var(--danger);
}

.btn-danger-text:hover {
  background: var(--danger-soft);
}

@media (width <= 980px) {
  .login {
    grid-template-columns: 1fr;
  }

  .login-aside {
    display: none;
  }

  .login-mobile-logo {
    display: block;
  }
}

@media (width <= 760px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
  }

  .nav-item {
    flex: 140px;
    width: auto;
  }

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

  .topbar {
    flex-wrap: wrap;
  }

  .user-name {
    display: none;
  }
}
