@font-face {
  font-family: "Figtree";
  src: url("./fonts/figtree-latin.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 300 900;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Figtree";
  src: url("./fonts/figtree-latin-ext.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 300 900;
}

:root { --brand-purple: #5b5ceb; }

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --background: #f3f2ef;
  --foreground: #2a2927;
  --card: #faf9f7;
  --card-foreground: #2a2927;
  --popover: #fbfaf8;
  --popover-foreground: #2a2927;
  --primary: var(--brand-purple);
  --primary-foreground: #fff;
  --secondary: #ebe9e5;
  --secondary-foreground: #2a2927;
  --muted: #ebe9e5;
  --muted-foreground: #77736d;
  --accent: rgba(42, 41, 39, 0.055);
  --accent-foreground: #2a2927;
  --destructive: #dc2626;
  --destructive-foreground: #fff;
  --border: rgba(42, 41, 39, 0.12);
  --input: rgba(42, 41, 39, 0.15);
  --ring: color-mix(in srgb, var(--foreground) 42%, transparent);
  --sidebar: #f8f7f4;
  --sidebar-foreground: #2a2927;
  --sidebar-accent: rgba(42, 41, 39, 0.055);
  --sidebar-border: rgba(42, 41, 39, 0.1);
  --radius: 0.5rem;
  --radius-sm: 0.3rem;
  --radius-md: 0.4rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.7rem;
  --shadow-xs: 0 1px 2px rgba(42, 41, 39, 0.04);
  --font-sans: "Figtree", Arial, sans-serif;
}

:root[data-theme="magic"] {
  color-scheme: dark;
  --background: #14151d; --foreground: #eeeff5; --card: #1d1f27; --card-foreground: #eeeff5;
  --popover: #16171f; --popover-foreground: #eeeff5; --primary: var(--brand-purple); --primary-foreground: #fff;
  --secondary: #272936; --secondary-foreground: #eeeff5; --muted: #252731; --muted-foreground: #858b9b;
  --accent: rgba(238, 239, 245, 0.075); --accent-foreground: #f5f6ff; --destructive: #f87171;
  --destructive-foreground: #16171f; --border: rgba(224, 229, 255, 0.12); --input: rgba(224, 229, 255, 0.14);
  --ring: color-mix(in srgb, var(--foreground) 42%, transparent); --sidebar: #14151d; --sidebar-foreground: #eeeff5; --sidebar-accent: rgba(238, 239, 245, 0.075); --sidebar-border: rgba(224, 229, 255, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #0b0b0c; --foreground: #e6e6e9; --card: #111113; --card-foreground: #e6e6e9;
  --popover: #0d0d0e; --popover-foreground: #e6e6e9; --primary: var(--brand-purple); --primary-foreground: #fff;
  --secondary: #18181b; --secondary-foreground: #e6e6e9; --muted: #18181b; --muted-foreground: #8b8d94;
  --accent: rgba(255, 255, 255, 0.07); --accent-foreground: #f3f3f8; --destructive: #f87171;
  --destructive-foreground: #0d0d0e; --border: rgba(255, 255, 255, 0.085); --input: rgba(255, 255, 255, 0.11);
  --ring: color-mix(in srgb, var(--foreground) 42%, transparent); --sidebar: #050506; --sidebar-foreground: #e6e6e9; --sidebar-accent: rgba(255, 255, 255, 0.07); --sidebar-border: rgba(255, 255, 255, 0.085);
}

:root[data-theme="classic"] {
  color-scheme: dark;
  --background: #202124; --foreground: #e5e5e8; --card: #25262a; --card-foreground: #e5e5e8;
  --popover: #1e1f22; --popover-foreground: #e5e5e8; --primary: var(--brand-purple); --primary-foreground: #fff;
  --secondary: #2c2d31; --secondary-foreground: #e5e5e8; --muted: #2a2b2f; --muted-foreground: #96989f;
  --accent: rgba(255, 255, 255, 0.075); --accent-foreground: #f4f4f6; --destructive: #f87171;
  --destructive-foreground: #1e1f22; --border: rgba(255, 255, 255, 0.1); --input: rgba(255, 255, 255, 0.12);
  --ring: color-mix(in srgb, var(--foreground) 42%, transparent); --sidebar: #1a1b1d; --sidebar-foreground: #e5e5e8; --sidebar-accent: rgba(255, 255, 255, 0.075); --sidebar-border: rgba(255, 255, 255, 0.1);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; font-family: var(--font-sans); background: var(--background); }
body { min-height: 100vh; min-height: 100svh; margin: 0; overflow: hidden; background: var(--background); color: var(--foreground); -webkit-font-smoothing: antialiased; transition: background-color 180ms ease, color 180ms ease; }
button, input, select { font: inherit; }
button:not(:disabled), [role="button"]:not(:disabled) { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
::selection { background: color-mix(in oklch, var(--primary) 25%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted-foreground); }
.icon { display: inline-flex; width: 1rem; height: 1rem; flex: 0 0 auto; align-items: center; justify-content: center; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }

.astro-shell { --sidebar-width: 16rem; --sidebar-collapsed-width: 3.5rem; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); width: 100%; height: 100vh; height: 100svh; transition: grid-template-columns 180ms ease; }
.astro-shell.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr); }
.sidebar { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--sidebar-border); background: var(--sidebar); color: var(--sidebar-foreground); }
.brand-block { flex: 0 0 auto; min-height: 86px; padding: 0.875rem 0.75rem; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.brand-button { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: var(--radius-md); color: inherit; background: transparent; }
.brand-button img { display: block; width: 9rem; height: 2.25rem; object-fit: contain; transition: width 180ms ease; }
.brand-block p { width: 100%; margin: 0.5rem 0 0; overflow: hidden; color: var(--muted-foreground); font-size: 11px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-collapsed .brand-block { min-height: calc(4rem - 1px); height: calc(4rem - 1px); padding: 0; }
.sidebar-collapsed .brand-button img { width: 2rem; height: 2rem; object-fit: contain; }
.sidebar-collapsed .brand-block p, .sidebar-collapsed .sidebar-label, .sidebar-collapsed .nav-badge { display: none; }
.sidebar-separator { width: 100%; height: 1px; background: var(--sidebar-border); }
.sidebar-group-label { flex: 0 0 auto; height: 2.5rem; display: flex; align-items: flex-end; padding: 0 1.125rem 0.5rem; overflow: hidden; color: var(--muted-foreground); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
.sidebar-nav { flex: 1 1 auto; display: flex; flex-direction: column; gap: 0.125rem; overflow-x: hidden; overflow-y: auto; padding: 0 0.75rem 0.5rem; scrollbar-width: thin; }
.sidebar-footer { position: relative; flex: 0 0 auto; padding: 0.75rem; }
.sidebar-link { width: 100%; min-height: 2.25rem; display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 0.625rem; overflow: hidden; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--sidebar-foreground); font-size: 0.875rem; text-align: left; white-space: nowrap; }
.sidebar-link:hover { background: var(--sidebar-accent); }
.sidebar-link.active { background: var(--sidebar-accent); font-weight: 500; }
.sidebar-link .icon { width: 1rem; height: 1rem; }
.sidebar-collapsed .sidebar-nav { gap: 0; padding: 0.5rem; }
.sidebar-collapsed .sidebar-link { width: 2.5rem; height: 2.5rem; min-height: 2.5rem; justify-content: center; margin-inline: auto; padding: 0; }
.sidebar-collapsed .sidebar-link .icon { margin: 0; }
.sidebar-collapsed .sidebar-group-label { display: none; }
.nav-badge { min-width: 1.25rem; margin-left: auto; padding-inline: 0.375rem; justify-content: center; }
.account-trigger { width: 100%; min-width: 0; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) 1rem; align-items: center; gap: 0.625rem; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--sidebar-foreground); text-align: left; }
.account-trigger:hover { background: var(--sidebar-accent); }
.account-avatar { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border: 1px solid var(--sidebar-border); border-radius: var(--radius-md); background: var(--muted); font-size: 0.8125rem; }
.account-copy { min-width: 0; display: grid; line-height: 1.2; }
.account-copy strong { overflow: hidden; font-size: 0.875rem; font-weight: 500; text-overflow: ellipsis; }
.account-copy small { overflow: hidden; margin-top: 0.125rem; color: var(--muted-foreground); font-size: 0.75rem; text-overflow: ellipsis; }
.account-chevron { width: 0.875rem; height: 0.875rem; }
.account-menu { --dropdown-width: 15rem; }
.sidebar-collapsed .sidebar-footer { padding: 0.5rem; }
.sidebar-collapsed .account-trigger { width: 2.5rem; height: 2.5rem; display: flex; justify-content: center; margin-inline: auto; }
.app-content { min-width: 0; display: flex; flex-direction: column; }
.topbar { z-index: 30; flex: 0 0 4rem; height: 4rem; display: flex; align-items: center; gap: 0.75rem; padding: 0 1.5rem; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--background) 95%, transparent); backdrop-filter: blur(16px); }
.topbar-icon { flex: 0 0 auto; }
.topbar-divider { width: 1px; height: 0.75rem; background: var(--border); }
.breadcrumb { min-width: 0; flex: 1; overflow: hidden; margin: 0; color: var(--muted-foreground); font-size: 0.875rem; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb strong { color: var(--foreground); font-weight: 400; }
.notification-trigger { position: relative; }
.notification-dot { position: absolute; right: 0.375rem; top: 0.375rem; width: 0.5rem; height: 0.5rem; border: 2px solid var(--background); border-radius: 999px; background: var(--primary); }
.notification-menu { --dropdown-width: 20rem; }
.notification-item { align-items: flex-start; gap: 0.75rem; padding: 0.75rem; line-height: 1.25rem; color: var(--muted-foreground); white-space: normal; }
.notification-item strong { color: var(--foreground); font-weight: 500; }
.notification-icon { margin-top: 0.125rem; color: var(--primary); }
.theme-menu { --dropdown-width: 12rem; }
.theme-swatch { width: 0.75rem; height: 0.75rem; border: 1px solid color-mix(in srgb, var(--foreground) 15%, transparent); border-radius: 999px; }
.swatch-light { background: #f6f7fb; } .swatch-magic { background: var(--brand-purple); } .swatch-dark { background: #0b0b0c; } .swatch-classic { background: #202124; }
.dropdown-content {
  --dropdown-width: 12rem;
  --dropdown-item-min-height: 2rem;
  --dropdown-item-gap: 0.5rem;
  width: var(--dropdown-width);
  max-width: calc(100vw - 1rem);
  max-height: calc(100svh - 1rem);
  overflow-y: auto;
}
.dropdown-item,
.employee-option {
  font-size: 0.8125rem;
  line-height: 1.25;
}
.dropdown-item {
  min-height: var(--dropdown-item-min-height);
  gap: var(--dropdown-item-gap);
  padding: 0.375rem 0.5rem;
}
.dropdown-item > .icon { width: 1rem; height: 1rem; }
.dropdown-item:focus-visible,
.employee-option:focus-visible { outline: 0; background: var(--accent); color: var(--accent-foreground); box-shadow: none; }
.dropdown-label { padding: 0.375rem 0.5rem; font-size: 0.75rem; line-height: 1.2; }
.dropdown-separator { margin-block: 0.25rem; }

.main-content { min-height: 0; flex: 1 1 auto; height: calc(100svh - 4rem); overflow: hidden; padding: 2rem 5rem 2rem 4rem; }
.positive-events { width: 100%; max-width: 1440px; height: 100%; min-height: 0; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.toolbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.toolbar-left { min-width: 0; flex: 1 1 auto; display: flex; align-items: center; justify-content: flex-start; gap: 0.5rem; }
.toolbar-actions { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; }
.search-control { position: relative; width: min(32rem, 100%); min-width: 12rem; flex: 0 1 32rem; }
.search-control .input { width: 100%; height: 2rem; padding-left: 2rem; padding-right: 2rem; }
.input:not(:read-only), .select, .date-input-button { background-color: transparent; }
.search-control .input { background-color: var(--background); }
.input:focus:not([aria-invalid="true"]):not(:user-invalid),
.input:focus-visible:not([aria-invalid="true"]):not(:user-invalid),
.select:focus:not([aria-invalid="true"]):not(:user-invalid),
.select:focus-visible:not([aria-invalid="true"]):not(:user-invalid) {
  border-color: color-mix(in srgb, var(--foreground) 42%, transparent);
  outline: 0;
  box-shadow: var(--shadow-xs);
}
.date-input-button:focus,
.date-input-button:focus-visible {
  border-color: color-mix(in srgb, var(--foreground) 42%, transparent);
  outline: 0;
  box-shadow: none;
}
.input:is([aria-invalid="true"], :user-invalid):focus,
.input:is([aria-invalid="true"], :user-invalid):focus-visible,
.select:is([aria-invalid="true"], :user-invalid):focus,
.select:is([aria-invalid="true"], :user-invalid):focus-visible {
  border-color: var(--destructive);
  outline: 0;
  box-shadow: var(--shadow-xs);
}
.search-icon { position: absolute; z-index: 1; left: 0.625rem; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.search-clear { position: absolute; right: 0.375rem; top: 50%; transform: translateY(-50%); }
.main-content .btn, .event-dialog .btn { height: 2rem; padding-inline: 0.75rem; font-size: 0.8125rem; }
.main-content .btn[data-size^="icon"], .event-dialog .btn[data-size^="icon"] { width: 2rem; padding: 0; }
.main-content .input, .event-dialog .input, .event-dialog .select, .date-input-button { height: 2.25rem; font-size: 0.8125rem; }
.main-content .search-control .input { height: 2rem; }
.filter-control { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 0.5rem; }
.reset-filter { position: static; flex: 0 0 auto; }
.filter-panel { width: 15rem; margin: 0; padding: 0.375rem; overflow: visible; border: 1px solid var(--border); border-radius: 0.75rem; background: var(--popover); color: var(--popover-foreground); box-shadow: 0 12px 32px rgba(0,0,0,0.16); position: fixed; inset: auto; opacity: 0; transform: translateY(-0.2rem) scale(0.985); transition: opacity 140ms ease, transform 140ms ease, display 140ms allow-discrete; }
.filter-panel:popover-open { opacity: 1; transform: none; }
.filter-menu { display: grid; gap: 0.125rem; }
.filter-menu-item { width: 100%; min-height: 2.5rem; display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) 1rem; align-items: center; gap: 0.75rem; padding: 0.5rem 0.625rem; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; font-size: 0.875rem; text-align: left; }
.filter-menu-item:hover, .filter-menu-item.active { background: var(--accent); }
.filter-menu-item > .icon:first-child { width: 1.125rem; height: 1.125rem; color: var(--muted-foreground); }
.filter-menu-item.active > .icon:first-child { color: var(--foreground); }
.filter-arrow { width: 0.875rem; height: 0.875rem; }
.filter-menu-separator { height: 1px; margin: 0.25rem -0.375rem; background: var(--border); }
.filter-submenu { position: absolute; top: 0; left: calc(100% + 0.5rem); width: 20rem; max-height: min(34rem, calc(100svh - 1rem)); display: none; overflow-y: auto; padding: 0.75rem; border: 1px solid var(--border); border-radius: 0.75rem; background: var(--popover); box-shadow: 0 12px 32px rgba(0,0,0,0.16); }
.filter-panel[data-submenu-side="left"] .filter-submenu { right: calc(100% + 0.5rem); left: auto; }
.filter-submenu.open { display: block; }
.filter-submenu-title { margin: 0 0 0.625rem; color: var(--muted-foreground); font-size: 0.8125rem; font-weight: 500; }
.filter-mobile-back { display: none; }
.filter-choice-list { display: grid; gap: 0.125rem; }
.filter-choice { min-height: 2.5rem; display: grid; align-items: center; gap: 0.625rem; padding: 0.4rem 0.5rem; border-radius: var(--radius-md); font-size: 0.875rem; }
.filter-choice:hover { background: var(--accent); }
.filter-choice-check { grid-template-columns: minmax(0, 1fr) 1rem; }
.filter-choice-check input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; opacity: 0; pointer-events: none; }
.filter-choice-check > .icon { width: 1rem; height: 1rem; color: var(--foreground); opacity: 0; }
.filter-choice-check input:checked ~ .icon { opacity: 1; }
.filter-choice-radio { grid-template-columns: 1rem minmax(0, 1fr); }
.filter-choice-radio input { width: 1rem; height: 1rem; margin: 0; appearance: none; border: 1.5px solid color-mix(in srgb, var(--foreground) 55%, transparent); border-radius: 999px; background: transparent; }
.filter-choice-radio input:checked { border-color: var(--primary); box-shadow: inset 0 0 0 0.25rem var(--popover); background: var(--primary); }
.filter-choice:focus-within { background: var(--accent); outline: 2px solid var(--ring); outline-offset: -2px; }
.field { display: block; min-width: 0; }
.field .input, .field .select { width: 100%; }
.field > span { display: block; margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 500; }

.table-viewport { min-height: 0; flex: 1 1 auto; }
.dashboard-card { border-radius: 0.875rem !important; background: var(--card); box-shadow: var(--shadow-xs); }
.table-card { height: 100%; min-height: 0; overflow: hidden; padding: 0; }
.table-scroll { width: 100%; height: 100%; overflow: auto; scrollbar-width: none; }
.table-scroll::-webkit-scrollbar { display: none; }
.events-table { min-width: 900px; border-collapse: collapse; }
.events-table thead { position: sticky; z-index: 2; top: 0; background: var(--card); }
.events-table th { height: 3.5rem; padding: 0 1rem; color: var(--muted-foreground); font-size: 0.875rem; font-weight: 500; text-align: left; }
.events-table td { height: var(--event-row-height, 3.8125rem); padding: 0.8rem 1rem; border-top: 1px solid var(--border); font-size: 0.875rem; }
.events-table tbody tr { transition: background 120ms ease; }
.events-table tbody tr:hover, .events-table tbody tr[data-selected="true"] { background: var(--accent); }
.events-table tbody tr[data-event-row] { cursor: pointer; }
.selection-cell { width: 3.5rem; padding-left: 1.25rem !important; padding-right: 0.5rem !important; }
.employee-column { min-width: 280px; } .type-column { min-width: 220px; }
.amount-column { text-align: right !important; }
.row-actions { width: 4rem; text-align: right !important; }
.sort-button { display: inline-flex; align-items: center; gap: 0.5rem; margin-left: -0.5rem; padding: 0.375rem 0.5rem; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; font-weight: 500; }
.sort-button:hover { background: var(--accent); color: var(--foreground); }
.sort-button .icon { width: 0.875rem; height: 0.875rem; }
.sort-button.active .icon { color: var(--primary); }
.amount-column .sort-button { float: right; margin-left: 0; margin-right: -0.5rem; }
.employee-cell { display: flex; align-items: center; gap: 0.75rem; font-weight: 500; }
.avatar { width: 1.75rem; height: 1.75rem; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--avatar-color) 20%, transparent); border-radius: var(--radius-md); background: color-mix(in srgb, var(--avatar-color) 10%, transparent); color: var(--avatar-color); font-size: 0.75rem; font-weight: 500; }
.text-muted { color: var(--muted-foreground); }
.tabular { font-variant-numeric: tabular-nums; }
.date-value { font-weight: 500; }
.amount-cell { text-align: right; font-weight: 500; }
.status-badge { height: 1.5rem; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0 0.625rem !important; border: 1px solid; border-radius: 999px !important; font-size: 0.75rem; font-weight: 500; line-height: 1; }
.status-badge::before { content: ""; width: 0.375rem; height: 0.375rem; flex: 0 0 auto; border-radius: 999px; background: currentColor; }
.status-included { border-color: #a9e7d1; background: #e9f8f2; color: #008764; }
.status-excluded { border-color: #d4d4d8; background: #f4f4f5; color: #3f3f46; }
:root:not([data-theme="light"]) .status-included { border-color: rgba(52,211,153,.35); background: rgba(16,185,129,.12); color: #6ee7b7; }
:root:not([data-theme="light"]) .status-excluded { border-color: rgba(161,161,170,.28); background: rgba(113,113,122,.13); color: #d4d4d8; }
.row-menu { --dropdown-width: 12rem; }
.empty-state { height: 16rem !important; text-align: center; color: var(--muted-foreground); }
.empty-state-inner { max-width: 22rem; margin: auto; }
.empty-icon { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--muted) 40%, transparent); }
.empty-state h3 { margin: 1rem 0 0; color: var(--foreground); font-size: 0.9375rem; }
.empty-state p { margin: 0.25rem 0 1rem; font-size: 0.875rem; }

.table-footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; padding: 1rem 1.25rem; }
.footer-summary, .footer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; font-size: 0.875rem; }
.table-footer strong { font-weight: 400; }
.footer-actions { justify-content: flex-end; gap: 1rem; }
.total-summary { display: inline-flex; align-items: center; gap: 0.5rem; }
.pagination { display: flex; align-items: center; gap: 0.25rem; }
.pagination-label { min-width: 4rem; color: var(--muted-foreground); font-size: 0.75rem; text-align: center; }
.batch-menu { --dropdown-width: 14rem; }

.event-dialog { width: calc(100vw - 2rem) !important; max-width: 40rem !important; overflow-y: auto; border-radius: 1rem !important; }
.event-dialog:focus, .event-dialog:focus-visible { outline: 0; }
.event-dialog .dialog-content { position: relative; padding: 1.5rem; }
.dialog-close-x { position: absolute; top: 1.25rem; right: 1.25rem; width: 2rem; height: 2rem; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--foreground); }
.dialog-close-x:hover { background: var(--accent); }
.dialog-close-x .icon { width: 1.125rem; height: 1.125rem; }
.event-dialog .dialog-header { padding-right: 2.5rem; }
.event-dialog .dialog-title { font-size: 1.25rem; }
.event-dialog .dialog-description { margin-top: 0.375rem; }
.event-form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.form-grid.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.half-field { width: calc(50% - 0.5rem); }
.form-footer { margin: 0 -1.5rem -1.5rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border); border-radius: 0 0 1rem 1rem; background: color-mix(in srgb, var(--muted) 22%, var(--card)); }
.date-input-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0 0.75rem; border: 1px solid var(--input); border-radius: var(--radius-md); background: transparent; color: var(--foreground); text-align: left; }
.date-input-button:hover { border-color: color-mix(in srgb, var(--foreground) 24%, transparent); }
.date-input-button .icon { color: var(--muted-foreground); }
.floating-panel { position: fixed; inset: auto; margin: 0; border: 1px solid var(--border); border-radius: 0.75rem; background: var(--popover); color: var(--popover-foreground); box-shadow: 0 14px 40px rgba(0,0,0,0.18); opacity: 0; transform: translateY(-0.2rem) scale(0.985); transition: opacity 140ms ease, transform 140ms ease, display 140ms allow-discrete; }
.floating-panel:popover-open { opacity: 1; transform: none; }
.calendar-popover { width: auto; min-width: 0; padding: 0.75rem; }
.calendar-head { display: grid; grid-template-columns: 2rem 1fr 2rem; align-items: center; margin-bottom: 0.5rem; }
.calendar-title { font-size: 0.9375rem; font-weight: 500; text-align: center; text-transform: capitalize; }
.calendar-nav { width: 2rem; height: 2rem; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; }
.calendar-nav:hover { background: var(--accent); }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.125rem; }
.calendar-weekdays span { height: 2rem; display: grid; place-items: center; color: var(--muted-foreground); font-size: 0.75rem; font-weight: 500; }
.calendar-day { aspect-ratio: 1; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0.55rem; background: transparent; color: inherit; font-size: 0.875rem; }
.calendar-day:hover { background: var(--accent); }
.calendar-day.outside { color: var(--muted-foreground); }
.calendar-day.today { background: var(--muted); }
.calendar-day.selected { background: var(--primary); color: var(--primary-foreground); }
.calendar-day:disabled { opacity: 0.35; cursor: not-allowed; }
.combobox-control { position: relative; }
.combobox-control .input { padding-right: 2.5rem; }
.combobox-clear { position: absolute; right: 0.375rem; top: 50%; width: 1.75rem; height: 1.75rem; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--muted-foreground); transform: translateY(-50%); }
.combobox-clear:hover { background: var(--accent); color: var(--foreground); }
.employee-options { width: 22rem; max-height: min(19rem, calc(100svh - 1rem)); padding: 0.375rem; overflow-y: auto; }
.employee-option { width: 100%; min-height: 2.5rem; display: grid; grid-template-columns: 1.75rem minmax(0, 1fr) 1rem; align-items: center; gap: 0.5rem; padding: 0.25rem 0.5rem; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; text-align: left; }
.employee-option:hover, .employee-option.highlighted { background: var(--accent); }
.employee-option .avatar { width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }
.employee-option .option-check { width: 1rem; }
.employee-empty { padding: 1rem; color: var(--muted-foreground); font-size: 0.875rem; text-align: center; }
.event-dialog.detail-mode :is(.input, .select, .date-input-button):disabled { opacity: 1; color: var(--foreground); background: color-mix(in srgb, var(--muted) 35%, transparent); cursor: default; }

.assistant-trigger { position: fixed; z-index: 40; right: 1.25rem; bottom: 2.5rem; width: 3rem; height: 3rem; overflow: hidden; padding: 0.5rem; border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent); border-radius: 999px; background: #fff; color: var(--primary); box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 24%, transparent); }
.assistant-trigger:hover { background: #fff; }
.assistant-trigger img { width: 100%; height: 100%; object-fit: contain; }
:root:not([data-theme="light"]) .assistant-trigger { border-color: color-mix(in srgb, var(--primary) 75%, white 10%); background: var(--primary); }
:root:not([data-theme="light"]) .assistant-trigger:hover { background: color-mix(in srgb, var(--primary) 88%, white); }
.assistant-sheet { width: min(28rem, 100vw) !important; }
.assistant-layout { height: 100%; display: flex; flex-direction: column; }
.assistant-header { flex: 0 0 auto; display: flex; justify-content: space-between; padding: 1.25rem; border-bottom: 1px solid var(--border); }
.assistant-header h2 { margin: 0 0 0.375rem; font-size: 1.0625rem; }
.assistant-header p { margin: 0; color: var(--muted-foreground); font-size: 0.875rem; }
.assistant-messages { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 0.75rem; overflow-y: auto; padding: 1rem 1.25rem; }
.assistant-message { max-width: 88%; padding: 0.75rem 1rem; border-radius: 0.5rem 0.5rem 0.5rem 0.125rem; background: var(--muted); font-size: 0.875rem; line-height: 1.5rem; }
.assistant-message.user { align-self: flex-end; border-radius: 0.5rem 0.5rem 0.125rem; background: var(--primary); color: var(--primary-foreground); }
.assistant-form { flex: 0 0 auto; display: flex; gap: 0.5rem; padding: 1rem; border-top: 1px solid var(--border); }
.assistant-form .input { flex: 1; }

.feedback-region { position: fixed; z-index: 100; left: calc(var(--sidebar-width) + 2.5rem); bottom: 1.25rem; width: min(420px, calc(100vw - 2.5rem)); pointer-events: none; transition: left 180ms ease; }
.sidebar-collapsed .feedback-region { left: calc(var(--sidebar-collapsed-width) + 2.5rem); }
.feedback-toast { position: relative; display: flex; align-items: center; gap: 0.75rem; overflow: hidden; padding: 0.625rem 0.75rem; border: 1px solid var(--border); border-radius: 0.75rem; background: var(--card); box-shadow: 0 16px 40px -16px color-mix(in srgb, var(--foreground) 28%, transparent); font-size: 0.875rem; pointer-events: auto; }
.feedback-check { width: 1.75rem; height: 1.75rem; display: grid; place-items: center; flex: 0 0 auto; border-radius: 999px; background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }
.feedback-message { min-width: 0; flex: 1; line-height: 1.25rem; }
.feedback-progress { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: var(--primary); transform-origin: left; animation: feedback-progress 5s linear forwards; }
@keyframes feedback-progress { to { transform: scaleX(0); } }

@media (max-width: 1023px) {
  .main-content { padding: 1.75rem 4.5rem 1.75rem 2.5rem; }
  .toolbar { align-items: stretch; flex-direction: column; }
}

@media (max-width: 767px) {
  body { overflow: auto; }
  .astro-shell, .astro-shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(16rem, calc(100vw - 3.5rem)); box-shadow: 14px 0 40px rgba(0,0,0,.2); transform: translateX(-105%); transition: transform 180ms ease; }
  .astro-shell.mobile-sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-collapsed .brand-block { min-height: 86px; height: auto; padding: 0.875rem 0.75rem; }
  .sidebar-collapsed .brand-button img { width: 9rem; height: 2.25rem; object-fit: contain; }
  .sidebar-collapsed .brand-block p, .sidebar-collapsed .sidebar-label, .sidebar-collapsed .nav-badge { display: initial; }
  .sidebar-collapsed .sidebar-link { width: 100%; height: auto; justify-content: flex-start; padding: 0.375rem 0.5rem; }
  .sidebar-collapsed .sidebar-nav { gap: 0.125rem; padding: 0 0.75rem 0.5rem; }
  .sidebar-collapsed .sidebar-footer { padding: 0.75rem; }
  .sidebar-collapsed .account-trigger { width: 100%; height: auto; margin: 0; }
  .topbar { padding: 0 1rem; }
  .topbar-divider { display: none; }
  .main-content { height: auto; min-height: calc(100svh - 4rem); overflow: visible; padding: 1.5rem 1.25rem 5rem; }
  .positive-events { min-height: calc(100svh - 7rem); }
  .toolbar-left { flex-direction: column; }
  .search-control { width: 100%; min-width: 0; flex: 0 0 auto; }
  .filter-control { width: fit-content; align-self: flex-start; }
  .filter-submenu { position: fixed; right: 1rem !important; left: 1rem !important; width: auto; max-height: calc(100svh - 1rem); }
  .filter-mobile-back { width: 100%; min-height: 2.25rem; display: flex; align-items: center; gap: 0.5rem; margin: -0.25rem 0 0.625rem; padding: 0.375rem 0.25rem; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--foreground); font-size: 0.875rem; text-align: left; }
  .table-viewport { min-height: 30rem; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .footer-actions { width: 100%; justify-content: space-between; }
  .feedback-region, .sidebar-collapsed .feedback-region { left: 1.25rem; }
}

@media (max-width: 520px) {
  .breadcrumb { font-size: 0; }
  .breadcrumb strong { font-size: 0.875rem; }
  .toolbar-actions { flex-wrap: wrap; }
  .form-grid.two-columns { grid-template-columns: 1fr; }
  .half-field { width: 100%; }
  .event-dialog .dialog-content { padding: 1.25rem; }
  .form-footer { margin: 0 -1.25rem -1.25rem; padding: 1rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
