:root {
  color-scheme: light;
  --bg: #f5f5f6;
  --surface: #ffffff;
  --surface-strong: #ececef;
  --text: #1f1f23;
  --muted: #6f7178;
  --line: #dddde2;
  --accent: #9f1239;
  --accent-strong: #6d0f28;
  --amber: #b45309;
  --danger: #b91c1c;
  --shadow: 0 16px 40px rgba(31, 31, 35, 0.12);
  --focus-ring: rgba(159, 18, 57, 0.14);
  --drop-overlay-bg: rgba(245, 245, 246, 0.74);
  --empty-bg: rgba(255, 255, 255, 0.55);
  --modal-backdrop-bg: rgba(245, 245, 246, 0.48);
  --panel-translucent: rgba(255, 255, 255, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.84);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111114;
  --surface: #1c1c21;
  --surface-strong: #2a2a31;
  --text: #f1f1f3;
  --muted: #aaaab3;
  --line: #393941;
  --accent: #fb7185;
  --accent-strong: #f43f5e;
  --amber: #f59e0b;
  --danger: #f87171;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
  --focus-ring: rgba(251, 113, 133, 0.2);
  --drop-overlay-bg: rgba(17, 17, 20, 0.78);
  --empty-bg: rgba(28, 28, 33, 0.72);
  --modal-backdrop-bg: rgba(0, 0, 0, 0.62);
  --panel-translucent: rgba(28, 28, 33, 0.94);
  --panel-soft: rgba(42, 42, 49, 0.9);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.material-symbols-rounded {
  direction: ltr;
  display: inline-block;
  font-family: "Material Symbols Rounded";
  font-feature-settings: "liga";
  font-size: 20px;
  font-style: normal;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-weight: normal;
  letter-spacing: normal;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

.material-symbols-rounded.filled {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

[hidden] {
  display: none !important;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  font-weight: 720;
}

h2 {
  font-size: 20px;
  font-weight: 700;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.form-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.field.compact {
  min-width: 180px;
}

.primary-action,
.secondary-action,
.danger-action,
.icon-action {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-action {
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
}

.primary-action:hover {
  background: var(--accent-strong);
}

.secondary-action {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  padding: 0 14px;
}

.secondary-action:hover,
.icon-action:hover {
  border-color: var(--accent);
}

.danger-action {
  background: var(--danger);
  color: #fff;
  padding: 0 14px;
}

.danger-action:hover {
  background: #7f1d1d;
}

.icon-action {
  display: inline-grid;
  place-items: center;
  width: 40px;
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  line-height: 1;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 13px 15px;
  color: var(--text);
  font-size: 14px;
}

.app-view {
  min-height: 100vh;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

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

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-action {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 700;
}

.nav-action:hover,
.nav-action.active {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.nav-menu {
  position: relative;
}

.nav-action-menu {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.nav-action-icon {
  font-size: 20px;
  transition: transform 0.16s ease;
}

.nav-menu.open .nav-action-icon {
  transform: rotate(180deg);
}

.topbar-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  min-width: 198px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 6px;
}

.topbar-menu[hidden] {
  display: none;
}

.topbar-menu-item {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.topbar-menu-item .material-symbols-rounded {
  font-size: 20px;
}

.topbar-menu-item:hover,
.topbar-menu-item:focus-visible,
.topbar-menu-item.active {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.theme-toggle {
  flex: 0 0 auto;
}

.theme-toggle-icon {
  font-size: 22px;
}

.current-user {
  color: var(--muted);
  font-size: 14px;
}

.workspace {
  min-height: calc(100vh - 76px);
}

@media (max-width: 880px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}
