:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --soft: #9ca3af;
  --accent: #ff9100;
  --accent-2: #ea580c;
  --accent-soft: rgba(255, 145, 0, 0.1);
  --blue-soft: rgba(255, 145, 0, 0.08);
  --danger: #dc2626;
  --warning: #d97706;
  --success: #059669;
  --shadow: 0 12px 32px rgba(17, 24, 39, 0.06);
  --shadow-sm: 0 4px 14px rgba(17, 24, 39, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 260px;
  --sidebar-collapsed: 76px;
  --topbar: 68px;
  color-scheme: light;
}

body.dark {
  --bg: #0b1220;
  --surface: #111827;
  --surface-2: #0f172a;
  --line: #243044;
  --line-strong: #334155;
  --text: #f8fafc;
  --muted: #b6c2d2;
  --soft: #7f8da3;
  --accent: #2dd4bf;
  --accent-2: #93c5fd;
  --accent-soft: rgba(45, 212, 191, 0.13);
  --blue-soft: rgba(147, 197, 253, 0.13);
  --shadow: 0 20px 54px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.admin-shell.is-collapsed {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid #334155;
  background: #1e293b;
  transition: width 0.22s ease, transform 0.22s ease;
}

.admin-shell.is-collapsed .admin-sidebar {
  width: var(--sidebar-collapsed);
}

.brand-block {
  min-height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #334155;
}

.brand {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  flex: 0 0 auto;
}

.brand__text {
  display: grid;
}

.brand__text strong {
  font-size: 16px;
  letter-spacing: 0;
  color: #f8fafc;
}

.brand__text small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.admin-shell.is-collapsed .brand__text,
.admin-shell.is-collapsed .nav-label,
.admin-shell.is-collapsed .nav-count,
.admin-shell.is-collapsed .sidebar-foot,
.admin-shell.is-collapsed .sidebar-toggle {
  display: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-2);
}

.icon-btn svg,
.side-nav svg,
.global-search svg,
.profile svg,
.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.has-dot {
  position: relative;
}

.has-dot::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--surface);
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #94a3b8;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
}

.nav-item.is-active {
  background: rgba(255, 145, 0, 0.14);
  color: #ffb84d;
  border-color: rgba(255, 145, 0, 0.28);
}

.nav-label {
  min-width: 0;
  flex: 1;
  font-weight: 800;
  font-size: 14px;
}

.nav-count {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--soft);
  font-size: 11px;
  font-weight: 900;
}

.sidebar-card {
  margin: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-sm);
}

.sidebar-card__label,
.metric__label,
.panel-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.sidebar-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.health-bar {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.health-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.admin-main {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar);
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(360px, 760px) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px);
}

.topbar__left,
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu {
  display: none;
}

.breadcrumb {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.breadcrumb strong {
  color: var(--text);
}

.global-search {
  min-height: 46px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.global-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.global-search kbd {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 900;
}

.quick-btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.quick-btn {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.btn:hover,
.quick-btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.btn--primary {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.btn--danger {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.btn--icon-outline {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  background: none;
  background-color: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}

.btn--icon-outline:hover,
.btn--icon-outline:focus-visible {
  transform: none;
  background: none;
  background-color: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn--icon-outline.btn--icon-danger {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.35);
}

.btn--icon-outline.btn--icon-danger:hover,
.btn--icon-outline.btn--icon-danger:focus-visible {
  background: none;
  border-color: var(--danger);
  color: var(--danger);
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}

.form-field__hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}

.profile {
  position: relative;
}

.profile__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 6px 10px 6px 6px;
  cursor: pointer;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--accent-2);
  font-weight: 900;
}

.profile__meta {
  display: grid;
  text-align: left;
}

.profile__meta strong {
  font-size: 13px;
}

.profile__meta small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  display: none;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-menu.is-open {
  display: grid;
}

.profile-menu a,
.profile-menu button {
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.profile-menu a:hover,
.profile-menu button:hover {
  background: var(--surface-2);
}

.workspace {
  padding: 24px;
}

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

.page-title h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-title p {
  margin: 0;
  max-width: 840px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.page-actions,
.filter-row,
.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.select,
.input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  outline: 0;
}

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

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel,
.data-table,
.kanban-card,
.empty-state,
.skeleton-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.metric::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 88px;
  height: 88px;
  border-radius: 26px;
  background: var(--accent-soft);
  transform: rotate(16deg);
}

.metric__value {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.metric__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(6, 118, 71, 0.1);
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
}

.metric__delta.is-down {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-12 { grid-column: 1 / -1; }

.panel {
  padding: 18px;
  min-width: 0;
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel__head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.panel__head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.chart {
  width: 100%;
  min-height: 260px;
}

.chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.donut-wrap {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 18px;
  align-items: center;
}

.donut {
  width: 174px;
  height: 174px;
  border-radius: 50%;
  background: conic-gradient(#0f766e 0 43%, #1d4ed8 43% 67%, #f59e0b 67% 83%, #b42318 83% 92%, #94a3b8 92% 100%);
  display: grid;
  place-items: center;
}

.donut::after {
  content: "8.4K";
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
}

.legend {
  display: grid;
  gap: 10px;
}

.legend__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.data-table {
  overflow: hidden;
}

.data-table__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.data-table__head h2 {
  margin: 0;
  font-size: 20px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

tr {
  transition: background 0.16s ease;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

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

.entity__logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
  flex: 0 0 auto;
}

.entity small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge.success { color: var(--success); background: rgba(6, 118, 71, 0.1); }
.badge.warning { color: var(--warning); background: rgba(181, 71, 8, 0.1); }
.badge.danger { color: var(--danger); background: rgba(180, 35, 24, 0.1); }
.badge.info { color: var(--accent-2); background: var(--blue-soft); }
.badge.neutral { color: var(--muted); background: var(--surface-2); border-color: var(--line); }

.activity-list,
.timeline,
.info-list {
  display: grid;
  gap: 12px;
}

.activity {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.activity__dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.activity strong {
  display: block;
  font-size: 14px;
}

.activity span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.activity time {
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.module-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.hero-card h2 {
  margin: 8px 0 10px;
  font-size: 28px;
}

.hero-card p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 9px 13px;
  font-weight: 900;
  cursor: pointer;
}

.tab.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.detail-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.detail-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 14px;
  overflow-x: auto;
}

.kanban-card {
  padding: 14px;
}

.kanban-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.ticket {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 10px;
}

.ticket strong {
  display: block;
}

.ticket p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.empty-state {
  padding: 28px;
  text-align: center;
}

.empty-state__icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.skeleton-lines {
  display: grid;
  gap: 10px;
}

.skeleton-box {
  height: 14px;
  overflow: hidden;
  background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.page-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(4px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: modal-in 0.18s ease;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal__head h2 {
  margin: 0;
  font-size: 20px;
}

.modal__body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.modal__foot[hidden] {
  display: none !important;
}

.modal--form {
  width: min(480px, 100%);
}

.modal--confirm {
  width: min(420px, 100%);
}

.modal-intro {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.modal-form {
  display: grid;
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.form-field__hint {
  font-size: 12px;
  color: var(--soft);
  margin-top: -2px;
}

.input--textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
  padding: 12px;
}

.status-cell {
  display: grid;
  gap: 8px;
  min-width: 160px;
}

.status-cell .select--inline {
  width: 100%;
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 280px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: toast-in 0.22s ease;
}

.toast strong {
  display: block;
  margin-bottom: 4px;
}

.toast span {
  color: var(--muted);
  font-size: 13px;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 6px 8px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  z-index: 4;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1380px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6 {
    grid-column: span 6;
  }

  .span-7,
  .span-8,
  .span-9 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1080px) {
  .admin-shell,
  .admin-shell.is-collapsed {
    grid-template-columns: 1fr;
  }

  .admin-sidebar,
  .admin-shell.is-collapsed .admin-sidebar {
    width: var(--sidebar);
    transform: translateX(-100%);
  }

  .admin-shell.is-mobile-open .admin-sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }

  .admin-main {
    grid-column: 1;
  }

  .mobile-menu {
    display: inline-grid;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .global-search {
    order: 3;
  }

  .module-hero,
  .donut-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px;
  }

  .page-head,
  .data-table__head,
  .panel__head {
    flex-direction: column;
    align-items: stretch;
  }

  .metrics-grid,
  .detail-grid,
  .component-grid {
    grid-template-columns: 1fr;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-9 {
    grid-column: 1 / -1;
  }

  .topbar__actions {
    flex-wrap: wrap;
  }

  .profile__meta {
    display: none;
  }
}

/* v2 — sadələşdirilmiş admin UI */
.side-nav .fa-solid,
.icon-btn .fa-solid,
.btn .fa-solid,
.global-search .fa-solid,
.profile .fa-solid {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.nav-item .fa-solid {
  width: 20px;
  color: inherit;
  opacity: 0.85;
}

.nav-label {
  font-weight: 600;
}

.nav-count {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-weight: 700;
}

.sidebar-foot {
  padding: 16px 18px 20px;
  border-top: 1px solid var(--line);
}

.sidebar-foot p {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
}

.page-title h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 560px;
}

.panel-eyebrow {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.metric__hint {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: 12px;
}

.loading-state {
  padding: 32px 24px;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-top: 18px;
}

.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0 4px;
}

.queue-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.queue-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow-sm);
}

.queue-card i {
  color: var(--accent);
  font-size: 18px;
}

.queue-card strong {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.queue-card span {
  color: var(--muted);
  font-size: 13px;
}

.row-menu {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.row-menu__trigger {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.row-menu__trigger:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line-strong);
}

.row-menu__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.row-menu__dropdown[hidden] {
  display: none !important;
}

.row-menu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.row-menu__item i {
  width: 16px;
  color: var(--muted);
  font-size: 13px;
}

.row-menu__item:hover {
  background: var(--surface-2);
}

.row-menu__item--danger {
  color: var(--danger);
}

.row-menu__item--danger i {
  color: var(--danger);
}

.row-menu__divider {
  margin: 6px 0;
  border: none;
  border-top: 1px solid var(--line);
}

td:last-child,
th:last-child {
  width: auto;
  min-width: 96px;
  text-align: right;
  white-space: nowrap;
}

.modal-desc {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

@media (max-width: 980px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* v3 — admin panel polish */
.admin-sidebar .icon-btn {
  border-color: #475569;
  background: #334155;
  color: #cbd5e1;
}

.admin-sidebar .icon-btn:hover {
  background: #475569;
  color: #fff;
}

.sidebar-foot {
  padding: 16px 18px 20px;
  border-top: 1px solid #334155;
}

.sidebar-foot p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.nav-count {
  background: rgba(255, 145, 0, 0.18);
  border-color: transparent;
  color: #ffb84d;
  font-weight: 700;
}

.topbar {
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
}

.breadcrumb {
  font-weight: 600;
  font-size: 15px;
}

.data-table__head h2,
.panel__head h2 {
  font-size: 16px;
  font-weight: 700;
}

table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  background: var(--surface-2);
}

table td {
  font-size: 14px;
  vertical-align: middle;
}

.metric__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.metric__value {
  font-size: 26px;
  font-weight: 800;
}

.toast--error {
  border-left-color: var(--danger);
}

.btn--danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  filter: brightness(0.95);
}

body.dark .admin-sidebar {
  background: #0f172a;
  border-right-color: #1e293b;
}

body.dark .brand-block,
body.dark .sidebar-foot {
  border-color: #1e293b;
}

.modal--product {
  width: min(920px, 100%);
}

.product-detail {
  display: grid;
  gap: 20px;
}

.product-detail__top {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.product-gallery {
  display: grid;
  gap: 12px;
}

.product-gallery__main {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-gallery__thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.product-gallery__thumb.is-active,
.product-gallery__thumb:hover {
  border-color: var(--accent);
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery--empty {
  aspect-ratio: 1;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--soft);
  display: grid;
  place-content: center;
  gap: 8px;
  font-size: 14px;
}

.product-gallery--empty i {
  font-size: 32px;
  justify-self: center;
}

.product-detail__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.product-detail__name {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.product-price-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.product-price-block__sale {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.product-price-block__old {
  font-size: 16px;
  color: var(--soft);
  text-decoration: line-through;
}

.product-price-block__badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.product-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin: 0;
}

.product-meta > div {
  display: grid;
  gap: 4px;
}

.product-meta dt {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.product-meta dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.product-detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.product-description {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.product-specs {
  display: grid;
  gap: 8px;
  margin: 0;
}

.product-specs > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.product-specs dt {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.product-specs dd {
  margin: 0;
  font-size: 14px;
}

.product-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.product-alert i {
  margin-top: 2px;
}

.product-alert strong {
  display: block;
  margin-bottom: 4px;
}

.product-alert span {
  color: var(--muted);
  line-height: 1.5;
}

.product-alert--danger {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: var(--danger);
}

.product-alert--warning {
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: var(--warning);
}

@media (max-width: 720px) {
  .product-detail__top {
    grid-template-columns: 1fr;
  }

  .product-meta {
    grid-template-columns: 1fr;
  }

  .vendor-detail__sections {
    grid-template-columns: 1fr;
  }
}

.modal--vendor {
  width: min(860px, 100%);
}

.section-count {
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
}

.product-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.product-images-grid__item {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.product-images-grid__item:hover,
.product-images-grid__item.is-active {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.product-images-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-images-grid__item span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.product-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.vendor-detail {
  display: grid;
  gap: 18px;
}

.vendor-detail__hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.vendor-detail__avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  flex: 0 0 auto;
}

.vendor-detail__head {
  min-width: 0;
}

.vendor-detail__sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.vendor-detail__sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.vendor-detail__card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.vendor-detail__card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.vendor-detail__card h3 i {
  color: var(--accent);
  font-size: 13px;
}

.vendor-detail__card .product-meta {
  grid-template-columns: 1fr;
  gap: 10px;
}

.vendor-detail__card--wide {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .vendor-detail__sections {
    grid-template-columns: 1fr;
  }
}

/* ── Şans çarxı ── */
.wheel-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 145, 0, 0.08);
  border: 1px solid rgba(255, 145, 0, 0.25);
  color: var(--text, #1e293b);
  font-size: 13px;
}
.wheel-note i {
  color: #ff9100;
}
.wheel-note--warn {
  background: rgba(234, 88, 12, 0.08);
  border-color: rgba(234, 88, 12, 0.28);
}
.wheel-note--warn i {
  color: #ea580c;
}
.wheel-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 145, 0, 0.1);
  color: #e5730a;
}
.wheel-ico--lg {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.wheel-icon-pick {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wheel-icon-pick .input {
  flex: 1;
}
body.dark .wheel-ico {
  background: rgba(255, 145, 0, 0.16);
  color: #ffb74d;
}
body.dark .wheel-note {
  color: #e2e8f0;
}

.entity--product {
  align-items: center;
}

.entity__thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}

.entity__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.catalog-search {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 320px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

.catalog-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font: inherit;
  color: var(--text);
}

.catalog-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

/* İstifadə şərtləri — Ayarlar */
.terms-panel {
  margin-bottom: 20px;
}

/* Ayarlar — yığılmış bölmələr */
.settings-block {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface, #fff);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.settings-block:hover {
  border-color: rgba(234, 88, 12, 0.28);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.settings-block.is-open {
  border-color: rgba(234, 88, 12, 0.35);
  box-shadow: 0 12px 28px rgba(234, 88, 12, 0.08);
}

.settings-block__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: none;
  background: var(--surface-2, #f8fafc);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.settings-block__toggle:hover {
  background: #fff7ed;
}

.settings-block.is-open .settings-block__toggle {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.settings-block__titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.settings-block__titles strong {
  font-size: 17px;
  font-weight: 800;
  transition: color 0.2s ease;
}

.settings-block__toggle:hover .settings-block__titles strong,
.settings-block.is-open .settings-block__titles strong {
  color: #c2410c;
}

.settings-block__titles small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.settings-block__chevron {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.settings-block__toggle:hover .settings-block__chevron {
  border-color: rgba(234, 88, 12, 0.35);
  color: #ea580c;
}

.settings-block.is-open .settings-block__chevron {
  transform: rotate(180deg);
  color: #ea580c;
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.4);
}

.settings-block__body {
  padding: 16px 18px 18px;
  animation: settingsBodyIn 0.28s ease both;
}

.settings-block__body[hidden] {
  display: none !important;
}

@keyframes settingsBodyIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-block__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .settings-block,
  .settings-block__toggle,
  .settings-block__chevron,
  .settings-block__body {
    transition: none;
    animation: none;
  }
}

.terms-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 14px;
}

.terms-meta > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2, #f8fafc);
  padding: 12px 14px;
}

.terms-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.terms-meta strong {
  font-size: 14px;
  line-height: 1.4;
}

.terms-intro-preview {
  margin: 0 18px 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.terms-index {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 800;
}

.terms-panel__foot {
  display: flex;
  justify-content: flex-end;
  padding: 14px 18px 18px;
}

.input--textarea,
textarea.input {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .terms-meta {
    grid-template-columns: 1fr;
  }
}
