﻿:root {
  color-scheme: light;
  --color-bg: #f5f7fb;
  --color-surface: #ffffff;
  --color-surface-muted: #f8fafc;
  --color-border: rgba(15, 23, 42, 0.08);
  --color-primary: #2563eb;
  --color-primary-soft: rgba(37, 99, 235, 0.12);
  --color-primary-strong: #1d4ed8;
  --color-foreground: #0f172a;
  --color-muted: #64748b;
  --color-success: #16a34a;
  --color-warning: #f59e0b;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
  --shadow-raised: 0 26px 60px rgba(15, 23, 42, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #040b1a;
  --color-surface: #0f172a !important;
  --color-surface-muted: #15213b;
  --color-border: rgba(148, 163, 184, 0.18);
  --color-primary: #60a5fa;
  --color-primary-soft: rgba(96, 165, 250, 0.18);
  --color-primary-strong: #3b82f6;
  --color-foreground: #e2e8f0;
  --color-muted: #94a3b8;
  --color-success: #22c55e;
  --color-warning: #facc15;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.45);
  --shadow-raised: 0 30px 75px rgba(2, 6, 23, 0.65);
}

html, body {
  background-color: var(--color-bg);
  color: var(--color-foreground);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  transition: background-color 220ms ease, color 220ms ease;
}

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

a:hover {
  color: var(--color-primary-strong);
}

.text-muted {
  color: var(--color-muted);
}

.surface {
  background-color: var(--color-surface);
  border-radius: 20px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.surface-muted {
  background-color: var(--color-surface-muted);
  border-radius: 18px;
  border: 1px solid transparent;
}

.badge {
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
  border-radius: 9999px;
  padding: 0.15rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.btn-primary {
  background: linear-gradient(120deg, var(--color-primary), var(--color-primary-strong));
  color: #f8fafc;
  border-radius: 12px;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.25);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 50px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-foreground);
  border-radius: 12px;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.btn-secondary:hover {
  background-color: var(--color-surface-muted);
  border-color: var(--color-primary-soft);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 10px;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--color-border);
  background-color: transparent;
}

input, select, textarea {
  background-color: var(--color-surface) !important;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.85rem;
  color: var(--color-foreground);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.table-surface {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  overflow: hidden;
}

.table-surface table {
  width: 100%;
  border-collapse: collapse;
}

.table-surface thead {
  background: var(--color-surface-muted);
  color: var(--color-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-surface th,
.table-surface td {
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--color-border);
}

.shadow-raised {
  box-shadow: var(--shadow-raised);
}

.tooltip {
  position: relative;
}

.tooltip[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  background-color: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  font-size: 0.75rem;
  white-space: pre-wrap;
  line-height: 1.3;
  transition: opacity 160ms ease, transform 160ms ease;
  bottom: calc(100% + 8px);
  left: 50%;
  transform-origin: bottom center;
  width: max-content;
  max-width: 220px;
  z-index: 40;
}

:root[data-theme="dark"] .tooltip[data-tip]::after {
  background-color: rgba(15, 23, 42, 0.92);
}

.tooltip:hover::after,
.tooltip:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, -4px);
}

.logo-mark {
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}

.scroll-area {
  max-height: 24rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary-soft) transparent;
}

.scroll-area::-webkit-scrollbar {
  width: 8px;
}

.scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-area::-webkit-scrollbar-thumb {
  background: var(--color-primary-soft);
  border-radius: 999px;
}

.badge-success {
  background: rgba(22, 163, 74, 0.15);
  color: var(--color-success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.app-shell__main {
  flex: 1;
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 1024px) {
  .app-shell {
    padding: 1rem;
  }
  .app-shell__main {
    flex-direction: column;
  }
}
