@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #04000b;
  --bg-secondary: #080817;
  --bg-accent: rgba(92, 61, 173, 0.35);
  --surface: rgba(17, 22, 45, 0.88);
  --surface-soft: rgba(20, 27, 52, 0.72);
  --text: #f4f7ff;
  --muted: #a1aac5;
  --muted-strong: #c3c8de;
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.24);
  --shadow-lg: 0 40px 70px rgba(8, 3, 25, 0.55);
  --shadow-md: 0 22px 45px rgba(8, 3, 25, 0.42);
  --shadow-sm: 0 14px 28px rgba(8, 3, 25, 0.32);
  --chip-bg: rgba(99, 102, 241, 0.15);
  --input-bg: rgba(12, 15, 32, 0.92);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-placeholder: rgba(191, 197, 224, 0.6);
  --accent: #ec4899;
  --accent-2: #6366f1;
  --accent-3: #a855f7;
  --accent-gradient: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  --radius: 18px;
  --radius-lg: 28px;
}

html[data-theme='light'] {
  --bg: #f6f7fb;
  --bg-secondary: #eef1f8;
  --bg-accent: rgba(99, 102, 241, 0.12);
  --surface: rgba(255, 255, 255, 0.95);
  --surface-soft: rgba(255, 255, 255, 0.85);
  --text: #111325;
  --muted: #5b6175;
  --muted-strong: #171b33;
  --border: rgba(17, 19, 37, 0.08);
  --border-strong: rgba(17, 19, 37, 0.16);
  --shadow-lg: 0 40px 65px rgba(25, 30, 60, 0.18);
  --shadow-md: 0 26px 55px rgba(25, 30, 60, 0.16);
  --shadow-sm: 0 18px 32px rgba(25, 30, 60, 0.12);
  --chip-bg: rgba(99, 102, 241, 0.12);
  --input-bg: rgba(255, 255, 255, 0.96);
  --input-border: rgba(17, 19, 37, 0.14);
  --input-placeholder: rgba(90, 96, 118, 0.6);
  --accent: #ec4899;
  --accent-2: #6366f1;
  --accent-3: #a855f7;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -20%, rgba(99, 102, 241, 0.32), transparent 60%),
    radial-gradient(900px 520px at 95% 0%, rgba(236, 72, 153, 0.26), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-secondary) 52%, var(--bg) 100%);
  background-attachment: fixed;
}

html[data-theme='light'] body {
  background:
    radial-gradient(1200px 600px at 8% -18%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(900px 520px at 92% -6%, rgba(236, 72, 153, 0.18), transparent 65%),
    linear-gradient(180deg, var(--bg), var(--bg-secondary) 60%, #ffffff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1180px, 100% - 48px);
  margin: 0 auto;
}

.topbar, .navbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 28px;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(8, 3, 25, 0.28);
}

html[data-theme='light'] .topbar,
html[data-theme='light'] .navbar {
  background: color-mix(in srgb, var(--surface) 82%, rgba(246, 247, 252, 0.92));
  box-shadow: 0 18px 36px rgba(25, 30, 60, 0.14);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}

.brand-mark, .brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: conic-gradient(from 160deg, #6366f1, #a855f7, #ec4899, #6366f1);
  box-shadow: 0 16px 30px rgba(99, 102, 241, 0.38);
  display: inline-block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 500;
  color: inherit;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(8, 3, 25, 0.25);
}

html[data-theme='light'] .nav-link:hover {
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 10px 20px rgba(25, 30, 60, 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  background: var(--accent-gradient);
  color: #05030c;
  box-shadow: 0 24px 48px rgba(99, 102, 241, 0.38);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 32px 58px rgba(236, 72, 153, 0.36);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.35);
}

.btn-outline, .btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: inherit;
  box-shadow: none;
}

html[data-theme='light'] .btn-outline,
html[data-theme='light'] .btn.ghost {
  border-color: rgba(17, 19, 37, 0.14);
}

.btn-outline:hover, .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme='light'] .btn-outline:hover,
html[data-theme='light'] .btn.ghost:hover {
  background: rgba(99, 102, 241, 0.12);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

html[data-theme='light'] .btn.secondary {
  background: rgba(99, 102, 241, 0.1);
  color: #111325;
  border-color: rgba(99, 102, 241, 0.3);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-md);
}

html[data-theme='light'] .card {
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.table th,
.table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table th {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table tr:hover td {
  background: rgba(99, 102, 241, 0.1);
}

html[data-theme='light'] .table tr:hover td {
  background: rgba(99, 102, 241, 0.15);
}

label {
  display: block;
  margin: 14px 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='file'],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--accent-2) 70%, white 30%);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.22);
}

.notice {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px dashed var(--border);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.04);
}

.badge, .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  font-size: 0.78rem;
  font-weight: 500;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-wrap {
  min-height: calc(100vh - 200px);
  display: grid;
  place-items: center;
  padding: 80px 18px 120px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 32px;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.auth-brand .logo {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: conic-gradient(from 150deg, #6366f1, #a855f7, #ec4899, #6366f1);
  color: #080314;
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: 120px;
  padding: 32px 0 46px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 18px;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: inherit;
  font-size: 0.85rem;
}

.theme-switch input { display: none; }

.theme-switch .track {
  position: relative;
  width: 48px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background 0.3s ease;
}

html[data-theme='light'] .theme-switch .track {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.4);
}

.theme-switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease;
}

.theme-switch input:checked + .track .thumb {
  transform: translateX(22px);
}

.theme-switch .icons {
  opacity: 0.68;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.sep {
  height: 1px;
  background: var(--border);
  margin: 22px 0;
}

.alert {
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(236, 72, 153, 0.18);
  border: 1px solid rgba(236, 72, 153, 0.35);
  color: #ffe4f3;
}

html[data-theme='light'] .alert {
  background: rgba(236, 72, 153, 0.15);
  color: #8f1346;
  border-color: rgba(236, 72, 153, 0.32);
}

.table-actions {
  display: flex;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(99, 102, 241, 0.18);
}

html[data-theme='light'] .status-pill {
  border-color: rgba(99, 102, 241, 0.22);
  background: rgba(99, 102, 241, 0.15);
  color: #111325;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 18, 0.65);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  z-index: 120;
}

.modal {
  width: min(520px, calc(100% - 32px));
  border-radius: 28px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 900px) {
  .topbar, .navbar {
    flex-wrap: wrap;
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .container { width: min(100%, 100% - 28px); }
  .nav { gap: 10px; }
  .nav-link { padding: 8px 14px; }
  .btn { padding: 11px 20px; }
  .auth-card { padding: 26px; border-radius: 22px; }
}
