@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600;700&family=Sora:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5efe6;
  --bg-accent: #efe5d8;
  --ink: #1f1b16;
  --muted: #6b5f55;
  --accent: #1f6f6b;
  --accent-dark: #165552;
  --accent-warm: #d27a3e;
  --card: #fffdfa;
  --border: #e3d7c7;
  --shadow: 0 28px 70px rgba(24, 19, 14, 0.16);
  --shadow-soft: 0 14px 40px rgba(24, 19, 14, 0.1);
  --ring: rgba(31, 111, 107, 0.25);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background:
    radial-gradient(900px circle at 8% -10%, rgba(255, 214, 171, 0.6) 0%, transparent 60%),
    radial-gradient(700px circle at 110% 0%, rgba(141, 214, 207, 0.4) 0%, transparent 55%),
    linear-gradient(180deg, #fdf8f1 0%, var(--bg) 48%, #efe6da 100%);
  background-attachment: fixed;
  background-color: var(--bg);
  overscroll-behavior-y: none;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: 'Sora', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: transparent;
  line-height: 1.6;
  overscroll-behavior-y: none;
}

h1, h2, h3 {
  margin: 0 0 12px 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
  color: var(--muted);
}

a {
  color: inherit;
  text-decoration: none;
}

.muted {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #2c8f89 100%);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--accent-dark) 0%, #22736e 100%);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--border);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.btn-warning {
  background: linear-gradient(135deg, #f2b07a 0%, #e8914b 100%);
  color: #3a2412;
}

.btn-warning:hover {
  transform: translateY(-1px);
}

.btn-muted {
  background: #f1e9df;
  color: var(--muted);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.9rem;
}

.commission-actions {
  align-items: flex-end;
}

.commission-actions .btn {
  height: 44px;
  padding: 0 20px;
}

.confirm-mask {
  position: fixed;
  inset: 0;
  background: rgba(31, 27, 22, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 16px;
}

.confirm-mask.is-open {
  display: flex;
}

.confirm-card {
  background: var(--card);
  width: min(420px, 92vw);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.confirm-head h3 {
  margin: 0 0 8px 0;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.confirm-actions .btn {
  min-width: 96px;
  height: 38px;
  padding: 0 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field textarea,
.field select {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid select {
  border-color: #f6b5a8;
  box-shadow: 0 0 0 3px rgba(246, 181, 168, 0.35);
}

.field.is-invalid span {
  color: #9b2c1f;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field-hint {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.confirm-hint {
  display: none;
  font-size: 0.85rem;
  color: #9b2c1f;
  line-height: 1.4;
}

.confirm-hint.is-visible {
  display: block;
}

.password-hints {
  display: none;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fffdfa;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  font-size: 0.85rem;
  color: var(--muted);
}

.password-hints.is-visible {
  display: grid;
}

.password-hints .hint-title {
  font-weight: 600;
  color: var(--ink);
}

.password-hints .rule-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.password-hints .rule-item {
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px dashed transparent;
  background: #f8efe3;
  color: var(--muted);
}

.password-hints .rule-item.is-valid {
  background: #e1f0ee;
  border-color: #b4ddd9;
  color: #1e5a57;
}

.password-hints .rule-item.is-invalid {
  background: #ffe5df;
  border-color: #f6b5a8;
  color: #9b2c1f;
}

.form {
  display: grid;
  gap: 16px;
}

.alert-stack {
  display: grid;
  gap: 10px;
  position: fixed;
  top: clamp(12px, 2vh, 20px);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: min(720px, 92vw);
  z-index: 2000;
  pointer-events: none;
}

.alert {
  position: relative;
  padding: 14px 16px 14px 44px;
  border-radius: 18px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  border: 1px solid transparent;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
}

.alert::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  transform: translateY(-50%);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.6);
}

.alert-stack[data-autohide] {
  animation: toast-stack-in 0.2s ease both, toast-stack-out 0.35s ease 2.65s forwards;
}

@keyframes toast-stack-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toast-stack-out {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
}

.alert-error {
  background: linear-gradient(135deg, #ffe5df 0%, #ffd7ce 100%);
  color: #9b2c1f;
  border: 1px solid #f6b5a8;
}

.alert-info {
  background: linear-gradient(135deg, #fff3d6 0%, #ffe6b5 100%);
  color: #7a4b12;
  border: 1px solid #f2d7a1;
}

.alert-success {
  background: linear-gradient(135deg, #e3f6e7 0%, #cfeeda 100%);
  color: #2f6b3a;
  border: 1px solid #b8e6c4;
}

.alert-error::before {
  background: #e86a5b;
}

.alert-info::before {
  background: #f0b248;
}

.alert-success::before {
  background: #4bb06a;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.login-shell {
  width: min(1120px, 94vw);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  padding: 24px;
}

.login-hero {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 244, 232, 0.95) 45%, rgba(255, 235, 218, 0.95) 100%),
    radial-gradient(180px circle at 20% 15%, rgba(255, 203, 150, 0.5) 0%, transparent 60%);
  border-radius: 32px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: conic-gradient(from 140deg at 50% 50%, #ffd19a, #1f6f6b, #ffd19a);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.brand-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.brand-sub {
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-copy h1 {
  font-size: 2.7rem;
  line-height: 1.1;
  font-family: 'Fraunces', serif;
}

.hero-copy p {
  margin-top: 12px;
  font-size: 1.05rem;
}

.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.login-card {
  background: var(--card);
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.login-card.is-scroll {
  padding: 0;
  gap: 0;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.login-card-head {
  background: var(--card);
  padding: 24px 32px 12px;
  border-bottom: 1px solid var(--border);
}

.login-card-head h2 {
  margin-bottom: 6px;
}

.login-card-head .muted {
  margin: 0;
}

.login-card .login-card-actions {
  background: var(--card);
  padding: 12px 32px 24px;
  border-top: 1px solid var(--border);
  justify-content: center;
  width: 100%;
  gap: 12px;
}

.form-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
}

.form-shell .form-body {
  display: grid;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 32px 20px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 95, 85, 0.55) rgba(248, 239, 227, 0.9);
}

.form-shell .alert-stack {
  margin: 12px 0 0;
}


.register-closed {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.95) 0%, rgba(255, 240, 220, 0.95) 100%),
    radial-gradient(120px circle at 12% 10%, rgba(210, 122, 62, 0.12) 0%, transparent 70%);
  border: 1px solid rgba(210, 122, 62, 0.2);
  box-shadow: var(--shadow-soft);
}

.register-closed::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(210, 122, 62, 0.7) 0%, rgba(210, 122, 62, 0.15) 100%);
}

.register-closed-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  background: rgba(210, 122, 62, 0.14);
  color: #b3561f;
  box-shadow: inset 0 0 0 1px rgba(210, 122, 62, 0.2);
}

.register-closed-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}

.register-closed-desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
}
.form-shell .login-card-actions {
  margin-top: 12px;
}

.form-shell .form-body::-webkit-scrollbar {
  width: 10px;
}

.form-shell .form-body::-webkit-scrollbar-track {
  background: rgba(248, 239, 227, 0.9);
  border-radius: 999px;
}

.form-shell .form-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d8c7b2 0%, #c5b39b 100%);
  border-radius: 999px;
  border: 2px solid rgba(248, 239, 227, 0.9);
}

.form-shell .form-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #c8b19a 0%, #b39c86 100%);
}

.login-card h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.9rem;
}

.login-foot {
  font-size: 0.85rem;
  color: var(--muted);
}

.app-body {
  min-height: 100vh;
  padding: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  margin: 0;
  padding: 0;
  position: relative;
}

.app-shell::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  z-index: 0;
}

.app-nav {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 26px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  backdrop-filter: none;
  z-index: 1;
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-group-toggle {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(250, 247, 241, 0.9);
  font-family: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.nav-group-toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.nav-group-toggle:hover {
  border-color: rgba(31, 111, 107, 0.2);
  color: var(--accent-dark);
}

.nav-group.is-active .nav-group-toggle {
  color: var(--accent-dark);
  border-color: rgba(31, 111, 107, 0.2);
  background: rgba(31, 111, 107, 0.06);
}

.nav-group-toggle[aria-expanded="false"]::after {
  transform: rotate(-45deg);
}

.nav-group-items {
  display: grid;
  gap: 8px;
  padding-left: 6px;
}

.nav-group[data-collapsed="true"] .nav-group-items {
  display: none;
}

.nav-item {
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-item.level-2 {
  font-size: 0.98rem;
  background: rgba(250, 247, 241, 0.8);
}

.nav-item:hover,
.nav-item.active {
  background: rgba(31, 111, 107, 0.08);
  color: var(--accent-dark);
  border-color: rgba(31, 111, 107, 0.2);
}

.logout-form {
  margin-top: auto;
}

.app-main {
  padding: 32px 36px 48px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px 28px 20px 22px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}


.page-header h1 {
  font-size: 2.1rem;
  font-family: 'Fraunces', serif;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-chip {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.meta-chip.muted {
  color: var(--muted);
}

.page-content {
  display: grid;
  gap: 20px;
}


.page-content > * {
  animation: rise 0.6s ease both;
}

.page-content > *:nth-child(2) {
  animation-delay: 0.06s;
}

.page-content > *:nth-child(3) {
  animation-delay: 0.12s;
}

.page-content > *:nth-child(4) {
  animation-delay: 0.18s;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.card-head h3 {
  margin-bottom: 6px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat {
  display: grid;
  gap: 6px;
}

.stat .value {
  font-size: 1.8rem;
  font-weight: 700;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.device-table {
  table-layout: auto;
}

.device-table th:nth-child(1),
.device-table td:nth-child(1) {
  width: 24%;
}

.device-table th:nth-child(2),
.device-table td:nth-child(2) {
  width: 20%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-table th:nth-child(3),
.device-table td:nth-child(3) {
  width: 30%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-table th:nth-child(4),
.device-table td:nth-child(4) {
  width: 26%;
  white-space: nowrap;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

.table select,
.table .table-select {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
}

.table select:focus,
.table .table-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.filter-actions .btn {
  height: 44px;
  padding: 0 18px;
  align-self: flex-end;
}

.filter-actions select {
  height: 44px;
}

.global-config-actions .btn {
  height: 44px;
  padding: 0 22px;
}

.global-config-actions {
  align-items: flex-end;
  gap: 12px;
}

.global-config-field {
  min-width: 220px;
}

.global-config-field input {
  height: 44px;
}

.pager select,
.pager .pager-select {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.pager .pager-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.pager .pager-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pager .pager-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.table th {
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}

.table tbody tr:nth-child(even) {
  background: rgba(250, 244, 234, 0.7);
}

.table tbody tr:hover {
  background: rgba(31, 111, 107, 0.08);
}

.route-config-block {
  display: grid;
  gap: 12px;
}

.route-config-table input[type="text"],
.route-config-table input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.95rem;
}

.route-config-table input[type="text"]:focus,
.route-config-table input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.route-config-table .route-group-row {
  background: rgba(255, 244, 232, 0.9);
}

.route-config-table .route-path code {
  font-family: 'Sora', 'Segoe UI', sans-serif;
  font-size: 0.85rem;
}

.status-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-block;
  border: 1px solid transparent;
}

.status-wait {
  background: #fff2d6;
  color: #7a4b12;
  border-color: #f2d7a1;
}

.status-active {
  background: #e1f0ee;
  color: #1e5a57;
  border-color: #b4ddd9;
}

.status-done {
  background: #e4f6e6;
  color: #2f6b3a;
  border-color: #bde6c5;
}

.status-muted {
  background: #f1ebe2;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8efe3;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
  border: 1px solid #eadfce;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-actions {
  justify-content: center;
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.inline-actions form {
  margin: 0;
  display: inline-flex;
}

.auth-actions .btn {
  min-width: 132px;
}

.table-actions .btn {
  min-width: 72px;
}

.notif-btn {
  position: relative;
  padding-right: 14px;
}

.notif-badge {
  margin-left: 8px;
  background: linear-gradient(135deg, #f4c76b 0%, #f0a75a 100%);
  color: #3d2612;
  border-radius: 999px;
  font-weight: 700;
  padding: 2px 8px;
  font-size: 0.8rem;
  border: 1px solid rgba(242, 170, 94, 0.6);
}

.notification-card .notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notification-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.notification-title {
  font-weight: 600;
}

.notification-meta {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.notification-body {
  padding: 12px 0;
  line-height: 1.7;
}

.notification-body p {
  margin-bottom: 12px;
}

.notification-body a {
  color: var(--accent);
  text-decoration: underline;
}

.notification-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 10px 0;
}

.notification-body ul,
.notification-body ol {
  margin: 0 0 12px 20px;
}

.notification-targets {
  display: grid;
  gap: 12px;
}

.target-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.target-group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.target-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

.target-group-list.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.editor-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: #f8f0e4;
  border-bottom: 1px solid var(--border);
}

.editor-toolbar button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
}

.editor-body {
  min-height: 160px;
  padding: 12px;
  outline: none;
}

.notification-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell::before {
    display: none;
  }

  .app-nav {
    position: relative;
    height: auto;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .nav-list {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table {
    display: block;
    overflow-x: auto;
  }
}

@media (min-width: 961px) {
  .app-body {
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    background: linear-gradient(90deg, #fff 0, #fff 260px, transparent 260px);
  }

  .app-main {
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
