/* ===================================================================
   Theta Theme v2 — ClickUp-inspired design system
   Palette: #005ecb (accent for both themes)
   =================================================================== */

:root {
  --th-accent: #005ecb;
  --th-accent-light: #1a7ef0;
  --th-accent-bg: rgba(0,94,203,.08);
  --th-accent-bg-hover: rgba(0,94,203,.14);
  --th-accent-focus: rgba(0,94,203,.12);
  --th-accent-shadow: rgba(0,94,203,.3);
  --th-surface: #fff;
  --th-surface-raised: #f8faf9;
  --th-text: #1a1d21;
  --th-text-muted: #556170;
  --th-border: #e5e7eb;
  --th-shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --th-shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --th-shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --th-radius-sm: 6px;
  --th-radius: 10px;
  --th-radius-lg: 14px;
  --th-transition: .2s cubic-bezier(.4,0,.2,1);
}

html[data-theme="dark"] {
  --th-surface: #141517;
  --th-surface-raised: #1a1d21;
  --th-text: #e5e7eb;
  --th-text-muted: #a8b0bd;
  --th-border: rgba(255,255,255,.12);
  --th-shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --th-shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --th-shadow-lg: 0 8px 32px rgba(0,0,0,.5);
  --th-accent: #005ecb;
  --th-accent-light: #1a7ef0;
  --th-accent-bg: rgba(0,94,203,.12);
  --th-accent-bg-hover: rgba(0,94,203,.18);
  --th-accent-focus: rgba(0,94,203,.2);
  --th-accent-shadow: rgba(0,94,203,.35);
}

/* ===================================================================
   Animations
   =================================================================== */
@keyframes th-fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes th-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes th-scaleIn {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes th-slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes th-skeleton {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.th-animate-in { animation: th-fadeInUp .4s ease both; }
.th-animate-in-delay-1 { animation-delay: .05s; }
.th-animate-in-delay-2 { animation-delay: .1s; }
.th-animate-in-delay-3 { animation-delay: .15s; }

/* Skeleton loader */
.th-skeleton {
  background: linear-gradient(90deg, var(--th-border) 25%, transparent 50%, var(--th-border) 75%);
  background-size: 200% 100%;
  animation: th-skeleton 1.5s infinite;
  border-radius: var(--th-radius-sm);
  min-height: 16px;
}

/* ===================================================================
   Cards
   =================================================================== */
.th-card {
  background: var(--th-surface);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-lg);
  padding: 1.25rem;
  transition: all var(--th-transition);
  box-shadow: var(--th-shadow-sm);
}
.th-card:hover {
  box-shadow: var(--th-shadow-md);
  border-color: var(--th-accent);
}
.th-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: .75rem; margin-bottom: .75rem;
  border-bottom: 1px solid var(--th-border);
}
.th-card-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--th-text-muted);
  margin: 0;
}

/* ===================================================================
   KPI Cards
   =================================================================== */
.th-kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .75rem;
}
.th-kpi {
  background: var(--th-surface);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all var(--th-transition);
  box-shadow: var(--th-shadow-sm);
}
.th-kpi:hover { box-shadow: var(--th-shadow-md); transform: translateY(-1px); }
.th-kpi-icon {
  width: 44px; height: 44px; border-radius: var(--th-radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.th-kpi-icon.purple { background: var(--th-accent-bg); color: var(--th-accent); }
.th-kpi-icon.green { background: rgba(22,163,74,.1); color: #16a34a; }
.th-kpi-icon.blue { background: rgba(59,130,246,.1); color: #3b82f6; }
.th-kpi-icon.amber { background: rgba(217,119,6,.1); color: #d97706; }
.th-kpi-body { min-width: 0; }
.th-kpi-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; color: var(--th-text); }
.th-kpi-label { font-size: .72rem; color: var(--th-text-muted); margin-top: .1rem; }

/* ===================================================================
   Tabs (ClickUp-style)
   =================================================================== */
.th-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--th-border);
  margin-bottom: 1.25rem;
}
.th-tab {
  padding: .6rem 1rem; font-size: .8rem; font-weight: 600;
  color: var(--th-text-muted) !important; cursor: pointer; border: none !important;
  background: transparent !important; border-bottom: 2px solid transparent !important;
  margin-bottom: -2px; transition: all var(--th-transition);
  display: flex; align-items: center; gap: .35rem;
}
.th-tab:hover { color: var(--th-text) !important; background: var(--th-accent-bg) !important; }
.th-tab.active { color: #fff !important; border-bottom-color: var(--th-accent) !important; background: var(--th-accent) !important; font-weight: 700; border-radius: var(--th-radius-sm) var(--th-radius-sm) 0 0; box-shadow: 0 -2px 8px var(--th-accent-shadow); }
.th-tab .th-tab-badge {
  background: var(--th-accent-bg); color: var(--th-accent);
  font-size: .65rem; padding: .1rem .45rem; border-radius: 50px;
}

/* ===================================================================
   Status pills
   =================================================================== */
.th-status {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .6rem; border-radius: 50px;
  font-size: .72rem; font-weight: 600; cursor: pointer;
  transition: all var(--th-transition); user-select: none;
}
.th-status:hover { filter: brightness(.95); transform: scale(1.04); }
.th-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.th-status.aperto { background: #eff6ff; color: #1d4ed8; }
.th-status.aperto::before { background: #3b82f6; }
.th-status.in-corso { background: #eef2ff; color: #4338ca; }
.th-status.in-corso::before { background: #6366f1; }
.th-status.in-revisione { background: #fffbeb; color: #92400e; }
.th-status.in-revisione::before { background: #f59e0b; }
.th-status.in-attesa-aggiornamenti { background: #f3f4f6; color: #4b5563; }
.th-status.in-attesa-aggiornamenti::before { background: #9ca3af; }
.th-status.completato { background: #f0fdf4; color: #166534; }
.th-status.completato::before { background: #22c55e; }
.th-status.chiuso { background: #f3f4f6; color: #374151; }
.th-status.chiuso::before { background: #6b7280; }

html[data-theme="dark"] .th-status.aperto { background: rgba(59,130,246,.15); color: #93c5fd; }
html[data-theme="dark"] .th-status.in-corso { background: rgba(99,102,241,.15); color: #c7d2fe; }
html[data-theme="dark"] .th-status.in-revisione { background: rgba(245,158,11,.15); color: #fde68a; }
html[data-theme="dark"] .th-status.in-attesa-aggiornamenti { background: rgba(156,163,175,.12); color: #d1d5db; }
html[data-theme="dark"] .th-status.completato { background: rgba(34,197,94,.15); color: #86efac; }
html[data-theme="dark"] .th-status.chiuso { background: rgba(107,114,128,.12); color: #9ca3af; }

/* ===================================================================
   Priority pills
   =================================================================== */
.th-pri {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem; border-radius: 4px;
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
}
.th-pri.alta { background: #fef2f2; color: #dc2626; }
.th-pri.media { background: #fffbeb; color: #b45309; }
.th-pri.normale { background: #eff6ff; color: #2563eb; }
.th-pri.bassa { background: #f0fdf4; color: #15803d; }
html[data-theme="dark"] .th-pri.alta { background: rgba(220,38,38,.15); color: #fca5a5; }
html[data-theme="dark"] .th-pri.media { background: rgba(180,83,9,.15); color: #fcd34d; }
html[data-theme="dark"] .th-pri.normale { background: rgba(37,99,235,.15); color: #93c5fd; }
html[data-theme="dark"] .th-pri.bassa { background: rgba(21,128,61,.15); color: #86efac; }

/* ===================================================================
   Buttons
   =================================================================== */
.th-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .85rem; font-size: .78rem; font-weight: 600;
  border-radius: var(--th-radius-sm); border: none; cursor: pointer;
  transition: all var(--th-transition); text-decoration: none;
  line-height: 1.4;
}
.th-btn-primary { background: var(--th-accent); color: #fff; }
.th-btn-primary:hover { background: var(--th-accent-light); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px var(--th-accent-shadow); }
.th-btn-ghost { background: transparent; color: var(--th-text-muted); }
.th-btn-ghost:hover { background: var(--th-surface-raised); color: var(--th-text); }
.th-btn-outline { background: transparent; border: 1px solid var(--th-border); color: var(--th-text); }
.th-btn-outline:hover { border-color: var(--th-accent); color: var(--th-accent); background: var(--th-accent-bg); }

/* ===================================================================
   Table improvements
   =================================================================== */
.th-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
}
.th-table th {
  text-align: left; padding: .55rem .8rem;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--th-text-muted);
  background: var(--th-surface-raised);
  border-bottom: 2px solid var(--th-border);
  position: sticky; top: 0; z-index: 1;
}
.th-table td {
  padding: .6rem .8rem; font-size: .8rem;
  border-bottom: 1px solid var(--th-border);
  color: var(--th-text);
}
.th-table tr:hover td { background: var(--th-accent-bg); }
.th-table tr:last-child td { border-bottom: none; }

/* Table filter row */
.th-filter-row th { padding: .35rem .8rem; background: transparent; border-bottom: 1px solid var(--th-border); }
.th-filter-input {
  width: 100%; border: 1px solid var(--th-border); border-radius: var(--th-radius-sm);
  padding: .35rem .5rem; font-size: .75rem; background: var(--th-surface);
  color: var(--th-text); outline: none; transition: border-color var(--th-transition);
}
.th-filter-input:focus { border-color: var(--th-accent); }
.th-filter-select {
  width: 100%; min-width: 100px; border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm); padding: .35rem .5rem;
  font-size: .75rem; background: var(--th-surface); color: var(--th-text);
  outline: none; cursor: pointer;
}

/* Row link */
.th-row-link { color: var(--th-accent); text-decoration: none; font-weight: 600; }
.th-row-link:hover { text-decoration: underline; }

/* ===================================================================
   Board Kanban improvements
   =================================================================== */
.th-board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.th-board-col {
  min-width: 280px; max-width: 320px; flex-shrink: 0;
  background: var(--th-surface-raised); border-radius: var(--th-radius-lg);
  border: 1px solid var(--th-border);
  display: flex; flex-direction: column; max-height: calc(100vh - 180px);
}
.th-board-col-head {
  padding: .75rem 1rem; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--th-border); flex-shrink: 0;
}
.th-board-col-count {
  background: var(--th-border); color: var(--th-text-muted);
  font-size: .65rem; padding: .1rem .45rem; border-radius: 50px;
}
.th-board-col-body { flex: 1; overflow-y: auto; padding: .5rem; display: flex; flex-direction: column; gap: .4rem; }
.th-board-card {
  background: var(--th-surface); border: 1px solid var(--th-border);
  border-radius: var(--th-radius); padding: .7rem .85rem;
  cursor: grab; transition: all var(--th-transition);
  box-shadow: var(--th-shadow-sm);
}
.th-board-card:hover { box-shadow: var(--th-shadow-md); border-color: var(--th-accent); }
.th-board-card:active { cursor: grabbing; }
.th-board-card.dragging { opacity: .35; }
.th-board-card.drag-over { border-color: var(--th-accent); background: var(--th-accent-bg); }
.th-board-card-title { font-size: .8rem; font-weight: 600; color: var(--th-text); margin-bottom: .35rem; line-height: 1.3; }
.th-board-card-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.th-board-card-avatars { display: flex; }
.th-board-av {
  width: 22px; height: 22px; border-radius: 50%; font-size: .6rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  color: #fff; margin-left: -6px; border: 2px solid var(--th-surface);
}
.th-board-av:first-child { margin-left: 0; }

/* ===================================================================
   Drawer improvements
   =================================================================== */
.th-drawer {
  position: fixed; top: 0; right: 0; width: min(540px, 94vw); height: 100vh;
  background: var(--th-surface); z-index: 1051;
  box-shadow: -4px 0 40px rgba(0,0,0,.15);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.th-drawer.open { transform: translateX(0); }
html[data-theme="dark"] .th-drawer { box-shadow: -4px 0 40px rgba(0,0,0,.5); }
.th-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.3);
  z-index: 1050; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.th-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.th-drawer-section {
  padding: .75rem 0; border-bottom: 1px solid var(--th-border);
}
.th-drawer-section:last-child { border-bottom: none; }
.th-drawer-section-title {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--th-text-muted);
  margin-bottom: .5rem; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: .35rem;
}
.th-drawer-section-title::after {
  content: '▾'; font-size: .6rem; transition: transform var(--th-transition);
}
.th-drawer-section.collapsed .th-drawer-section-title::after { transform: rotate(-90deg); }
.th-drawer-section.collapsed .th-drawer-section-body { display: none; }

/* ===================================================================
   Form improvements
   =================================================================== */
.th-field {
  display: flex; flex-direction: column; gap: .25rem; margin-bottom: .75rem;
}
.th-field-label {
  font-size: .7rem; font-weight: 600; color: var(--th-text-muted);
  text-transform: uppercase; letter-spacing: .03em;
}
.th-input {
  border: 1px solid var(--th-border); border-radius: var(--th-radius-sm);
  padding: .5rem .65rem; font-size: .82rem; background: var(--th-surface);
  color: var(--th-text); outline: none; transition: all var(--th-transition);
}
.th-input:hover { border-color: var(--th-text-muted); }
.th-input:focus { border-color: var(--th-accent); box-shadow: 0 0 0 3px var(--th-accent-focus); }
.th-input::placeholder { color: var(--th-text-muted); opacity: .6; }
textarea.th-input { resize: vertical; min-height: 70px; }
.th-select {
  border: 1px solid var(--th-border); border-radius: var(--th-radius-sm);
  padding: .5rem .65rem; font-size: .82rem; background: var(--th-surface);
  color: var(--th-text); outline: none; cursor: pointer;
  transition: all var(--th-transition); appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .5rem center;
  padding-right: 2rem;
}
.th-select:focus { border-color: var(--th-accent); box-shadow: 0 0 0 3px var(--th-accent-focus); }

/* ===================================================================
   Avatars
   =================================================================== */
.th-av {
  width: 28px; height: 28px; border-radius: 50%;
  font-size: .65rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.th-av-stack { display: flex; }
.th-av-stack .th-av { margin-left: -8px; border: 2px solid var(--th-surface); }
.th-av-stack .th-av:first-child { margin-left: 0; }

/* ===================================================================
   Badge / Chip
   =================================================================== */
.th-chip {
  display: inline-flex; align-items: center; gap: .2rem;
  padding: .15rem .5rem; border-radius: 50px;
  font-size: .68rem; font-weight: 600;
  background: var(--th-surface-raised); color: var(--th-text-muted);
  border: 1px solid var(--th-border);
}

/* Mention in comments */
.th-mention { color: var(--th-accent); font-weight: 600; background: var(--th-accent-bg); padding: 0 .2rem; border-radius: 3px; }

/* ===================================================================
   Toast
   =================================================================== */
.th-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  background: #16a34a; color: #fff; padding: 10px 20px;
  border-radius: var(--th-radius); font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: th-fadeInUp .3s ease both;
}
.th-toast.error { background: #dc2626; }

/* ===================================================================
   Empty state
   =================================================================== */
.th-empty {
  text-align: center; padding: 2.5rem 1rem;
  color: var(--th-text-muted);
}
.th-empty-icon { font-size: 2.5rem; margin-bottom: .5rem; opacity: .5; }
.th-empty-title { font-size: .9rem; font-weight: 600; margin-bottom: .25rem; }
.th-empty-desc { font-size: .78rem; }

/* ===================================================================
   Breadcrumb
   =================================================================== */
.th-breadcrumb {
  font-size: .75rem; color: var(--th-text-muted);
  margin-bottom: .4rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
}
.th-breadcrumb a { color: var(--th-text-muted); text-decoration: none; transition: color var(--th-transition); }
.th-breadcrumb a:hover { color: var(--th-accent); text-decoration: underline; }
.th-breadcrumb span { color: var(--th-text); font-weight: 600; }
.th-breadcrumb-sep { color: var(--th-border); font-weight: 400; user-select: none; }

/* ===================================================================
   CMD+K Search
   =================================================================== */
.th-search-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.th-search-overlay.open { opacity: 1; pointer-events: auto; }
.th-search-modal {
  width: min(560px, 94vw); background: var(--th-surface);
  border-radius: var(--th-radius-lg); box-shadow: var(--th-shadow-lg);
  overflow: hidden; animation: th-scaleIn .2s ease both;
}
.th-search-input-wrap {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem; border-bottom: 2px solid var(--th-accent);
}
.th-search-icon { font-size: 1.1rem; opacity: .5; flex-shrink: 0; }
.th-search-input {
  flex: 1; border: none; outline: none; font-size: .95rem;
  background: transparent; color: var(--th-text); font-family: inherit;
}
.th-search-input::placeholder { color: var(--th-text-muted); }
.th-search-kbd {
  font-size: .65rem; padding: .15rem .4rem; border-radius: 4px;
  background: var(--th-surface-raised); color: var(--th-text-muted);
  border: 1px solid var(--th-border); font-family: inherit;
}
.th-search-results { max-height: 320px; overflow-y: auto; }
.th-search-hint, .th-search-empty, .th-search-loading, .th-search-more {
  padding: 2rem 1rem; text-align: center; font-size: .8rem; color: var(--th-text-muted);
}
.th-search-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1rem; text-decoration: none; color: var(--th-text);
  border-bottom: 1px solid var(--th-border); transition: background var(--th-transition);
}
.th-search-item:hover { background: var(--th-accent-bg); }
.th-search-item-name { font-weight: 600; font-size: .82rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-search-item-meta { display: flex; align-items: center; gap: .35rem; font-size: .7rem; flex-shrink: 0; margin-left: .5rem; }

/* Toast improvements */
.th-toast {
  cursor: pointer; max-width: 380px; word-break: break-word;
  transition: opacity .3s;
}
.th-toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; }

/* ===================================================================
   Pagination
   =================================================================== */
.th-pagination { display: flex; align-items: center; justify-content: center; gap: .25rem; margin-top: 1rem; }
.th-pagination a, .th-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 .5rem;
  border-radius: var(--th-radius-sm); font-size: .78rem; font-weight: 600;
  text-decoration: none; transition: all var(--th-transition);
  border: 1px solid var(--th-border); color: var(--th-text);
}
.th-pagination a:hover { border-color: var(--th-accent); color: var(--th-accent); background: var(--th-accent-bg); }
.th-pagination span.active { background: var(--th-accent); color: #fff; border-color: var(--th-accent); }
.th-pagination span.disabled { opacity: .4; pointer-events: none; }
.th-pagination-info { font-size: .72rem; color: var(--th-text-muted); margin-left: .75rem; }

/* ===================================================================
   Bulk actions
   =================================================================== */
.th-bulk-bar { display: none; align-items: center; gap: .5rem; padding: .5rem .75rem; background: var(--th-accent-bg); border-radius: var(--th-radius); margin-bottom: .75rem; }
.th-bulk-bar.visible { display: flex; }
.th-bulk-bar .th-bulk-count { font-size: .78rem; font-weight: 600; color: var(--th-accent); }

/* ===================================================================
   Status dropdown (click su pill nella tabella)
   =================================================================== */
.cu-status-dropdown {
  position: fixed; z-index: 1060;
  background: var(--th-surface); border: 1px solid var(--th-border);
  border-radius: var(--th-radius); box-shadow: var(--th-shadow-lg);
  min-width: 200px; overflow: hidden;
}
.cu-status-dropdown-item {
  padding: .5rem .75rem; font-size: .78rem; font-weight: 600;
  cursor: pointer; color: var(--th-text); transition: background var(--th-transition);
  display: flex; align-items: center; gap: .4rem;
}
.cu-status-dropdown-item:hover { background: var(--th-accent-bg); color: var(--th-accent); }

/* ===================================================================
   Calendar theming
   =================================================================== */
.cu-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  background: var(--th-border); border-radius: var(--th-radius-lg); overflow: hidden;
  border: 1px solid var(--th-border);
}
.cu-cal-header {
  background: var(--th-surface-raised); padding: .5rem; text-align: center;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--th-text-muted);
}
.cu-cal-cell {
  background: var(--th-surface); padding: .4rem; min-height: 72px;
  transition: background var(--th-transition); position: relative;
}
.cu-cal-cell:hover { background: var(--th-accent-bg); }
.cu-cal-cell.today { background: rgba(0,94,203,.05); }
html[data-theme="dark"] .cu-cal-cell.today { background: rgba(0,94,203,.08); }
.cu-cal-cell.weekend { background: var(--th-surface-raised); }
.cu-cal-cell.empty { background: var(--th-surface-raised); opacity: .5; }
.cu-cal-day { font-size: .72rem; font-weight: 600; color: var(--th-text); }
.cu-cal-cell.today .cu-cal-day { color: var(--th-accent); font-weight: 800; }
.cu-cal-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: .2rem; }
.cu-cal-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cu-cal-more { font-size: .55rem; color: var(--th-text-muted); margin-left: 2px; }
.cu-cal-group {
  background: var(--th-surface); border: 1px solid var(--th-border);
  border-radius: var(--th-radius-lg); margin-bottom: .5rem; overflow: hidden;
  transition: box-shadow var(--th-transition);
}
.cu-cal-group:hover { box-shadow: var(--th-shadow-md); }
.cu-cal-group.today { border-color: var(--th-accent); }
.cu-cal-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem .85rem; background: var(--th-surface-raised);
  border-bottom: 1px solid var(--th-border);
}
.cu-cal-group-date { font-size: .82rem; font-weight: 700; color: var(--th-text); display: flex; align-items: center; gap: .4rem; }
.cu-cal-group-count { font-size: .7rem; color: var(--th-text-muted); }
.cu-cal-group-items { padding: .25rem 0; }
.cu-cal-course {
  display: flex; align-items: center; gap: .6rem; padding: .45rem .85rem;
  text-decoration: none; color: var(--th-text); transition: background var(--th-transition);
  border-bottom: 1px solid var(--th-border);
}
.cu-cal-course:last-child { border-bottom: none; }
.cu-cal-course:hover { background: var(--th-accent-bg); }
.cu-cal-course-pri { width: 6px; height: 30px; border-radius: 3px; flex-shrink: 0; }
.cu-cal-course-info { flex: 1; min-width: 0; }
.cu-cal-course-info strong { display: block; font-size: .78rem; line-height: 1.3; }
.cu-cal-course-info small { font-size: .68rem; color: var(--th-text-muted); }

/* ===================================================================
   Mobile
   =================================================================== */
@media (max-width: 768px) {
  .th-drawer { width: 100vw; }
  .th-kpi-grid { grid-template-columns: 1fr 1fr; }
  .th-board-col { min-width: 260px; max-width: 280px; }
}
