﻿/* main.css */
:root {
  --bg: #0f172a;
  --bg-2: #111827;
  --card: #0b1220;
  --card-2: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --accent-2: #38bdf8;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --border: #1f2937;
  --shadow: rgba(2, 6, 23, 0.6);
  --radius: 14px;
  --font: "Space Grotesk", "Segoe UI", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(1200px 800px at 10% -10%, #0ea5e9 0%, transparent 60%),
              radial-gradient(1200px 800px at 110% 10%, #22c55e 0%, transparent 60%),
              var(--bg);
  color: var(--text);
  font-family: var(--font);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand > div:not(.logo) {
  display: none;
}

.logo {
  width: 140px;
  height: 140px;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  position: relative;
  overflow: hidden;
}

.logo::before {
  content: "";
  width: 100%;
  height: 100%;
  background-image: url("/web/assets/img/logo.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
}

.brand .logo,
.logo-wrap,
.brand .logo-wrap {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.logo img,
.brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  display: block;
}

.nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav a {
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
}

.nav a.active {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 20px 40px var(--shadow);
}

.category-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.category-card h3 {
  margin: 8px 0 6px 0;
}

.category-card p {
  color: var(--muted);
  margin: 0 0 12px 0;
}

.category-card .btn {
  width: fit-content;
}

.category-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(closest-side, rgba(34, 211, 238, 0.2), transparent);
  border-radius: 50%;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 50px var(--shadow);
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.btn {
  border: 1px solid var(--border);
  background: #111827;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #001018;
  border: none;
  font-weight: 700;
}

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

.btn.ghost {
  background: transparent;
}

.input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1020;
  color: var(--text);
}

.label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 13px;
}

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

.table th, .table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #0b1020;
  border: 1px solid var(--border);
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #111827;
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 30px var(--shadow);
  z-index: 1000;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  max-width: 420px;
  width: 92%;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #1f2937;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav { gap: 8px; }
  .logo { width: 104px; height: 104px; }
}

/* Global Light Theme Override */
:root {
  --bg: #f4f7fb;
  --bg-2: #eef3f9;
  --card: #ffffff;
  --card-2: #f8fbff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0ea5a1;
  --accent-2: #14b8a6;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --border: #dbe3ee;
  --shadow: rgba(15, 23, 42, 0.08);
}

html, body {
  background: radial-gradient(1100px 700px at 0% -10%, #e0f2fe 0%, transparent 58%),
              radial-gradient(1100px 700px at 100% 10%, #dcfce7 0%, transparent 58%),
              var(--bg) !important;
  color: var(--text) !important;
}

.header,
.card,
.modal,
.toast,
.nav a,
.badge,
.input,
select,
textarea,
.btn,
.table th,
.table td {
  border-color: var(--border) !important;
}

.card,
.modal,
.toast {
  background: linear-gradient(180deg, var(--card), var(--card-2)) !important;
  box-shadow: 0 14px 34px var(--shadow) !important;
}

.btn {
  background: #ffffff !important;
  color: var(--text) !important;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
  color: #ffffff !important;
}

.btn.ghost {
  background: #f8fbff !important;
}

.input, select, textarea {
  background: #ffffff !important;
  color: var(--text) !important;
}

.input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #7dd3c7 !important;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.label, .muted, .section-kicker {
  color: var(--muted) !important;
}

/* ── Mobile responsiveness ── */
@media (max-width: 768px) {
  /* Tables: allow horizontal scroll instead of overflowing */
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table th, .table td {
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .container { padding: 12px 14px; }
  .logo { width: 72px; height: 72px; }
  .header { flex-wrap: wrap; gap: 8px; }
  /* Inputs inside toolbars should not force full-width */
  .toolbar > .input,
  .toolbar > input {
    width: auto;
    min-width: 120px;
    flex: 1 1 120px;
  }
}
