:root {
  --bg: #eef4fb;
  --bg-glow: #d9eafc;
  --surface: #ffffff;
  --surface-2: #f7faff;
  --text: #0b1220;
  --muted: #5b6b86;
  --border: rgba(15, 40, 80, 0.08);
  --border-strong: rgba(15, 40, 80, 0.12);
  --primary: #2f80ed;
  --primary-hover: #1f6fd6;
  --primary-soft: rgba(47, 128, 237, 0.12);
  --primary-soft-2: rgba(47, 128, 237, 0.06);
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.08);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.12);
  --info: #0e9db8;
  --info-soft: rgba(14, 157, 184, 0.12);
  --violet: #7c5cff;
  --violet-soft: rgba(124, 92, 255, 0.12);
  --radius: 15px;
  --radius-sm: 10px;
  --glass: rgba(255, 255, 255, 0.36);
  --glass-strong: rgba(255, 255, 255, 0.58);
  --glass-border: rgba(255, 255, 255, 0.68);
  --glass-blur: 22px;
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --workspace-wallpaper: url("/img/wallpaper-default.png");
  --shadow-sm: 0 1px 2px rgba(16, 40, 80, 0.04), 0 8px 24px rgba(70, 60, 120, 0.06);
  --shadow-md: 0 4px 16px rgba(40, 40, 90, 0.06), 0 18px 40px rgba(70, 60, 120, 0.1);
  --shadow-hover: 0 10px 32px rgba(139, 92, 246, 0.18);
  --header-h: 56px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

/* Compact scale: everything rem-based shrinks from here */
html {
  font-size: 14px;
}

html, body {
  font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  position: relative;
}

/* Immersive wallpaper + soft wash so glass cards float over color */
.ambient-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
 
  background-size:
    28px 28px,
    36px 36px,
    auto,
    cover;
  background-position: center, center, center, center;
  background-repeat: repeat, repeat, no-repeat, no-repeat;
  filter: saturate(1.08);
}

.ambient-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 420px at 12% 18%, rgba(120, 220, 200, 0.28), transparent 60%),
    radial-gradient(800px 460px at 88% 12%, rgba(196, 160, 255, 0.32), transparent 55%),
    radial-gradient(700px 500px at 70% 90%, rgba(255, 214, 140, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.22));
}

body.has-wallpaper .ambient-layer {
  filter: saturate(1.12) contrast(1.02);
}

/* Outer glass sheet wrapping the workspace */
.glass-stage {
  position: relative;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 24px;
  box-shadow:
    0 24px 60px rgba(40, 50, 90, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding: 1.1rem 1.15rem 1.25rem;
  min-height: calc(100vh - var(--header-h) - 3.5rem);
}

.wallpaper-preview {
  width: 100%;
  max-width: 420px;
  height: 140px;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color .2s var(--ease), font-weight .28s var(--ease);
}

a:hover {
  color: var(--primary-hover);
  font-weight: 560;
}

/* ——— Header ——— */
.app-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 0 rgba(15, 40, 80, 0.04);
  position: sticky;
  top: 0;
  z-index: 40;
}

.app-header > .container-fluid {
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 550;
  font-size: 1.02rem;
  letter-spacing: -0.03em;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
  font-weight: 650;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #5aa7ff 0%, var(--primary) 55%, #1d5fc7 100%);
  box-shadow: 0 4px 12px rgba(47, 128, 237, 0.35);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
}

/* ——— Shell / Nav ——— */
.app-shell {
  display: grid;
  grid-template-columns: 205px 1fr;
  gap: 1rem;
  align-items: start;
}

.side-nav {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem .7rem;
  box-shadow: var(--shadow-sm), var(--glass-inset);
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.side-title {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.04em;
  margin: .15rem .65rem 0.85rem;
}

.side-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .48rem .65rem;
  border-radius: 10px;
  color: var(--text);
  margin-bottom: .1rem;
  font-weight: 450;
  font-size: .86rem;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), font-weight .28s var(--ease);
}

.side-link:hover {
  background: var(--primary-soft-2);
  color: var(--primary);
  font-weight: 560;
}

.side-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.side-link.active:hover {
  font-weight: 650;
}

.content-pane { min-width: 0; }

/* ——— Typography ——— */
.page-title {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: .15rem;
  line-height: 1.3;
}

.page-sub {
  color: var(--muted);
  margin-bottom: 1.1rem;
  font-size: .86rem;
  font-weight: 400;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .25rem;
}

/* ——— KPI / Cards ——— */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.kpi,
.panel,
.auth-card,
.task-card {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), var(--glass-inset);
}

/* ——— Cursor glow (set via --mx / --my by site.js) ——— */
.kpi,
.panel,
.task-card,
.biz-card,
.side-nav,
.auth-card {
  position: relative;
}

.kpi::after,
.panel::after,
.task-card::after,
.biz-card::after,
.side-nav::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;

  opacity: 0;
  transition: opacity .35s var(--ease);
  z-index: 0;
}

.kpi:hover::after,
.panel:hover::after,
.task-card:hover::after,
.biz-card:hover::after,
.side-nav:hover::after {
  opacity: 1;
}

.kpi > *,
.task-card > *,
.biz-card > * {
  position: relative;
  z-index: 1;
}

.kpi {
  --kpi-accent: var(--primary);
  --kpi-soft: var(--primary-soft);
  padding: .8rem .95rem;
  position: relative;
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.kpi::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--kpi-accent);
  opacity: .75;
  border-radius: 0 3px 3px 0;
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover), var(--glass-inset);
  border-color: rgba(140, 190, 255, 0.65);
}

.panel:hover,
.task-card:hover,
.biz-card:hover {
  border-color: rgba(140, 190, 255, 0.6);
}

.kpi .label {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 400;
  letter-spacing: 0;
}

.kpi .value {
  display: inline-flex;
  align-items: baseline;
  margin-top: .45rem;
  padding: .2rem .7rem;
  border-radius: 999px;
  background: var(--kpi-soft);
  color: var(--kpi-accent);
  font-size: 1.05rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.kpi-primary { --kpi-accent: var(--primary); --kpi-soft: var(--primary-soft); }
.kpi-success { --kpi-accent: var(--success); --kpi-soft: var(--success-soft); }
.kpi-info    { --kpi-accent: var(--info);    --kpi-soft: var(--info-soft); }
.kpi-warning { --kpi-accent: var(--warning); --kpi-soft: var(--warning-soft); }
.kpi-danger  { --kpi-accent: var(--danger);  --kpi-soft: var(--danger-soft); }
.kpi-violet  { --kpi-accent: var(--violet);  --kpi-soft: var(--violet-soft); }

/* Featured KPI — solid violet glass like the reference hero card */
.kpi-hero {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.92), rgba(168, 85, 247, 0.88) 45%, rgba(236, 72, 153, 0.78));
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  box-shadow: 0 14px 36px rgba(139, 92, 246, 0.28), var(--glass-inset);
}

.kpi-hero::before { opacity: 0; }
.kpi-hero .label { color: rgba(255, 255, 255, 0.78); }
.kpi-hero .value {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.kpi-hero:hover {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 18px 40px rgba(139, 92, 246, 0.34), var(--glass-inset);
}

.panel {
  padding: 1rem 1.1rem;
  margin-bottom: .9rem;
  transition: box-shadow .25s var(--ease);
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

.panel h2,
.panel h3 {
  font-size: .92rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  margin-bottom: .8rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.panel-head h2 {
  margin-bottom: 0;
}

.panel-head .page-sub {
  margin-top: .15rem;
}

/* ——— Reports / charts ——— */
.chart-panel .panel-head {
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: .75rem;
}

.chart-wrap {
  position: relative;
  height: 240px;
  width: 100%;
}

.chart-wrap-lg {
  height: 300px;
}

.report-table th,
.report-table td {
  white-space: nowrap;
}

.report-metric {
  display: inline-flex;
  min-width: 2.5rem;
  justify-content: center;
  padding: .15rem .45rem;
  border-radius: 999px;
  font-weight: 550;
  font-size: .88rem;
}

.report-metric.is-ok {
  background: var(--success-soft);
  color: var(--success);
}

.report-metric.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.report-metric.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

@media print {
  .side-nav,
  .app-header,
  .btn,
  .btn-icon {
    display: none !important;
  }

  .content-pane,
  .app-shell {
    display: block !important;
  }

  .chart-wrap,
  .chart-wrap-lg {
    break-inside: avoid;
  }
}

/* ——— Tables ——— */
.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--primary-soft-2);
  margin-bottom: 0;
}

.table {
  font-size: .86rem;
}

.table th {
  color: var(--muted);
  font-weight: 500;
  font-size: .72rem;
  border-bottom-color: var(--border-strong) !important;
  padding-top: .5rem;
  padding-bottom: .5rem;
}

.table td {
  border-bottom-color: var(--border) !important;
  padding-top: .6rem;
  padding-bottom: .6rem;
  vertical-align: middle;
}

.table tbody tr {
  transition: background .15s var(--ease);
}

.table-warning {
  --bs-table-bg: var(--warning-soft) !important;
}

/* ——— Buttons ——— */
.btn {
  border-radius: 10px;
  font-weight: 500;
  font-size: .86rem;
  letter-spacing: -0.01em;
  padding: .42rem .85rem;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), font-weight .28s var(--ease);
}

.btn:hover {
  font-weight: 580;
}

.btn-sm {
  font-size: .78rem;
  padding: .3rem .65rem;
}

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-hover);
  --bs-btn-hover-border-color: var(--primary-hover);
  --bs-btn-active-bg: #185eb8;
  --bs-btn-active-border-color: #185eb8;
  box-shadow: 0 4px 14px rgba(47, 128, 237, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(47, 128, 237, 0.32);
}

.btn-ghost {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: rgba(47, 128, 237, 0.35);
  color: var(--primary);
}

.btn-link {
  color: var(--primary);
  font-weight: 500;
}

/* ——— Badges ——— */
.badge-soft {
  display: inline-flex;
  align-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  padding: .2rem .58rem;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

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

.badge-violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.badge-warn {
  background: var(--warning-soft);
  color: var(--warning);
}

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

/* ——— Alerts / Forms ——— */
.flat-alert,
.alert {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(5, 150, 105, 0.18);
}

.alert-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(225, 29, 72, 0.18);
}

.form-label {
  font-weight: 500;
  font-size: .8rem;
  color: #334155;
  margin-bottom: .3rem;
}

.form-control,
.form-select {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: .48rem .75rem;
  font-size: .86rem;
  background: rgba(255, 255, 255, 0.6);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}

.form-control:focus,
.form-select:focus {
  background: #fff;
  border-color: rgba(47, 128, 237, 0.55);
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.15);
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ——— Auth ——— */
body.auth-page main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h));
  padding-top: 1rem;
  padding-bottom: 2rem;
}

body.auth-page .glass-stage {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  min-height: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  padding: 1.6rem 1.6rem 1.4rem;
  box-shadow: var(--shadow-md);
}

.auth-card .page-title {
  font-size: 1.3rem;
  text-align: center;
}

.auth-card .page-sub {
  text-align: center;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.auth-brand .brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.auth-brand .brand-mark::after {
  inset: 12px;
  border-radius: 6px;
}

/* ——— Operator ——— */
.operator-shell {
  max-width: 720px;
  margin: 0 auto;
}

.operator-nav {
  display: flex;
  gap: .6rem;
  margin-bottom: 1.25rem;
  padding: .35rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm), var(--glass-inset);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
}

.operator-nav a {
  flex: 1;
  text-align: center;
  border-radius: 10px;
  padding: .5rem;
  color: var(--muted);
  font-weight: 500;
  font-size: .88rem;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), font-weight .28s var(--ease);
}

.operator-nav a:hover {
  color: var(--primary);
  background: var(--primary-soft-2);
  font-weight: 620;
}

.operator-nav a.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.task-card {
  padding: .85rem .95rem;
  margin-bottom: .65rem;
  display: block;
  color: inherit;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(47, 128, 237, 0.22);
  color: inherit;
  font-weight: 400;
}

.task-card.overdue {
  border-color: rgba(225, 29, 72, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 235, 238, 0.5) 100%);
}

.task-card.status-todo {
  border-color: rgba(47, 128, 237, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(239, 246, 255, 0.55) 100%);
}

.task-card.status-inprogress {
  border-color: rgba(14, 165, 233, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(224, 242, 254, 0.55) 100%);
}

.task-card.status-done {
  border-color: rgba(5, 150, 105, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(236, 253, 245, 0.6) 100%);
}

.task-card.status-blocked {
  border-color: rgba(225, 29, 72, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 241, 242, 0.6) 100%);
}

.task-card.status-skipped {
  border-color: rgba(217, 119, 6, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 251, 235, 0.6) 100%);
}

.task-card .meta {
  color: var(--muted);
  font-size: .86rem;
  margin-top: .45rem;
}

.task-card strong {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ——— Progress ——— */
.progress-flat {
  height: .55rem;
  background: #e4eef9;
  border-radius: 999px;
  overflow: hidden;
}

.progress-flat > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6aa8f8, var(--primary));
  border-radius: inherit;
  transition: width .4s var(--ease);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  font-size: .88rem;
}

.empty-state::before {
  content: "";
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(47, 128, 237, 0.12);
}

/* ——— Business cards grid ——— */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.biz-card {
  display: block;
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: .95rem 1rem;
  box-shadow: var(--shadow-sm), var(--glass-inset);
  color: inherit;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s var(--ease);
}

.biz-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  color: inherit;
  font-weight: 400;
}

.biz-card .name {
  font-weight: 550;
  font-size: .95rem;
  letter-spacing: -0.02em;
  margin-bottom: .3rem;
}

.biz-card .meta {
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: .9rem;
}

.biz-card .stats {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
}

.biz-card .stat span {
  display: block;
  font-size: .72rem;
  color: var(--muted);
}

.biz-card .stat strong {
  font-size: .95rem;
  font-weight: 550;
  letter-spacing: -0.03em;
}

.biz-card .card-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
  opacity: .75;
  transition: opacity .2s var(--ease);
}

.biz-card:hover .card-actions,
.biz-card:focus-within .card-actions {
  opacity: 1;
}

.biz-card .card-actions .action-group {
  opacity: 1;
}

.biz-card.is-warn {
  border-color: rgba(217, 119, 6, 0.3);
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.6) 0%, var(--glass) 55%);
}

.biz-card .card-footer-form {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
}

.biz-card.row-removing {
  opacity: 0;
  transform: translateY(6px) scale(0.98);
}

hr {
  border-color: var(--border);
  opacity: 1;
}

/* ——— OpenStreetMap / Leaflet picker ——— */
.map-picker {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  z-index: 1;
}

.map-picker.map-square {
  width: min(100%, 340px);
  height: auto;
  aspect-ratio: 1 / 1;
  max-width: 340px;
  margin-inline: auto;
}

.map-picker.map-square.map-compact {
  width: 220px;
  max-width: 220px;
}

.map-picker .leaflet-control-attribution {
  font-size: .65rem;
}

/* ——— Health chip (business details) ——— */
.health-chip {
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  padding: .32rem .7rem;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.health-chip-label {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
}

.health-chip-value {
  font-size: 1rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  color: var(--primary);
}

/* ——— Persian calendar ——— */
.pcal {
  --pcal-cell: 2.55rem;
}

.pcal.pcal-compact {
  --pcal-cell: 1.85rem;
  width: 100%;
  max-width: none;
  padding: .85rem 1rem;
}

.pcal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .65rem;
}

.pcal-compact .pcal-head {
  margin-bottom: .45rem;
}

.pcal-title {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  margin: 0;
}

.pcal-compact .pcal-title {
  font-size: .92rem;
}

.pcal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .4rem;
}

.pcal-compact .pcal-grid {
  gap: .2rem;
}

.pcal-weekday {
  text-align: center;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  padding: .35rem 0;
}

.pcal-compact .pcal-weekday {
  font-size: .68rem;
  padding: .15rem 0;
}

.pcal-day {
  position: relative;
  min-height: var(--pcal-cell);
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s var(--ease), border-color .2s var(--ease);
  cursor: pointer;
  padding: 0;
}

.pcal-compact .pcal-day {
  border-radius: 6px;
}

.pcal-day.is-empty {
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.pcal-day:hover:not(.is-empty) {
  border-color: var(--border-strong);
}

.pcal-day.is-today {
  box-shadow: inset 0 0 0 2px var(--primary);
  background: #e8f1ff;
  font-weight: 700;
}

.pcal-day.is-today .pcal-num {
  color: var(--primary);
}

.pcal-day.is-selected {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(47, 128, 237, 0.28);
}

.pcal-day.is-selected .pcal-num {
  color: #fff;
}

.pcal-day.is-today.is-selected {
  background: var(--primary);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary), 0 4px 14px rgba(47, 128, 237, 0.28);
}

.pcal-day.has-tasks:not(.is-selected) {
  background: var(--primary-soft);
}

.pcal-day.has-tasks.is-today:not(.is-selected) {
  background: #dceaff;
}

.pcal-num {
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.pcal-compact .pcal-num {
  font-size: .78rem;
}

/* Corner badge — does not cover the day number */
.pcal-dot {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  min-width: .9rem;
  height: .9rem;
  padding: 0 .18rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: .58rem;
  line-height: .9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.pcal-compact .pcal-dot {
  top: 1px;
  inset-inline-start: 1px;
  min-width: .75rem;
  height: .75rem;
  font-size: .52rem;
  line-height: .75rem;
  padding: 0 .12rem;
}

.pcal-day.is-selected .pcal-dot {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.day-tasks-panel {
  min-height: 280px;
}

.day-task-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .65rem;
  padding: .6rem 0;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  transition: background .15s var(--ease), box-shadow .15s var(--ease), opacity .15s var(--ease);
}

.day-task-item.is-draggable {
  cursor: grab;
  padding-inline: .5rem;
  margin-inline: -.5rem;
}

.day-task-item.is-draggable:active {
  cursor: grabbing;
}

.day-task-item.is-dragging {
  opacity: .45;
  background: var(--surface-2);
}

.day-task-item.is-drop-before {
  box-shadow: inset 0 2px 0 0 var(--primary);
}

.day-task-item.is-drop-after {
  box-shadow: inset 0 -2px 0 0 var(--primary);
}

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

.day-task-item .title {
  font-weight: 600;
  margin-bottom: .2rem;
}

.day-task-item .meta {
  color: var(--muted);
  font-size: .82rem;
}

.day-task-item .drag-hint {
  color: var(--muted);
  font-size: .9rem;
  margin-inline-end: .15rem;
  opacity: .7;
}

.pcal-day.is-drop-target {
  outline: 2px dashed var(--primary);
  outline-offset: 1px;
  background: var(--primary-soft) !important;
  color: var(--text);
}

.pcal-day.is-drop-target .pcal-num {
  color: var(--primary);
}

.pcal-day.is-selected.is-drop-target {
  background: #c9ddff !important;
  color: var(--text);
  box-shadow: none;
}

.pcal.drop-active .pcal-day:not(.is-empty) {
  transition: outline .12s var(--ease), background .12s var(--ease);
}

/* ——— Icon actions ——— */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
  line-height: 1;
}

.btn-icon:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
  transform: translateY(-1px);
}

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

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

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

.btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.btn-icon-text i { font-size: 1.05rem; }

.action-group {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  opacity: .72;
  transition: opacity .2s var(--ease);
}

tr:hover .action-group,
.action-group:focus-within {
  opacity: 1;
}

.table > :not(caption) > * > * {
  vertical-align: middle;
}

.table tbody tr {
  transition: background .15s var(--ease), opacity .2s var(--ease), transform .2s var(--ease);
}

.table tbody tr.row-removing {
  opacity: 0;
  transform: translateX(8px);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--muted);
}

.empty-state i {
  display: block;
  font-size: 2rem;
  margin-bottom: .75rem;
  color: var(--primary);
  opacity: .55;
}

.side-link i {
  font-size: 1.05rem;
  width: 1.25rem;
  text-align: center;
  opacity: .85;
}

/* ——— Toasts ——— */
.toast-host {
  position: fixed;
  top: calc(var(--header-h) + .85rem);
  left: 1rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 2rem));
}

.app-toast {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .95rem 1.05rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: 0 10px 36px rgba(15, 40, 80, 0.12);
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: opacity .28s var(--ease), transform .28s var(--ease);
  pointer-events: auto;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-toast-success {
  border-color: rgba(5, 150, 105, 0.2);
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.95), rgba(255, 255, 255, 0.95));
}
.app-toast-error {
  border-color: rgba(225, 29, 72, 0.2);
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.96), rgba(255, 255, 255, 0.95));
}
.app-toast-info {
  border-color: rgba(47, 128, 237, 0.2);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.95));
}
.app-toast-warning {
  border-color: rgba(217, 119, 6, 0.22);
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.95));
}

.app-toast-icon {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.05rem;
}
.app-toast-success .app-toast-icon { color: var(--success); background: var(--success-soft); }
.app-toast-error .app-toast-icon { color: var(--danger); background: var(--danger-soft); }
.app-toast-info .app-toast-icon { color: var(--primary); background: var(--primary-soft); }
.app-toast-warning .app-toast-icon { color: var(--warning); background: var(--warning-soft); }

.app-toast-msg {
  flex: 1;
  font-size: .92rem;
  font-weight: 550;
  line-height: 1.5;
  padding-top: .1rem;
}

.app-toast-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.app-toast-close:hover { background: var(--surface-2); color: var(--text); }

/* ——— Confirm dialog ——— */
html.gox-dialog-open,
html.gox-busy {
  overflow: hidden;
}

.gox-dialog {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.gox-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .25s var(--ease);
}

.gox-dialog-card {
  position: relative;
  width: min(390px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(11, 18, 32, 0.22);
  padding: 1.3rem 1.2rem 1.1rem;
  text-align: center;
  transform: translateY(14px) scale(0.96);
  opacity: 0;
  transition: transform .28s var(--ease), opacity .28s var(--ease);
}

.gox-dialog.is-open .gox-dialog-backdrop { opacity: 1; }
.gox-dialog.is-open .gox-dialog-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gox-dialog-icon {
  width: 3.6rem;
  height: 3.6rem;
  margin: 0 auto .95rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.55rem;
}

.gox-dialog-icon-danger {
  color: var(--danger);
  background: radial-gradient(circle at 30% 25%, #fff, var(--danger-soft));
  box-shadow: 0 8px 22px rgba(225, 29, 72, 0.12);
}
.gox-dialog-icon-primary {
  color: var(--primary);
  background: radial-gradient(circle at 30% 25%, #fff, var(--primary-soft));
  box-shadow: 0 8px 22px rgba(47, 128, 237, 0.12);
}
.gox-dialog-icon-warning {
  color: var(--warning);
  background: radial-gradient(circle at 30% 25%, #fff, var(--warning-soft));
  box-shadow: 0 8px 22px rgba(217, 119, 6, 0.12);
}

.gox-dialog-title {
  font-size: 1.05rem;
  font-weight: 550;
  letter-spacing: -0.03em;
  margin: 0 0 .45rem;
}

.gox-dialog-body {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.65;
  margin: 0 0 1.35rem;
}

.gox-dialog-actions {
  display: flex;
  gap: .55rem;
  justify-content: center;
  flex-wrap: wrap;
}

.gox-dialog-actions .btn {
  min-width: 7.5rem;
}

.gox-dialog-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}

/* ——— Loading overlay ——— */
.gox-loading {
  position: fixed;
  inset: 0;
  z-index: 1180;
  display: grid;
  place-items: center;
  background: rgba(238, 244, 251, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .22s var(--ease);
}

.gox-loading.is-visible { opacity: 1; }

.gox-loading-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 1.4rem 1.7rem;
  min-width: 11rem;
  text-align: center;
}

.gox-spinner {
  display: flex;
  justify-content: center;
  gap: .35rem;
  margin-bottom: .85rem;
}

.gox-spinner span {
  width: .62rem;
  height: .62rem;
  border-radius: 999px;
  background: var(--primary);
  animation: gox-bounce 0.9s var(--ease) infinite;
}

.gox-spinner span:nth-child(2) {
  animation-delay: .12s;
  background: #5aa2f2;
}
.gox-spinner span:nth-child(3) {
  animation-delay: .24s;
  background: #89c0ff;
}

@keyframes gox-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .45; }
  40% { transform: translateY(-7px); opacity: 1; }
}

.gox-loading-text {
  margin: 0;
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted);
}

button.is-loading,
.btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: .78;
}

button.is-loading::after,
.btn.is-loading::after {
  content: "";
  width: .85rem;
  height: .85rem;
  margin-inline-start: .4rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -0.1em;
  animation: gox-spin .7s linear infinite;
}

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

.row-removing {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}

.modal-content {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md), var(--glass-inset);
}

.modal-header .modal-title {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  margin: 0;
}

.day-tasks-panel > .d-flex h2 {
  font-size: 1.15rem;
}

/* ——— AI chat ——— */
.ai-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 28rem;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  max-height: 48vh;
  padding: .25rem .15rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ai-empty {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: .95rem;
}

.ai-bubble {
  max-width: min(85%, 36rem);
  padding: .85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.ai-bubble-user {
  align-self: flex-start;
  background: var(--primary-soft);
  border-color: rgba(47, 128, 237, 0.18);
}

.ai-bubble-assistant {
  align-self: flex-end;
  background: var(--surface);
}

.ai-bubble-role {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .3rem;
}

.ai-bubble-text {
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: .95rem;
}

.ai-composer {
  display: flex;
  gap: .65rem;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: auto;
}

.ai-composer textarea {
  flex: 1;
  resize: none;
}

.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.ai-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.ai-chip:hover {
  background: var(--primary-soft);
  border-color: rgba(47, 128, 237, 0.25);
}

.ai-chat.is-busy .ai-composer {
  opacity: .7;
}

/* ——— AI chat ——— */
.ai-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 28rem;
}

.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.ai-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.ai-chip:hover {
  border-color: var(--border-strong);
  background: var(--primary-soft);
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
  padding: .25rem .15rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ai-empty {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: .95rem;
}

.ai-bubble {
  max-width: min(92%, 36rem);
  padding: .85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.ai-bubble-user {
  align-self: flex-start;
  background: var(--primary-soft);
  border-color: rgba(47, 128, 237, 0.18);
}

.ai-bubble-assistant {
  align-self: flex-end;
  background: #fff;
}

.ai-bubble-role {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .3rem;
}

.ai-bubble-text {
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: .95rem;
}

.ai-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .65rem;
  align-items: end;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: auto;
}

.ai-chat.is-busy .ai-composer {
  opacity: .72;
}

/* ——— AI chat ——— */
.ai-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 28rem;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  max-height: min(52vh, 520px);
  padding: .25rem .15rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ai-empty {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: .95rem;
}

.ai-bubble {
  max-width: min(85%, 36rem);
  padding: .85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  animation: gox-fade-up .25s var(--ease);
}

.ai-bubble-user {
  align-self: flex-start;
  background: var(--primary-soft);
  border-color: rgba(47, 128, 237, 0.18);
}

.ai-bubble-assistant {
  align-self: flex-end;
  background: var(--surface);
}

.ai-bubble-role {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .35rem;
}

.ai-bubble-text {
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: .95rem;
}

.ai-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .65rem;
  align-items: end;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: auto;
}

.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.ai-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.ai-chip:hover {
  background: var(--primary-soft);
  border-color: rgba(47, 128, 237, 0.22);
}

@keyframes gox-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ——— AI chat ——— */
.ai-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 28rem;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  max-height: min(52vh, 520px);
  padding: .25rem .15rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ai-empty {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: .95rem;
}

.ai-bubble {
  max-width: min(92%, 36rem);
  padding: .85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  animation: gox-fade-up .25s var(--ease);
}

.ai-bubble-user {
  align-self: flex-start;
  background: var(--primary-soft);
  border-color: rgba(47, 128, 237, 0.18);
}

.ai-bubble-assistant {
  align-self: flex-end;
  background: #fff;
}

.ai-bubble-role {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .3rem;
}

.ai-bubble-text {
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: .95rem;
}

.ai-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .65rem;
  align-items: end;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: auto;
}

.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.ai-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: .35rem .8rem;
  font-size: .82rem;
  font-weight: 600;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.ai-chip:hover {
  background: var(--primary-soft);
  border-color: rgba(47, 128, 237, 0.22);
}

@keyframes gox-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.side-nav .kanban-date-filter,
.operator-shell .kanban-date-filter {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
}

.side-nav-logout {
  margin-top: .75rem;
}

.kanban-date-filter {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  width: 100%;
}

.kanban-date-filter-label {
  font-size: .75rem;
  text-align: center;
  margin: 0;
}

.kanban-date-filter .kanban-pcal {
  --pcal-cell: 1.35rem;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 100%;
  padding: .45rem .4rem .5rem;
}

.operator-shell .kanban-date-filter {
  max-width: 12.5rem;
  margin-bottom: 1rem;
}

.kanban-date-filter .pcal-tiny .pcal-head {
  margin-bottom: .25rem;
  gap: .2rem;
}

.kanban-date-filter .pcal-tiny .pcal-title {
  font-size: .72rem;
  font-weight: 650;
}

.kanban-date-filter .pcal-tiny .btn-icon {
  width: 1.45rem;
  height: 1.45rem;
  font-size: .75rem;
}

.kanban-date-filter .pcal-tiny .pcal-grid {
  gap: .1rem;
}

.kanban-date-filter .pcal-tiny .pcal-weekday {
  font-size: .58rem;
  padding: .05rem 0;
}

.kanban-date-filter .pcal-tiny .pcal-day {
  border-radius: 4px;
  min-height: var(--pcal-cell);
}

.kanban-date-filter .pcal-tiny .pcal-num {
  font-size: .65rem;
  font-weight: 600;
}

.kanban-date-filter .pcal-tiny .pcal-dot {
  top: 0;
  inset-inline-start: 0;
  min-width: .55rem;
  height: .55rem;
  font-size: .45rem;
  border-width: 1px;
}

.kanban-date-filter .pcal-tiny .pcal-dot-count {
  font-size: .45rem;
  line-height: 1;
}

.kanban-date-filter .btn.disabled {
  pointer-events: none;
  opacity: .55;
}

/* ——— Kanban board ——— */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: .85rem;
  align-items: start;
  overflow-x: auto;
  padding-bottom: .35rem;
}

.kanban-column {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), var(--glass-inset);
  min-height: 22rem;
  display: flex;
  flex-direction: column;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}

.kanban-column.is-drop-target {
  border-color: rgba(47, 128, 237, 0.45);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.12), var(--shadow-sm);
  background: rgba(239, 246, 255, 0.65);
}

.kanban-col-todo { border-top: 3px solid var(--primary); }
.kanban-col-inprogress { border-top: 3px solid var(--info); }
.kanban-col-done { border-top: 3px solid var(--success); }
.kanban-col-blocked { border-top: 3px solid var(--danger); }
.kanban-col-skipped { border-top: 3px solid var(--warning); }

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .85rem .9rem .55rem;
}

.kanban-col-title {
  margin: 0;
  font-size: .95rem;
  font-weight: 650;
}

.kanban-col-count {
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 .4rem;
}

.kanban-col-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: .35rem .75rem .9rem;
  min-height: 12rem;
}

.kanban-card {
  cursor: grab;
  margin: 0;
  padding: .75rem .8rem;
  user-select: none;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.is-dragging {
  opacity: .45;
  transform: scale(0.98);
}

.kanban-card-title {
  color: inherit;
  font-weight: 650;
  text-decoration: none;
  line-height: 1.35;
}

.kanban-card-title:hover {
  color: var(--primary);
}

.kanban-status-select {
  font-size: .78rem;
}

.kanban-board.is-dragging .kanban-card-title {
  pointer-events: none;
}

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(5, minmax(200px, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    padding: .75rem;
  }
  .side-title { width: 100%; margin-bottom: .35rem; }
  .side-link { margin-bottom: 0; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 1.2rem; }
  .glass-stage {
    border-radius: 20px;
    padding: 1rem;
    min-height: 0;
  }
  .kanban-board {
    grid-template-columns: repeat(5, minmax(180px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
