/* ===================================================================
   Akord kalendar — neutralni dizajn-sustav, jedan akcent (Akord žuta)
   Svijetli (toplo off-white) + tamni mod. Bez gradijenata.
   3 stupca: Tim (lijevo) · Kalendar (centar, najveći) · Zid (desno)
   =================================================================== */

:root {
  --background: 40 17% 95%;
  --foreground: 0 0% 9%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 9%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 9%;
  --primary: 38 80% 55%;
  --primary-foreground: 0 0% 9%;
  --primary-hover: 38 80% 49%;
  --secondary: 40 14% 92%;
  --secondary-foreground: 0 0% 9%;
  --muted: 40 14% 92%;
  --muted-foreground: 0 0% 42%;
  --accent: 38 80% 55%;
  --accent-foreground: 0 0% 9%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --success: 142 76% 36%;
  --warning: 38 80% 55%;
  --border: 40 11% 86%;
  --input: 40 11% 86%;
  --ring: 38 80% 55%;
  --badge-neutral: 40 12% 89%;
  --shadow-color: 220 25% 22%;
  --shadow-xs: 0 1px 2px hsl(var(--shadow-color) / 0.05);
  --shadow-sm: 0 1px 2px hsl(var(--shadow-color) / 0.06), 0 2px 4px hsl(var(--shadow-color) / 0.05);
  --shadow-md: 0 4px 12px hsl(var(--shadow-color) / 0.07);
  --shadow-lg: 0 12px 32px hsl(220 40% 8% / 0.14);
  --radius-xl: 14px;
  --radius-lg: 11px;
  --radius: 8px;
  --radius-sm: 6px;
}
html.dark {
  --background: 0 0% 7%;
  --foreground: 0 0% 95%;
  --card: 0 0% 11%;
  --card-foreground: 0 0% 95%;
  --popover: 0 0% 11%;
  --popover-foreground: 0 0% 95%;
  --primary: 38 82% 58%;
  --primary-foreground: 0 0% 9%;
  --primary-hover: 38 82% 64%;
  --secondary: 0 0% 15%;
  --secondary-foreground: 0 0% 95%;
  --muted: 0 0% 15%;
  --muted-foreground: 0 0% 65%;
  --accent: 38 82% 58%;
  --accent-foreground: 0 0% 9%;
  --destructive: 0 62% 55%;
  --destructive-foreground: 0 0% 100%;
  --success: 142 70% 45%;
  --warning: 38 82% 58%;
  --border: 0 0% 20%;
  --input: 0 0% 20%;
  --ring: 38 82% 58%;
  --badge-neutral: 0 0% 22%;
  --shadow-color: 0 0% 0%;
  --shadow-lg: 0 12px 32px hsl(0 0% 0% / 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: hsl(var(--foreground)); background: hsl(var(--background));
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; letter-spacing: -0.01em;
}
button { font-family: inherit; }
h1, h2, .month-title, .modal-head h2, .drawer-day, .brand-tag, .agenda-day, .sidebar-title, .panel-title {
  font-family: "Inter", system-ui, sans-serif; letter-spacing: -0.022em;
}

.app-shell { max-width: 1560px; margin: 0 auto; padding: 16px 20px 24px; min-height: 100vh; display: flex; flex-direction: column; }

/* ===================== TOP BAR ===================== */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-xl);
  padding: 13px 18px; box-shadow: var(--shadow-xs); margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-link { display: inline-flex; align-items: center; }
.brand-logo { height: 26px; width: auto; display: block; }
.dark-only { display: none; }
html.dark .light-only { display: none; }
html.dark .dark-only { display: block; }
.brand-tag { font-weight: 600; font-size: 14px; color: hsl(var(--muted-foreground)); padding-left: 12px; border-left: 1px solid hsl(var(--border)); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ----- "Na redu" plutajuće obaveze u zaglavlju ----- */
.topbar-feed { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; justify-content: center; overflow: hidden; padding: 0 10px; }
.feed-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--radius);
  background: hsl(var(--secondary)); border: 1px solid hsl(var(--border)); cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: hsl(var(--foreground)); white-space: nowrap; max-width: 210px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.feed-chip:hover { background: hsl(var(--card)); box-shadow: var(--shadow-sm); }
.feed-chip .fc-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.feed-chip .fc-when { font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground)); font-weight: 700; }
.feed-chip .fc-title { overflow: hidden; text-overflow: ellipsis; }
.feed-empty { font-size: 12.5px; color: hsl(var(--muted-foreground)); font-weight: 500; opacity: 0.7; }
@keyframes floaty { 0%, 100% { transform: translateY(-2.5px); } 50% { transform: translateY(2.5px); } }
@media (prefers-reduced-motion: reduce) { .feed-chip { animation: none; } }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent;
  border-radius: var(--radius); padding: 9px 14px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.btn .ico { font-size: 15px; line-height: 1; }
.btn:active { transform: translateY(1px); }
.btn-icon { padding: 9px; width: 38px; justify-content: center; position: relative; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: hsl(var(--primary-hover)); }
.btn-ghost { background: hsl(var(--card)); color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
.btn-ghost:hover { background: hsl(var(--secondary)); }
.btn-danger { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.btn-danger:hover { filter: brightness(0.94); }
.icon-btn {
  border: none; background: transparent; color: hsl(var(--muted-foreground)); width: 34px; height: 34px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 15px; transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }

/* ----- SVG ikonice ----- */
.ico { display: inline-flex; align-items: center; justify-content: center; }
.ic { width: 18px; height: 18px; display: block; flex: 0 0 auto; }
.ic.sm { width: 14px; height: 14px; }
.ic.big { width: 36px; height: 36px; }
.nav-btn, .icon-btn { display: inline-flex; align-items: center; justify-content: center; }
.nav-btn .ic { width: 21px; height: 21px; }
.tag { display: inline-flex; align-items: center; gap: 4px; }
.er-meta span { display: inline-flex; align-items: center; gap: 4px; }
.ni-title { display: flex; align-items: center; gap: 6px; }
.notif-enable { display: flex; align-items: center; justify-content: center; gap: 6px; }
.drawer-holiday, .agenda-holiday { display: inline-flex; align-items: center; gap: 6px; }
.sidebar-title .ic { width: 18px; height: 18px; }
.empty-day .ic.big, .agenda-empty .ic.big { display: block; margin: 0 auto 10px; opacity: 0.5; }

/* ----- Apple glass ----- */
.glass {
  background: hsl(var(--card) / 0.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.7);
  backdrop-filter: blur(14px) saturate(1.7);
  border: 1px solid hsl(0 0% 100% / 0.5);
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.65), var(--shadow-sm);
  color: hsl(var(--foreground));
}
.glass:hover { background: hsl(var(--card) / 0.82); }
html.dark .glass { background: hsl(0 0% 100% / 0.07); border-color: hsl(0 0% 100% / 0.12); box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.14), var(--shadow-sm); }
html.dark .glass:hover { background: hsl(0 0% 100% / 0.13); }
/* glass i na izbornicima/ladici — zamućenje preko sadržaja (veća specifičnost) */
.user-switcher .dropdown, .notif .notif-dropdown {
  background: hsl(var(--popover) / 0.82);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
}
.overlay .drawer {
  background: hsl(var(--card) / 0.9);
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
}

/* ----- Zid / Tim prekidači (zatamni/posvijetli prema stanju) ----- */
.toggle-btn { color: hsl(var(--muted-foreground)); }
.toggle-btn:not(.active) { opacity: 0.62; }
.toggle-btn:not(.active):hover { opacity: 1; }
.toggle-btn.active { color: hsl(var(--foreground)); background: hsl(var(--accent) / 0.20); border-color: hsl(var(--accent) / 0.5); box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.5), 0 0 0 3px hsl(var(--accent) / 0.14); }
html.dark .toggle-btn.active { background: hsl(var(--accent) / 0.26); }

/* ===================== NOTIFICATIONS ===================== */
.notif { position: relative; }
.notif-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; background: hsl(var(--destructive)); color: #fff; border-radius: 100px; font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.notif-dropdown { position: absolute; right: 0; top: calc(100% + 9px); width: 320px; max-height: 70vh; overflow-y: auto; background: hsl(var(--popover)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 8px; z-index: 70; animation: pop 0.14s ease; }
.notif-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); font-weight: 700; padding: 8px 10px 5px; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.notif-item:hover { background: hsl(var(--secondary)); }
.notif-item .ni-bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--owner, hsl(var(--primary))); flex: 0 0 auto; }
.notif-item .ni-main { flex: 1; min-width: 0; }
.notif-item .ni-title { font-size: 13.5px; font-weight: 600; }
.notif-item .ni-meta { font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.notif-empty { padding: 22px 12px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; }
.notif-enable { margin: 6px; padding: 9px 10px; border-radius: var(--radius-sm); background: hsl(var(--accent) / 0.14); color: hsl(var(--foreground)); font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: center; }
.notif-enable:hover { background: hsl(var(--accent) / 0.22); }

/* ===================== USER SWITCHER ===================== */
.user-switcher { position: relative; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 6px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 100px; cursor: pointer; color: hsl(var(--foreground)); transition: background 0.15s ease; }
.user-chip:hover { background: hsl(var(--secondary)); }
.user-chip .caret { color: hsl(var(--muted-foreground)); font-size: 11px; }
.user-chip .name { font-weight: 600; font-size: 14px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.dropdown { position: absolute; right: 0; top: calc(100% + 9px); background: hsl(var(--popover)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 7px; min-width: 240px; z-index: 60; animation: pop 0.14s ease; }
.dropdown-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); font-weight: 700; padding: 6px 10px 4px; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 500; color: hsl(var(--popover-foreground)); }
.dropdown-item:hover { background: hsl(var(--secondary)); }
.dropdown-item.active { background: hsl(var(--accent) / 0.16); }
.dropdown-item .di-main { flex: 1; min-width: 0; }
.dropdown-item .di-sub { font-size: 11.5px; color: hsl(var(--muted-foreground)); font-weight: 500; }
.dropdown-item .check { margin-left: auto; color: hsl(var(--primary)); font-weight: 700; }
.dropdown-item.logout { border-top: 1px solid hsl(var(--border)); margin-top: 6px; padding-top: 10px; color: hsl(var(--muted-foreground)); }
.dropdown-item.logout .ic { width: 16px; height: 16px; }

/* ===================== WORKSPACE — 3 COLUMNS ===================== */
.workspace {
  display: grid; grid-template-columns: 224px minmax(0, 1fr) 326px; grid-template-areas: "left center right";
  gap: 16px; flex: 1; align-items: start;
}
.workspace.sidebar-hidden { grid-template-columns: 224px minmax(0, 1fr); grid-template-areas: "left center"; }
.workspace.left-hidden { grid-template-columns: minmax(0, 1fr) 326px; grid-template-areas: "center right"; }
.workspace.left-hidden.sidebar-hidden { grid-template-columns: minmax(0, 1fr); grid-template-areas: "center"; }
.workspace.left-hidden .leftbar { display: none; }

/* ----- Left panel (Tim) ----- */
.leftbar {
  grid-area: left; display: flex; flex-direction: column; gap: 4px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs); padding: 14px 12px; position: sticky; top: 16px;
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px 8px; }
.panel-head-actions { display: flex; align-items: center; gap: 2px; }
.pill.dragging { opacity: 0.4; }
.cell.drag-over, .wcell.drag-over { background: hsl(var(--accent) / 0.16) !important; outline: 2px dashed hsl(var(--primary)); outline-offset: -2px; }
.panel-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: hsl(var(--muted-foreground)); }
.leftbar .legend { display: flex; flex-direction: column; gap: 3px; }
.leftbar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid hsl(var(--border)); }

.legend-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius);
  background: transparent; border: 1px solid transparent; font-size: 13.5px; font-weight: 600; cursor: pointer;
  user-select: none; color: hsl(var(--foreground)); width: 100%; text-align: left;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.legend-chip:hover { background: hsl(var(--secondary)); }
.legend-chip .swatch { width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 2px hsl(var(--card)), 0 0 0 3px hsl(var(--border)); }
.legend-chip .lc-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.legend-chip .lc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-chip .lc-pos { font-size: 11px; font-weight: 500; color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-chip.off { opacity: 0.4; }
.legend-chip.off .swatch { background: hsl(var(--muted-foreground)) !important; }

.holiday-toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 600; color: hsl(var(--muted-foreground)); user-select: none; padding: 4px 8px; }
.holiday-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.holiday-toggle .switch { width: 36px; height: 21px; border-radius: 100px; background: hsl(var(--border)); position: relative; transition: background 0.18s ease; flex: 0 0 auto; }
.holiday-toggle .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform 0.18s ease; }
.holiday-toggle input:checked + .switch { background: hsl(var(--primary)); }
.holiday-toggle input:checked + .switch::after { transform: translateX(15px); }

/* ----- Center column ----- */
.main-col { grid-area: center; display: flex; flex-direction: column; min-width: 0; }

/* ----- Right panel (Zid) ----- */
.sidebar {
  grid-area: right; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs); position: sticky; top: 16px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; overflow: hidden;
}
.workspace.sidebar-hidden .sidebar { display: none; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px 12px; border-bottom: 1px solid hsl(var(--border)); }
.sidebar-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sidebar-title .ico { font-size: 16px; }
.sidebar-body { padding: 12px 14px; overflow-y: auto; flex: 1; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid hsl(var(--border)); display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot .btn { width: 100%; justify-content: center; }
.sidebar-backdrop { position: fixed; inset: 0; background: hsl(var(--foreground) / 0.3); z-index: 94; animation: fade 0.15s ease; }
.sidebar-backdrop[hidden] { display: none; }

/* ===================== TOOLBAR ===================== */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-title { font-size: 22px; font-weight: 700; margin: 0 6px; min-width: 200px; }
.nav-btn { width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--muted-foreground)); font-size: 20px; cursor: pointer; transition: all 0.15s ease; line-height: 1; }
.nav-btn:hover { color: hsl(var(--foreground)); background: hsl(var(--secondary)); }
.today-btn { margin-left: 6px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.segmented { display: inline-flex; background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 3px; }
.seg { border: none; background: transparent; padding: 7px 13px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; color: hsl(var(--muted-foreground)); cursor: pointer; transition: all 0.15s ease; }
.seg:hover { color: hsl(var(--foreground)); }
.seg.active { background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: var(--shadow-xs); }

/* ===================== CALENDAR (fills height) ===================== */
.calendar {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column;
}
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.5); flex: 0 0 auto; }
.weekday { padding: 11px 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); }
.weekday.sun { color: hsl(var(--destructive)); }

#calGrid { overflow: visible; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(116px, auto); }
.cell { border-right: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); padding: 8px 9px 9px; cursor: pointer; position: relative; transition: background 0.13s ease; display: flex; flex-direction: column; gap: 4px; overflow: hidden; min-height: 116px; }
.cell:nth-child(7n) { border-right: none; }
.cell:hover { background: hsl(var(--secondary) / 0.6); }
.cell.outside { background: hsl(var(--muted) / 0.4); }
.cell.outside .day-num { color: hsl(var(--muted-foreground)); opacity: 0.55; }
.cell.holiday:not(.outside) { background: hsl(var(--destructive) / 0.05); }
.day-num { font-size: 14px; font-weight: 700; color: hsl(var(--foreground)); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; flex: 0 0 auto; }
.cell.sun:not(.outside) .day-num, .cell.holiday:not(.outside) .day-num { color: hsl(var(--destructive)); }
.cell.today .day-num { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.hol-name { font-size: 10.5px; font-weight: 700; color: hsl(var(--destructive)); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.hol-name::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: hsl(var(--destructive)); flex: 0 0 auto; }

.pills { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.pill { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 7px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; background: var(--owner-soft, hsl(var(--secondary))); color: hsl(var(--foreground)); cursor: pointer; line-height: 1.35; border-left: 3px solid var(--owner, hsl(var(--primary))); transition: filter 0.12s ease; }
.pill:hover { filter: brightness(0.97); }
html.dark .pill:hover { filter: brightness(1.18); }
.pill .pill-time { font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground)); font-weight: 700; }
.pill .pill-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-link { font-size: 11.5px; font-weight: 700; color: hsl(var(--muted-foreground)); padding: 2px 4px; cursor: pointer; }
.more-link:hover { color: hsl(var(--primary)); }

/* ----- Week view ----- */
.grid.week { grid-auto-rows: minmax(500px, auto); }
.wcell { border-right: 1px solid hsl(var(--border)); display: flex; flex-direction: column; cursor: pointer; transition: background 0.13s ease; min-height: 500px; }
.wcell:last-child { border-right: none; }
.wcell:hover { background: hsl(var(--secondary) / 0.6); }
.wcell.holiday { background: hsl(var(--destructive) / 0.05); }
.wcell-head { display: flex; align-items: baseline; gap: 7px; padding: 12px 12px 8px; border-bottom: 1px solid hsl(var(--border)); flex: 0 0 auto; }
.wcell-head .wd { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); }
.wcell-head .wn { font-size: 17px; font-weight: 700; color: hsl(var(--foreground)); font-family: "Inter", sans-serif; }
.wcell.sun .wcell-head .wn, .wcell.holiday .wcell-head .wn { color: hsl(var(--destructive)); }
.wcell.today .wcell-head .wn { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; }
.wcell .hol-badge { margin: 7px 10px 0; font-size: 10.5px; font-weight: 700; color: hsl(var(--destructive)); background: hsl(var(--destructive) / 0.1); border-radius: var(--radius-sm); padding: 3px 8px; line-height: 1.25; flex: 0 0 auto; }
.wcell-body { padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; flex: 1; }
.wcell-body .pill { font-size: 12.5px; padding: 5px 9px 5px 8px; }
.wempty { color: hsl(var(--muted-foreground)); font-size: 13px; text-align: center; padding: 14px 0; opacity: 0.5; }

/* ----- Day view (agenda) ----- */
.agenda { padding: 22px 26px; }
.agenda-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.agenda-date { font-size: 13px; font-weight: 700; color: hsl(var(--muted-foreground)); text-transform: capitalize; }
.agenda-day { font-size: 28px; font-weight: 700; margin-top: 2px; }
.agenda-day.red { color: hsl(var(--destructive)); }
.agenda-holiday { margin-top: 8px; font-size: 12.5px; font-weight: 700; color: hsl(var(--destructive)); background: hsl(var(--destructive) / 0.1); border-radius: var(--radius-sm); padding: 5px 10px; display: inline-block; }
.agenda-list { display: flex; flex-direction: column; gap: 10px; max-width: 680px; }
.agenda-empty { text-align: center; color: hsl(var(--muted-foreground)); padding: 60px 10px; font-size: 14px; }
.agenda-empty .big { font-size: 36px; display: block; margin-bottom: 10px; opacity: 0.5; }

/* ----- Year view ----- */
.yeargrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px; align-content: start; }
.mini { border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); padding: 12px 12px 14px; background: hsl(var(--card)); }
.mini-head { font-size: 14px; font-weight: 700; margin-bottom: 8px; cursor: pointer; font-family: "Inter", sans-serif; display: inline-block; }
.mini-head:hover { color: hsl(var(--primary)); }
.mini-week { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 3px; }
.mini-week span { font-size: 9.5px; font-weight: 700; color: hsl(var(--muted-foreground)); text-align: center; }
.mini-week span.sun { color: hsl(var(--destructive)); }
.mini-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mini-day { position: relative; height: 26px; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: hsl(var(--foreground)); border-radius: 6px; cursor: pointer; }
.mini-day:hover { background: hsl(var(--secondary)); }
.mini-day.empty { visibility: hidden; cursor: default; }
.mini-day.sun, .mini-day.hol { color: hsl(var(--destructive)); }
.mini-day.today { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.mini-day .dot { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--owner, hsl(var(--foreground))); }
.mini-day.today .dot { background: hsl(var(--primary-foreground)); }

/* ===================== OVERLAY / MODAL / DRAWER ===================== */
.overlay { position: fixed; inset: 0; background: hsl(var(--foreground) / 0.32); backdrop-filter: blur(2px); display: flex; z-index: 100; animation: fade 0.15s ease; }
.overlay[hidden] { display: none; }
.modal { margin: auto; width: min(520px, calc(100vw - 32px)); background: hsl(var(--popover)); color: hsl(var(--popover-foreground)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); max-height: calc(100vh - 48px); display: flex; flex-direction: column; animation: rise 0.18s cubic-bezier(0.2, 0.8, 0.3, 1); }
.modal-wide { width: min(640px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-body { padding: 4px 22px 22px; overflow-y: auto; }
.hint, .field-label .opt { color: hsl(var(--muted-foreground)); }
.hint { font-size: 13px; margin: 0 0 14px; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field-label { font-size: 13px; font-weight: 700; color: hsl(var(--muted-foreground)); }
.field-label .opt { font-weight: 500; font-size: 12px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
input[type="text"], input[type="tel"], input[type="email"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid hsl(var(--input)); border-radius: var(--radius); font-size: 14.5px;
  font-family: inherit; color: hsl(var(--foreground)); background: hsl(var(--background)); transition: border-color 0.15s ease, box-shadow 0.15s ease; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.3); }
textarea { resize: vertical; min-height: 44px; }
.type-picker { display: flex; gap: 8px; }
.type-opt { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border: 1px solid hsl(var(--input)); border-radius: var(--radius); cursor: pointer; font-size: 13.5px; font-weight: 600; color: hsl(var(--muted-foreground)); background: hsl(var(--card)); transition: all 0.14s ease; user-select: none; }
.type-opt:hover { border-color: hsl(var(--ring)); color: hsl(var(--foreground)); }
.type-opt.active { border-color: hsl(var(--ring)); background: hsl(var(--accent) / 0.16); color: hsl(var(--foreground)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.22); }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.modal-actions .spacer { flex: 1; }

.drawer { margin-left: auto; width: min(420px, calc(100vw - 24px)); height: 100%; background: hsl(var(--card)); color: hsl(var(--card-foreground)); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide 0.22s cubic-bezier(0.2, 0.8, 0.3, 1); }
.drawer-head { padding: 22px 22px 16px; border-bottom: 1px solid hsl(var(--border)); display: flex; align-items: flex-start; justify-content: space-between; }
.drawer-date { font-size: 13px; font-weight: 700; color: hsl(var(--muted-foreground)); text-transform: capitalize; }
.drawer-day { font-size: 24px; font-weight: 700; margin-top: 2px; }
.drawer-holiday { margin-top: 8px; font-size: 12.5px; font-weight: 700; color: hsl(var(--destructive)); background: hsl(var(--destructive) / 0.1); border-radius: var(--radius-sm); padding: 5px 10px; display: inline-block; }
.drawer-body { padding: 16px 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 22px 22px; border-top: 1px solid hsl(var(--border)); }
.drawer-foot .btn { width: 100%; justify-content: center; }

.event-row { display: flex; gap: 12px; padding: 13px; border-radius: var(--radius); border: 1px solid hsl(var(--border)); cursor: pointer; transition: background 0.14s ease; }
.event-row:hover { background: hsl(var(--secondary) / 0.6); }
.event-row .bar { width: 4px; border-radius: 4px; flex: 0 0 auto; background: var(--owner); }
.event-row .er-main { flex: 1; min-width: 0; }
.event-row .er-title { font-weight: 700; font-size: 14.5px; }
.event-row .er-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: 12.5px; color: hsl(var(--muted-foreground)); flex-wrap: wrap; }
.event-row .er-note { font-size: 13px; color: hsl(var(--muted-foreground)); margin-top: 6px; line-height: 1.45; }
.drawer-body .event-row { margin-bottom: 10px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 100px; background: hsl(var(--badge-neutral)); color: hsl(var(--muted-foreground)); }
.tag.owner { color: #fff; }
.tag.rok { background: hsl(var(--warning) / 0.2); color: hsl(var(--foreground)); }

/* ----- Status Završeno + ponavljanje ----- */
.check-field { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; color: hsl(var(--foreground)); cursor: pointer; margin-bottom: 14px; }
.check-field input[type="checkbox"] { width: 18px; height: 18px; accent-color: hsl(var(--success)); cursor: pointer; }
.event-row.done { opacity: 0.65; }
.event-row.done .er-title { text-decoration: line-through; color: hsl(var(--muted-foreground)); }
.er-check { flex: 0 0 auto; align-self: center; border: none; background: transparent; color: hsl(var(--muted-foreground)); width: 32px; height: 32px; border-radius: var(--radius-sm); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.er-check:hover { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.er-check.on { color: hsl(var(--success)); }
.er-check .ic { width: 19px; height: 19px; }
.pill.done { opacity: 0.6; }
.pill.done .pill-title { text-decoration: line-through; }
.pill-check { color: hsl(var(--success)); display: inline-flex; flex: 0 0 auto; }
.pill-check .ic { width: 13px; height: 13px; }
.pill-rep { margin-left: auto; opacity: 0.5; display: inline-flex; flex: 0 0 auto; }
.pill-rep .ic { width: 12px; height: 12px; }
.empty-day { text-align: center; color: hsl(var(--muted-foreground)); padding: 36px 10px; font-size: 14px; opacity: 0.85; }
.empty-day .big { font-size: 30px; display: block; margin-bottom: 8px; opacity: 0.6; }

/* ----- Wall messages (tint by colleague color) ----- */
.msg { display: flex; gap: 11px; padding: 12px; border: 1px solid var(--owner-border, hsl(var(--border))); border-radius: var(--radius); margin-bottom: 10px; background: var(--owner-soft, hsl(var(--card))); }
.msg:last-child { margin-bottom: 0; }
.msg-main { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-author { font-weight: 700; font-size: 13.5px; }
.msg-time { font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.msg-text { font-size: 13.5px; margin-top: 3px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.msg-del { flex: 0 0 auto; align-self: flex-start; }
.msg-del:hover { color: hsl(var(--destructive)); }
.msg-actions { margin-top: 7px; }
.like-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--muted-foreground)); padding: 3px 9px; border-radius: 100px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.14s ease; }
.like-btn:hover { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.like-btn.on { color: hsl(var(--primary)); border-color: hsl(var(--primary) / 0.5); background: hsl(var(--accent) / 0.12); }
.like-btn .ic { width: 14px; height: 14px; }
.mention { color: hsl(var(--primary)); font-weight: 700; }
.msg.mentioned { box-shadow: inset 3px 0 0 hsl(var(--primary)); }
.msg.director { border-color: hsl(var(--accent) / 0.5); background: hsl(var(--accent) / 0.08); }
.msg-author .crown { display: inline-flex; vertical-align: -2px; }
.msg-author .crown .ic { width: 13px; height: 13px; color: hsl(var(--primary)); }
.dir-toggle { color: hsl(var(--muted-foreground)); }
.dir-toggle.on { color: hsl(var(--primary)); background: hsl(var(--accent) / 0.15); }

/* ===================== TRAKA DIREKTORA ===================== */
.director-banner { background: hsl(var(--accent) / 0.12); border: 1px solid hsl(var(--accent) / 0.4); border-radius: var(--radius-lg); padding: 10px 14px; margin-bottom: 12px; cursor: pointer; }
.director-banner[hidden] { display: none; }
.db-head { font-size: 12px; font-weight: 700; color: hsl(var(--foreground)); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.db-head .ic { color: hsl(var(--primary)); width: 15px; height: 15px; }
.db-messages { display: flex; flex-direction: column; gap: 4px; }
.db-msg { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; }
.db-text { color: hsl(var(--foreground)); }
.db-time { font-size: 11px; color: hsl(var(--muted-foreground)); flex: 0 0 auto; white-space: nowrap; }

/* ----- Team manager ----- */
.people-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.person-card { border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 12px; }
.pc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pc-top input.pc-name { border: none; padding: 2px 0; font-weight: 700; font-size: 15px; background: transparent; flex: 1; }
.pc-top input.pc-name:focus { box-shadow: none; }
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-grid .pc-full { grid-column: 1 / -1; }
.pc-grid input { padding: 8px 11px; font-size: 13.5px; }
.pc-field-label { font-size: 11px; font-weight: 700; color: hsl(var(--muted-foreground)); margin: 0 0 3px 2px; display: block; }
.color-swatch { width: 30px; height: 30px; border-radius: var(--radius-sm); flex: 0 0 auto; cursor: pointer; position: relative; box-shadow: 0 0 0 1px hsl(var(--border)); overflow: hidden; }
.color-swatch input[type="color"] { position: absolute; inset: -4px; width: 140%; height: 140%; border: none; padding: 0; cursor: pointer; opacity: 0; }
.del-person { color: hsl(var(--muted-foreground)); }
.del-person:hover { color: hsl(var(--destructive)); }
.add-person { width: 100%; justify-content: center; }
.manage-tools { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid hsl(var(--border)); flex-wrap: wrap; }
.manage-tools .btn { flex: 1; justify-content: center; min-width: 150px; }
.pin-setting { margin-top: 14px; padding-top: 14px; border-top: 1px solid hsl(var(--border)); }
.pin-row { display: flex; gap: 8px; margin-top: 6px; }
.pin-row input { flex: 1; }
.pin-input { width: 100%; text-align: center; font-size: 22px; letter-spacing: 6px; padding: 12px; }
.pin-err { color: hsl(var(--destructive)); font-size: 13px; text-align: center; margin-top: 8px; font-weight: 600; }

/* ===================== ISPIS (print) ===================== */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  .topbar, .leftbar, .sidebar, .sidebar-backdrop, .app-footer, .overlay, .toast-wrap,
  .toolbar-right, .nav-btn, .today-btn, .legend-row, .search-overlay, .gate { display: none !important; }
  html, body { background: #fff !important; }
  .app-shell { padding: 0 !important; max-width: none !important; min-height: 0 !important; display: block !important; }
  .workspace { display: block !important; }
  .main-col { display: block !important; }
  .toolbar { display: block !important; margin: 0 0 6px !important; }
  .month-nav { display: block !important; }
  .month-title { color: #000 !important; font-size: 18px !important; margin: 0 0 6px !important; min-width: 0 !important; }
  .calendar { box-shadow: none !important; border: 1px solid #000 !important; border-radius: 0 !important; }
  #calGrid { overflow: visible !important; }
  .grid { grid-auto-rows: minmax(68px, 1fr) !important; height: auto !important; }
  .weekdays { background: #fff !important; }
  .weekday { color: #000 !important; padding: 4px 6px !important; }
  .cell { min-height: 68px !important; border-color: #999 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cell.outside { background: #fff !important; }
  .cell.today .day-num { background: #fff !important; color: #000 !important; box-shadow: inset 0 0 0 1.5px #000 !important; }
  .day-num, .pill-time { color: #000 !important; }
  .hol-name { color: #000 !important; }
  .pill { background: #fff !important; color: #000 !important; border: 1px solid #ccc !important; border-left: 3px solid var(--owner, #000) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===================== FOOTER ===================== */
.app-footer { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; color: hsl(var(--muted-foreground)); font-size: 12px; margin-top: 14px; font-weight: 500; }
.app-footer .credit { opacity: 0.85; }
.app-footer .credit strong { color: hsl(var(--foreground)); font-weight: 700; }
.sync-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.sync-status .dot { width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--muted-foreground)); flex: 0 0 auto; }
.sync-status.ok { color: hsl(var(--success)); }
.sync-status.ok .dot { background: hsl(var(--success)); }

/* ===================== EKRAN PRIJAVE (Tko si ti) ===================== */
.gate {
  position: fixed; inset: 0; z-index: 200; padding: 24px;
  background: hsl(var(--background) / 0.7);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  display: flex; align-items: center; justify-content: center; animation: fade 0.2s ease;
}
.gate[hidden] { display: none; }
.gate-card {
  width: min(560px, 100%); background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 28px 26px; max-height: calc(100vh - 48px); overflow-y: auto;
}
.gate-logo { height: 28px; display: block; margin: 0 auto 12px; }
.gate-title { font-family: "Inter", sans-serif; font-size: 22px; font-weight: 700; text-align: center; margin: 0 0 2px; }
.gate-sub { text-align: center; color: hsl(var(--muted-foreground)); font-size: 13.5px; margin: 0 0 20px; }
.gate-people { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gate-person {
  display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid hsl(var(--border));
  border-radius: var(--radius); cursor: pointer; background: hsl(var(--card)); text-align: left; transition: all 0.14s ease; font: inherit; color: inherit;
}
.gate-person:hover { border-color: hsl(var(--ring)); background: hsl(var(--secondary) / 0.6); box-shadow: var(--shadow-sm); }
.gate-person .gp-main { min-width: 0; }
.gate-person .gp-name { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gate-person .gp-pos { font-size: 12px; color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gate-add { margin-top: 14px; }
.gate-add .btn { width: 100%; justify-content: center; }
.gate-empty { text-align: center; color: hsl(var(--muted-foreground)); font-size: 13.5px; padding: 6px 0 14px; }
.gate-form { display: flex; flex-direction: column; gap: 12px; }
.gate-form .field { margin: 0; }
.gate-back { background: none; border: none; color: hsl(var(--muted-foreground)); cursor: pointer; font-size: 13px; font-weight: 600; padding: 4px 0; display: inline-flex; align-items: center; gap: 5px; }
.gate-back:hover { color: hsl(var(--foreground)); }
.gate-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.gate-color { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid hsl(var(--card)); box-shadow: 0 0 0 1px hsl(var(--border)); }
.gate-color.sel { box-shadow: 0 0 0 2px hsl(var(--foreground)); }

/* ===================== BOCNI (poke) ===================== */
.legend-item { display: flex; align-items: center; gap: 2px; }
.legend-item .legend-chip { flex: 1; min-width: 0; }
.poke-btn {
  flex: 0 0 auto; border: none; background: transparent; color: hsl(var(--muted-foreground));
  width: 30px; height: 30px; border-radius: var(--radius-sm); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; opacity: 0.5; transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.legend-item:hover .poke-btn, .poke-btn:focus-visible { opacity: 1; }
.poke-btn:hover { background: hsl(var(--accent) / 0.18); color: hsl(var(--foreground)); }
.poke-btn .ic { width: 16px; height: 16px; }

/* ===================== TOAST ===================== */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-radius: var(--radius-lg);
  background: hsl(var(--foreground)); color: hsl(var(--background)); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: toastIn 0.25s cubic-bezier(0.2, 0.8, 0.3, 1); pointer-events: auto; max-width: 92vw;
}
.toast .ic { width: 18px; height: 18px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ===================== PRETRAGA ===================== */
.search-overlay { align-items: flex-start; }
.search-box { margin: 10vh auto 0; width: min(560px, calc(100vw - 32px)); background: hsl(var(--popover)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: rise 0.18s cubic-bezier(0.2, 0.8, 0.3, 1); }
.search-input-wrap { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid hsl(var(--border)); }
.search-input-wrap .ico { color: hsl(var(--muted-foreground)); }
.search-input-wrap .ic { width: 18px; height: 18px; }
.search-input-wrap input { flex: 1; border: none; background: transparent; font-size: 15.5px; padding: 4px 0; color: hsl(var(--foreground)); }
.search-input-wrap input:focus { box-shadow: none; outline: none; }
.search-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.search-empty { padding: 22px 12px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13.5px; }
.search-item { display: flex; align-items: stretch; gap: 11px; width: 100%; text-align: left; padding: 10px 11px; border: none; background: transparent; border-radius: var(--radius); cursor: pointer; font: inherit; }
.search-item:hover { background: hsl(var(--secondary)); }
.search-item .si-bar { width: 3px; border-radius: 3px; flex: 0 0 auto; }
.search-item .si-main { display: flex; flex-direction: column; min-width: 0; }
.search-item .si-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item .si-title.done { text-decoration: line-through; color: hsl(var(--muted-foreground)); }
.search-item .si-meta { font-size: 12px; color: hsl(var(--muted-foreground)); }

/* ===================== ANIMATIONS ===================== */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes slide { from { transform: translateX(100%); } to { transform: none; } }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1280px) {
  .workspace { grid-template-columns: 200px minmax(0, 1fr) 300px; }
  .workspace.sidebar-hidden { grid-template-columns: 200px minmax(0, 1fr); }
  .workspace.left-hidden { grid-template-columns: minmax(0, 1fr) 300px; }
  .workspace.left-hidden.sidebar-hidden { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1120px) {
  .topbar-feed { display: none; }
}

@media (max-width: 1023px) {
  .workspace { display: flex; flex-direction: column; }
  .leftbar { position: static; max-height: none; overflow: visible; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
  .leftbar .panel-title { display: none; }
  .leftbar .legend { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .legend-chip { width: auto; padding: 6px 12px; border: 1px solid hsl(var(--border)); border-radius: 100px; }
  .legend-chip .lc-pos { display: none; }
  .leftbar-foot { margin: 0 0 0 auto; padding: 0; border: none; }
  .sidebar { position: fixed; top: 0; right: 0; height: 100dvh; width: min(360px, 90vw); max-height: none; border-radius: 0; z-index: 95; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform 0.22s ease; }
  .workspace:not(.sidebar-hidden) .sidebar { transform: none; }
  .calendar { min-height: 70vh; }
  .yeargrid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .app-shell { padding: 12px 12px 22px; }
  .brand-tag { display: none; }
  .btn-text { display: none; }
  .topbar-right { gap: 6px; }
  .toolbar { gap: 10px; }
  .month-title { font-size: 18px; min-width: 0; }
  .toolbar-right { width: 100%; }
  .segmented { flex: 1; }
  .seg { flex: 1; padding: 7px 6px; }
  .grid { grid-auto-rows: minmax(58px, auto); }
  .cell { min-height: 58px; padding: 5px; gap: 3px; }
  .day-num { width: 24px; height: 24px; font-size: 12.5px; }
  .hol-name { display: none; }
  .pills { flex-direction: row; flex-wrap: wrap; gap: 3px; align-content: flex-start; }
  .pill { width: 8px; height: 8px; min-width: 8px; padding: 0; border-radius: 50%; border-left: none; background: var(--owner) !important; }
  .pill .pill-time, .pill .pill-title { display: none; }
  .more-link { display: none; }
  .weekday { padding: 9px 4px; font-size: 10px; letter-spacing: 0; }
  .user-chip .name { display: none; }
  .yeargrid { grid-template-columns: repeat(2, 1fr); padding: 12px; gap: 12px; }
  .grid.week { display: flex; flex-direction: column; height: auto; }
  .grid.week .wcell { min-height: 200px; border-right: none; border-bottom: 1px solid hsl(var(--border)); }
}
