:root {
  --font-primary: "Public Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 6px 16px rgba(20, 26, 33, 0.06);
  --shadow-md: 0 14px 30px rgba(20, 26, 33, 0.1);
  --sidebar-width: 280px;
  --topbar-height: 76px;
}

html[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --bg-soft: #f4f6f8;
  --text: #1c252e;
  --text-muted: #637381;
  --text-subtle: #919eab;
  --border: rgba(145, 158, 171, 0.22);
  --primary: #00a76f;
  --primary-soft: rgba(0, 167, 111, 0.14);
  --danger: #ff5630;
  --warning: #ffab00;
  --success: #22c55e;
}

html[data-theme="dark"] {
  --bg: #141a21;
  --bg-elevated: #1c252e;
  --bg-soft: #212b36;
  --text: #f4f6f8;
  --text-muted: #c4cdd5;
  --text-subtle: #919eab;
  --border: rgba(145, 158, 171, 0.24);
  --primary: #33c481;
  --primary-soft: rgba(51, 196, 129, 0.2);
  --danger: #ff8d72;
  --warning: #ffd666;
  --success: #77ed8b;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
  padding-bottom: 18px;
}

.app-logo {
  padding: 20px 20px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 20px;
}

.app-logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--primary), #00b8d9);
  color: #fff;
}

.nav-block-title {
  margin: 14px 18px 7px;
  color: var(--text-subtle);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.nav-list {
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 600;
}

.nav-item:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-sub-list {
  margin: -2px 0 6px;
  padding-left: 38px;
}

.nav-sub-item {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
}

.nav-sub-item.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-topbar {
  height: var(--topbar-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.avatar-pill {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.app-content {
  padding: 22px 24px 38px;
  max-width: 1420px;
}

.content-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.content-title {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.content-subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.panel-toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
}

.panel-toast {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

.panel-toast-success {
  border-color: rgba(34, 197, 94, 0.4);
}

.panel-toast-error {
  border-color: rgba(255, 86, 48, 0.5);
}

.panel-toast-info {
  border-color: rgba(0, 167, 111, 0.45);
}

@media (max-width: 1024px) {
  .app-sidebar {
    display: none;
  }
  .app-topbar {
    padding: 0 16px;
  }
  .app-content {
    padding: 18px 16px 90px;
  }
}
