/* Актион 360 — Портал отдела продаж и админ-панель
 * Строгий промышленный B2B SaaS стиль (светлый фон + глубокий графитово-синий сайдбар)
 */

:root {
  --bg-app: #f3f5f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-muted: #eef2f6;

  --sidebar-bg: #111c2d;
  --sidebar-bg-hover: #1b2b44;
  --sidebar-bg-active: #213757;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #cbd5e1;
  --sidebar-text-active: #ffffff;
  --sidebar-muted: #7c8ea8;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border: #dce3ec;
  --border-strong: #c2cedc;

  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;

  --green: #15803d;
  --green-bg: #dcfce7;
  --green-border: #bbf7d0;

  --yellow: #b45309;
  --yellow-bg: #fef3c7;
  --yellow-border: #fde68a;

  --red: #b91c1c;
  --red-bg: #fee2e2;
  --red-border: #fecaca;

  --slate-badge-bg: #e2e8f0;
  --slate-badge-text: #334155;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.16);

  --sidebar-width: 248px;
  --topbar-height: 58px;
  --font-sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.48;
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ==================== Login Screen ==================== */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(29, 78, 216, 0.12), transparent 42%),
    radial-gradient(circle at 82% 80%, rgba(17, 28, 45, 0.14), transparent 45%),
    var(--bg-app);
}

.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #111c2d 0%, #1d4ed8 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.auth-logo.admin-logo {
  background: linear-gradient(135deg, #111c2d 0%, #b45309 100%);
}

.auth-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-hint-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  color: #1e3a8a;
  margin-bottom: 18px;
}

.auth-hint-box.warn {
  background: var(--yellow-bg);
  border-color: var(--yellow-border);
  color: #78350f;
}

.auth-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ==================== App Layout ==================== */

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

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 11px;
}

.sidebar-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo.admin {
  background: linear-gradient(135deg, #d97706 0%, #92400e 100%);
}

.sidebar-brand-name {
  font-weight: 700;
  font-size: 14.5px;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 11.5px;
  color: var(--sidebar-muted);
  margin-top: 2px;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  padding: 10px 10px 4px;
}

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-item:hover {
  background: var(--sidebar-bg-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--sidebar-bg-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
  box-shadow: inset 3px 0 0 #3b82f6;
}

.nav-item.admin-active.active {
  box-shadow: inset 3px 0 0 #f59e0b;
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.nav-badge.danger {
  background: rgba(239, 68, 68, 0.24);
  color: #fecaca;
}

.sidebar-footer {
  padding: 14px 14px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--sidebar-text);
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  text-decoration: none;
}

.main-area {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

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

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.content-wrap {
  padding: 22px 24px 36px;
  max-width: 1460px;
  width: 100%;
  margin: 0 auto;
}

/* ==================== Cards & Grids ==================== */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}

.card + .card,
.section-gap {
  margin-top: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

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

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

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

.grid-sidebar-split {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* ==================== KPI Cards ==================== */

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kpi-card.status-green {
  border-top: 3px solid #16a34a;
}

.kpi-card.status-yellow {
  border-top: 3px solid #d97706;
}

.kpi-card.status-red {
  border-top: 3px solid #dc2626;
}

.kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.kpi-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-primary);
}

.kpi-role {
  font-size: 11.5px;
  color: var(--text-muted);
}

.kpi-metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  gap: 8px;
}

.kpi-big {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
}

.progress-track {
  height: 7px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.progress-fill.green { background: #16a34a; }
.progress-fill.yellow { background: #d97706; }
.progress-fill.red { background: #dc2626; }

/* ==================== Badges & Traffic Lights ==================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.badge-green {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.badge-yellow {
  background: var(--yellow-bg);
  color: var(--yellow);
  border: 1px solid var(--yellow-border);
}

.badge-red {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.badge-blue {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.badge-slate {
  background: var(--slate-badge-bg);
  color: var(--slate-badge-text);
  border: 1px solid var(--border);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 3px 8px;
  border-radius: 7px;
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.score-high { background: var(--green-bg); color: var(--green); }
.score-mid { background: var(--yellow-bg); color: var(--yellow); }
.score-low { background: var(--red-bg); color: var(--red); }

/* ==================== Buttons ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.08s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: #94a3b8;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

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

.btn-success {
  background: #15803d;
  border-color: #15803d;
  color: #ffffff;
}

.btn-success:hover:not(:disabled) {
  background: #166534;
  border-color: #166534;
}

.btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-group {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==================== Forms ==================== */

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.form-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 400;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}

.chip-check:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.chip-check input {
  accent-color: var(--accent);
}

/* ==================== Dropzone ==================== */

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==================== Tables ==================== */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr.clickable {
  cursor: pointer;
}

.table tbody tr.clickable:hover {
  background: #f5f8fd;
}

.table tbody tr.selected {
  background: var(--accent-soft);
}

/* ==================== Sub-tabs ==================== */

.subtabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.subtab {
  border: 0;
  background: transparent;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.subtab:hover {
  color: var(--text-primary);
}

.subtab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ==================== Call Detail, Timecodes, Checklist ==================== */

.timecode-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timecode-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.timecode-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.timecode-stamp {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: #ffffff;
  border: 1px solid var(--accent-border);
  padding: 2px 7px;
  border-radius: 5px;
  flex-shrink: 0;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  background: #ffffff;
}

.checklist-item.passed {
  border-left: 3px solid #16a34a;
}

.checklist-item.failed {
  border-left: 3px solid #dc2626;
}

.checklist-item.partial {
  border-left: 3px solid #d97706;
}

.erm-box {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 13px 15px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.pre-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  max-height: 540px;
  overflow-y: auto;
}

/* ==================== Holding Matrix ==================== */

.matrix-cell {
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  border-radius: 6px;
  padding: 4px 6px;
  display: inline-block;
  min-width: 78px;
}

.matrix-bought {
  background: var(--green-bg);
  color: var(--green);
}

.matrix-demo {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.matrix-empty {
  background: var(--bg-muted);
  color: var(--text-muted);
}

/* ==================== Alerts & Lists ==================== */

.alert-box {
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-red {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: #7f1d1d;
}

.alert-yellow {
  background: var(--yellow-bg);
  border-color: var(--yellow-border);
  color: #78350f;
}

.alert-green {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: #14532d;
}

.alert-blue {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: #1e3a8a;
}

.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==================== Modal ==================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-dialog {
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-subtle);
}

/* ==================== Toast ==================== */

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 11px 15px;
  border-radius: 9px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  border-left: 4px solid #3b82f6;
}

.toast.success { border-left-color: #22c55e; }
.toast.error { border-left-color: #ef4444; }
.toast.warn { border-left-color: #f59e0b; }

/* ==================== Spinner ==================== */

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== Responsive (Laptop / Compact) ==================== */

@media (max-width: 1260px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-sidebar-split {
    grid-template-columns: 310px minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 210px;
  }
  .grid-3,
  .grid-2,
  .grid-sidebar-split,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .content-wrap {
    padding: 16px;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
  .app-shell {
    flex-direction: column;
  }
  .main-area {
    margin-left: 0;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-item {
    width: auto;
  }
}
