/* Aquard Cloud — müşteri paneli (aquard.com.tr ile uyumlu görsel dil) */

:root {
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --bg-deep: #071423;
  --bg-mid: #0c1929;
  --surface: #122a3d;
  --surface-2: #163447;
  --text: #f0f4f8;
  --text-muted: #8ba3b8;
  --aquard-teal: #14b8a6;
  --aquard-teal-dim: rgba(20, 184, 166, 0.14);
  --aquard-sky: #38bdf8;
  --aquard-sky-dim: rgba(56, 189, 248, 0.12);
  --border: rgba(148, 163, 184, 0.18);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.14);
  --warn: #fbbf24;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --transition: 0.18s ease;
  --roi-canvas-bg: #0c1929;
}

/* ——— Light theme ——— */
html[data-theme="light"] {
  --bg-deep: #f0f5f9;
  --bg-mid: #e2eaf2;
  --surface: #ffffff;
  --surface-2: #f1f6fa;
  --text: #0f172a;
  --text-muted: #64748b;
  --aquard-teal-dim: rgba(20, 184, 166, 0.12);
  --aquard-sky-dim: rgba(14, 165, 233, 0.1);
  --border: rgba(15, 23, 42, 0.1);
  --danger-bg: rgba(248, 113, 113, 0.14);
  --ok-bg: rgba(52, 211, 153, 0.12);
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  --roi-canvas-bg: #e2ecf4;
}

html[data-theme="light"] body.layout {
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 0% -20%, rgba(20, 184, 166, 0.08), transparent 50%),
    radial-gradient(ellipse 100% 60% at 100% 0%, rgba(56, 189, 248, 0.07), transparent 45%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(20, 184, 166, 0.05), transparent 50%);
}

html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.88);
}

@media (max-width: 768px) {
  html[data-theme="light"] .nav {
    background: rgba(255, 255, 255, 0.97);
  }
}

html[data-theme="light"] .glass-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(241, 246, 250, 0.9));
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .glass-card--accent {
  box-shadow:
    0 4px 28px rgba(20, 184, 166, 0.12),
    0 4px 24px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

html[data-theme="light"] .gradient-text {
  background: linear-gradient(120deg, #0f766e 0%, #0d9488 40%, #0369a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme="light"] .gradient-num {
  background: linear-gradient(135deg, #0d9488, #0284c7);
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme="light"] .table-wrap--glass {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(241, 246, 250, 0.85));
  border: 1px solid rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .form-control {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .form-control:focus {
  background: #fff;
}

html[data-theme="light"] .webgl-bg--static {
  background: radial-gradient(ellipse 70% 50% at 70% 20%, rgba(20, 184, 166, 0.06), transparent),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(56, 189, 248, 0.05), transparent);
}

html[data-theme="light"] .skip-link {
  color: #042f2e;
}

html[data-theme="light"] .nav-link:hover {
  background: rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .site-footer {
  background: rgba(255, 255, 255, 0.94);
  border-top-color: var(--border);
}

/* Brand logo (navy PNG — invert on dark theme for contrast) */
.aquard-logo {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
}
.aquard-logo--header {
  height: 34px;
  max-width: 152px;
}
.aquard-logo--login {
  height: clamp(48px, 12vw, 64px);
  max-width: min(260px, 88vw);
  margin: 0 auto;
}
.aquard-logo--footer {
  height: 22px;
  max-width: 104px;
  opacity: 0.92;
}
html[data-theme="dark"] .aquard-logo {
  filter: brightness(0) invert(1);
}
.footer-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 6px;
  outline-offset: 3px;
}
.footer-logo-link:hover {
  opacity: 1;
}
.footer-logo-link .aquard-logo {
  opacity: 1;
}

/* Theme / language toolbar */
.topbar-util {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Checkbox off flex row (still toggles menu via label) */
.topbar-inner > #nav-toggle {
  flex: 0 0 0;
  width: 0 !important;
  min-width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  overflow: hidden !important;
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .theme-switcher {
  background: rgba(15, 23, 42, 0.04);
}

.theme-switcher__btn {
  margin: 0;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  transition: color var(--transition), background var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-switcher__btn:hover {
  color: var(--text);
}

.theme-switcher__btn.is-active {
  color: var(--text);
  background: var(--aquard-teal-dim);
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.35);
}

.theme-switcher__icon {
  font-size: 0.85rem;
  line-height: 1;
  margin-right: 0.2rem;
}
.theme-switcher__text {
  font-size: 0.68rem;
}
@media (max-width: 420px) {
  .theme-switcher__text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .theme-switcher__icon {
    margin-right: 0;
  }
  .theme-switcher__btn {
    padding: 0.45rem 0.5rem;
  }
}

.lang-form {
  margin: 0;
}

.lang-form__select {
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
  color: var(--text);
  cursor: pointer;
}

html[data-theme="light"] .lang-form__select {
  background: rgba(255, 255, 255, 0.95);
}

@media (max-width: 768px) {
  .topbar-inner {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

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

html { scroll-behavior: smooth; }

body.layout {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 0% -20%, rgba(20, 184, 166, 0.12), transparent 50%),
    radial-gradient(ellipse 100% 60% at 100% 0%, rgba(56, 189, 248, 0.1), transparent 45%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(20, 184, 166, 0.06), transparent 50%);
}

body.layout.login-page .main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 1.25rem 2.5rem;
}
.login-shell {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--aquard-teal);
  color: var(--bg-deep);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Top bar ——— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 25, 41, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  padding: 0.15rem 0;
  border-radius: 8px;
  outline-offset: 3px;
  transition: opacity var(--transition), transform var(--transition);
}
.brand:hover {
  opacity: 0.92;
}
.brand:active {
  transform: scale(0.98);
}
.brand .aquard-logo {
  display: block;
}

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.nav-burger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-burger:focus-visible {
  outline: 2px solid var(--aquard-teal);
  outline-offset: 2px;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}

.nav-link {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.nav-link.is-active {
  color: #042f2e;
  background: linear-gradient(135deg, var(--aquard-teal), #2dd4bf);
  font-weight: 600;
}
.nav-link--admin {
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.nav-link--admin:hover {
  border-color: var(--aquard-sky);
  color: var(--aquard-sky);
}

.nav-logout {
  margin: 0;
  margin-left: 0.25rem;
}

@media (min-width: 769px) {
  .nav {
    display: flex !important;
    position: static !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  .nav-burger {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .topbar-inner > .brand {
    order: 1;
  }
  .topbar-inner > .topbar-util {
    order: 2;
    margin-left: auto;
  }
  .topbar-inner > .nav {
    order: 10;
    flex: 1 1 100%;
  }

  .nav-burger {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem 1.25rem 1.15rem;
    background: rgba(12, 25, 41, 0.97);
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  }

  #nav-toggle:checked ~ .nav {
    display: flex;
  }

  .nav-link {
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
  }

  .nav-logout {
    margin-left: 0;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
  }
  .nav-logout .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ——— Main ——— */
.main {
  flex: 1;
  padding: 1.75rem 1.25rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  margin-bottom: 1.75rem;
}
.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.page-header .lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 42rem;
}

/* ——— Messages ——— */
.messages-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.messages {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}
.msg {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.msg-success {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.msg-error, .msg-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
}
.msg-warning { background: rgba(251, 191, 36, 0.12); color: var(--warn); }

/* ——— Layout helpers ——— */
.stack { display: flex; flex-direction: column; gap: 1.25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
}
.card h2, .card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card h2 .card-icon, .card h3 .card-icon { opacity: 0.9; }

.card.narrow { max-width: 420px; margin: 0 auto; width: 100%; }
.card--lift:hover {
  border-color: rgba(20, 184, 166, 0.35);
  transition: border-color var(--transition);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.row.gap { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }

/* ——— Stat cards (dashboard) ——— */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--aquard-teal), var(--aquard-sky));
  opacity: 0.85;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stat-card .stat-meta { margin-top: 0.65rem; }

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  transition: background var(--transition), border-color var(--transition), transform 0.12s ease;
}
.btn:hover {
  background: #1a3d52;
  border-color: rgba(148, 163, 184, 0.28);
}
.btn:focus-visible {
  outline: 2px solid var(--aquard-teal);
  outline-offset: 2px;
}
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: linear-gradient(135deg, var(--aquard-teal), #0d9488);
  border-color: transparent;
  color: #042f2e;
  box-shadow: 0 2px 16px rgba(20, 184, 166, 0.28);
}
.btn.primary:hover {
  filter: brightness(1.06);
  border-color: transparent;
}
.btn.danger {
  background: rgba(127, 29, 29, 0.45);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}
.btn.danger:hover { background: rgba(153, 27, 27, 0.55); }
.btn.small { font-size: 0.8rem; padding: 0.35rem 0.65rem; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.link-text {
  color: var(--aquard-sky);
  font-weight: 600;
  text-decoration: none;
}
.link-text:hover { text-decoration: underline; }

/* ——— Forms (legacy sayfalar) ——— */
form:not(.form-modern) label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}
label.form-switch {
  display: block;
  margin: 0;
  padding: 0;
}
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-mid);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--aquard-teal);
  box-shadow: 0 0 0 3px var(--aquard-teal-dim);
}

.list { padding-left: 1.25rem; margin: 0.5rem 0; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.pad { padding: 1rem 0; }
.pad + .pad { border-top: 1px solid var(--border); }

/* Camera list */
.camera-rows { padding: 0; }
.camera-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.camera-row:last-child { border-bottom: none; }

.code {
  background: var(--bg-mid);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  line-height: 1.45;
}
.code-inline {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85em;
  background: var(--aquard-sky-dim);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}

.canvas-wrap {
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 640px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.roi-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  vertical-align: middle;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(20, 184, 166, 0.04); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 0.35rem;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.muted { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.badge.info { background: var(--aquard-sky-dim); color: var(--aquard-sky); }

/* Login */
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.25rem 2rem 1.85rem;
}
.login-card-header {
  text-align: center;
  margin-bottom: 1.65rem;
}
.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.85rem;
}
.login-card .login-sub {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 20rem;
  margin-left: auto;
  margin-right: auto;
}
.login-foot {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 1rem 1.25rem 1.35rem;
  border-top: 1px solid var(--border);
  background: rgba(7, 20, 35, 0.85);
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  font-size: 0.82rem;
}
.footer-brand { font-weight: 700; color: var(--aquard-teal); }
.footer-sep { color: var(--text-muted); opacity: 0.5; }
.site-footer a {
  color: var(--aquard-sky);
  font-weight: 600;
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }
.footer-tagline { color: var(--text-muted); }

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

.btn-block { width: 100%; justify-content: center; }

.alert-feed {
  list-style: none;
  padding: 0;
  margin: 0;
}
.alert-feed li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.alert-feed li:last-child { border-bottom: none; }
.alert-feed time, .alert-feed .muted { font-size: 0.82rem; }

/* ——— WebGL arka plan (Three.js) ——— */
.webgl-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.webgl-bg canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.layout--has-webgl .topbar,
.layout--has-webgl .messages-wrap,
.layout--has-webgl .main,
.layout--has-webgl .site-footer {
  position: relative;
  z-index: 1;
}
.layout--has-webgl .topbar { z-index: 100; }

.webgl-bg--static {
  background: radial-gradient(ellipse 70% 50% at 70% 20%, rgba(20, 184, 166, 0.07), transparent),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(56, 189, 248, 0.06), transparent);
}

/* ——— Cam glass / bento dashboard ——— */
.glass-card {
  background: linear-gradient(
    145deg,
    rgba(18, 42, 61, 0.82),
    rgba(12, 25, 41, 0.72)
  );
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.glass-card--narrow {
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

.glass-card--accent {
  border-color: rgba(20, 184, 166, 0.35);
  box-shadow:
    0 4px 28px rgba(20, 184, 166, 0.08),
    0 4px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.glass-card--wide { padding: 1.5rem 1.6rem; }

.gradient-text {
  background: linear-gradient(120deg, #f0f4f8 0%, #5eead4 45%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.gradient-num {
  background: linear-gradient(135deg, #5eead4, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.dashboard-bento { gap: 1.25rem; }

.dashboard-hero { margin-bottom: 0; }

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--aquard-teal);
}

.dashboard-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 4.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.hero-lead {
  margin: 0 0 1.25rem;
  max-width: 36rem;
  font-size: 0.98rem;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.quick-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: background var(--transition), border-color var(--transition), transform 0.15s ease;
}
.quick-action:hover {
  background: rgba(20, 184, 166, 0.15);
  border-color: rgba(20, 184, 166, 0.4);
  color: var(--text);
}
.qa-ic { opacity: 0.85; font-size: 0.9rem; }

.bento-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.stat-tile { min-height: 180px; display: flex; flex-direction: column; }

.stat-tile-icon {
  font-size: 1.25rem;
  opacity: 0.65;
  margin-bottom: 0.35rem;
  color: var(--aquard-teal);
}
.stat-tile-icon--sky { color: var(--aquard-sky); }

.stat-value-lg {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0.25rem 0;
  line-height: 1.2;
}
.stat-value-lg--empty {
  font-size: 1.2rem;
  font-weight: 700;
  opacity: 0.7;
}

.btn-sm-tight {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 0.45rem;
}

.card-head { margin-bottom: 1rem; align-items: center; }
.card-title-flex {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
}
@media (prefers-reduced-motion: no-preference) {
  .pulse-dot {
    animation: pulse-dot 2.2s ease-in-out infinite;
  }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.92); }
}

.alert-feed--modern { margin: 0; padding: 0; }
.alert-row-item {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) 2fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  align-items: start;
}
.alert-row-item:last-child { border-bottom: none; }
.alert-time { font-size: 0.8rem; color: var(--text-muted); }
.alert-type-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  color: var(--aquard-sky);
}
.empty-hint { margin: 0.5rem 0 0; }

@media (max-width: 520px) {
  .alert-row-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

.glass-card h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-wrap--glass {
  background: linear-gradient(145deg, rgba(18, 42, 61, 0.75), rgba(12, 25, 41, 0.55));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.table-wrap--glass .table {
  background: transparent;
}

/* ——— Modern formlar ——— */
.form-modern { display: flex; flex-direction: column; gap: 1.15rem; }
.form-modern--tight { gap: 1rem; }

.form-section .section-title {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
}
.section-icon { opacity: 0.85; }

.form-field { margin: 0; }
.form-field.is-invalid .form-control {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.2);
}

.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.form-label-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.form-hint {
  margin: -0.1rem 0 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.form-hint--tight { margin: 0.25rem 0 0; }

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(7, 20, 35, 0.55);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition), background 0.15s ease;
}
.form-control:hover {
  border-color: rgba(20, 184, 166, 0.25);
}
.form-control:focus {
  outline: none;
  border-color: var(--aquard-teal);
  box-shadow: 0 0 0 3px var(--aquard-teal-dim);
  background: rgba(7, 20, 35, 0.75);
}

textarea.form-control,
.form-control--textarea {
  min-height: 5rem;
  resize: vertical;
  line-height: 1.5;
}

.form-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--danger);
}

.form-banner {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
}
.form-banner--error {
  background: var(--danger-bg);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fecaca;
}
.form-banner p { margin: 0; }

.form-submit {
  margin-top: 0.35rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.95rem;
  border-radius: 10px;
}

.form-inline-actions { margin-top: 1rem; }

/* Toggle switch */
.form-switch-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.form-switch {
  position: relative;
  width: 3.1rem;
  height: 1.75rem;
  flex-shrink: 0;
  margin: 0.15rem 0 0;
  cursor: pointer;
}
.form-switch .form-checkbox-input,
.form-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.form-switch-ui {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: background 0.22s ease, border-color 0.22s ease;
  pointer-events: none;
}
.form-switch-ui::after {
  content: "";
  position: absolute;
  width: 1.28rem;
  height: 1.28rem;
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  border-radius: 50%;
  top: 0.2rem;
  left: 0.22rem;
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.form-switch input:checked + .form-switch-ui {
  background: linear-gradient(135deg, var(--aquard-teal), #0d9488);
  border-color: rgba(20, 184, 166, 0.5);
}
.form-switch input:checked + .form-switch-ui::after {
  transform: translateX(1.32rem);
}
.form-switch input:focus-visible + .form-switch-ui {
  outline: 2px solid var(--aquard-teal);
  outline-offset: 2px;
}
.form-switch-meta { flex: 1; min-width: 0; }

.settings-stack { position: relative; z-index: 1; }

.code-glass {
  background: rgba(7, 20, 35, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

/* Login glass */
.login-card.glass-card {
  padding: 2.35rem 2.15rem 1.9rem;
  border-radius: 18px;
}
html[data-theme="light"] .login-card.glass-card {
  box-shadow:
    0 4px 28px rgba(15, 23, 42, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

/* Alerts: filters + snapshot thumbs */
.alert-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}
.alert-thumb {
  display: block;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  max-height: 48px;
}
.alert-thumb-link {
  display: inline-block;
  line-height: 0;
}
.pagination-nav {
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ROI editor */
.roi-canvas-wrap .roi-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
.roi-region-row {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.roi-region-row:last-child {
  border-bottom: none;
}
.input-text--sm,
.input-select--sm {
  font-size: 0.875rem;
  padding: 0.35rem 0.5rem;
}
