/* OrbitEye Cloud — Admin Console
   Dark industrial, mint-on-black brand accent. Semantic color rule (strict, never decorative):
   green/mint = pass/OK/active; red = fail/NG/destructive. All other chrome (nav, borders, focus
   rings, primary buttons) uses the brand mint as a neutral accent, consistent with the existing
   OrbitEye desktop app's signature look. */

:root {
  --oe-bg: #090c0b;
  --oe-surface: #101512;
  --oe-surface-raised: #161d19;
  --oe-border: #223028;
  --oe-border-soft: #1a2420;

  --oe-mint: #2fe6a4;
  --oe-mint-strong: #4dffc0;
  --oe-mint-dim: #1c8f68;
  --oe-mint-soft: rgba(47, 230, 164, 0.12);
  --oe-mint-soft-strong: rgba(47, 230, 164, 0.22);

  --oe-red: #ff5c5c;
  --oe-red-strong: #ff8080;
  --oe-red-soft: rgba(255, 92, 92, 0.14);
  --oe-red-soft-strong: rgba(255, 92, 92, 0.24);

  --oe-amber: #e8b64a;
  --oe-amber-soft: rgba(232, 182, 74, 0.14);

  --oe-text: #e9f5f0;
  --oe-text-dim: #93a8a0;
  --oe-text-faint: #5f7369;

  --oe-focus-ring: 0 0 0 3px rgba(47, 230, 164, 0.35);
  --oe-radius: 10px;
  --oe-radius-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--oe-bg);
  color: var(--oe-text);
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

a { color: var(--oe-mint); }

h1, h2, h3 { font-weight: 600; letter-spacing: 0.2px; }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }

.oe-text-dim { color: var(--oe-text-dim); }
.oe-text-faint { color: var(--oe-text-faint); font-size: 0.85rem; }

/* --- shell layout ------------------------------------------------------------------------- */

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

.oe-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--oe-surface);
  border-right: 1px solid var(--oe-border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
}

.oe-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 20px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--oe-mint-strong);
  border-bottom: 1px solid var(--oe-border-soft);
  margin-bottom: 16px;
}

.oe-brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--oe-mint);
  box-shadow: 0 0 8px var(--oe-mint);
}

.oe-nav { display: flex; flex-direction: column; gap: 2px; }

.oe-nav-link {
  display: block;
  padding: 9px 12px;
  border-radius: var(--oe-radius);
  color: var(--oe-text-dim);
  text-decoration: none;
  font-weight: 500;
}

.oe-nav-link:hover { background: var(--oe-surface-raised); color: var(--oe-text); }

.oe-nav-link.active {
  background: var(--oe-mint-soft);
  color: var(--oe-mint-strong);
}

.oe-sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--oe-border-soft);
}

.oe-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.oe-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--oe-border);
  background: var(--oe-surface);
}

.oe-topbar-user {
  font-size: 0.9rem;
  color: var(--oe-text-dim);
}

.oe-topbar-user strong { color: var(--oe-text); }

.oe-content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
}

/* --- panels / cards ------------------------------------------------------------------------ */

.oe-panel {
  background: var(--oe-surface);
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius);
  padding: 20px;
  margin-bottom: 20px;
}

.oe-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.oe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.oe-stat {
  background: var(--oe-surface-raised);
  border: 1px solid var(--oe-border-soft);
  border-radius: var(--oe-radius);
  padding: 14px 16px;
}

.oe-stat .oe-stat-label { color: var(--oe-text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.4px; }
.oe-stat .oe-stat-value { font-size: 1.4rem; font-weight: 700; margin-top: 4px; }

/* --- tables ---------------------------------------------------------------------------------- */

.oe-table-wrap { overflow-x: auto; }

table.oe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.oe-table th {
  text-align: left;
  color: var(--oe-text-dim);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--oe-border);
}

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

.oe-table tr:last-child td { border-bottom: none; }
.oe-table tr:hover td { background: var(--oe-surface-raised); }

/* --- badges (STRICT semantic color: green=pass/active, red=fail/destructive, amber=warn) --- */

.oe-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--oe-radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.oe-badge-ok { background: var(--oe-mint-soft); color: var(--oe-mint-strong); }
.oe-badge-ng { background: var(--oe-red-soft); color: var(--oe-red-strong); }
.oe-badge-warn { background: var(--oe-amber-soft); color: var(--oe-amber); }
.oe-badge-neutral { background: var(--oe-surface-raised); color: var(--oe-text-dim); border: 1px solid var(--oe-border); }

.oe-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.oe-dot-ok { background: var(--oe-mint); box-shadow: 0 0 6px var(--oe-mint); }
.oe-dot-warn { background: var(--oe-amber); }
.oe-dot-off { background: var(--oe-text-faint); }

/* --- buttons ---------------------------------------------------------------------------------- */

.oe-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--oe-radius-pill);
  border: 1px solid var(--oe-border);
  background: var(--oe-surface-raised);
  color: var(--oe-text);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.oe-btn:hover { border-color: var(--oe-mint-dim); }
.oe-btn:focus-visible { outline: none; box-shadow: var(--oe-focus-ring); }
.oe-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.oe-btn-primary {
  background: var(--oe-mint);
  border-color: var(--oe-mint);
  color: #06140f;
}
.oe-btn-primary:hover { background: var(--oe-mint-strong); border-color: var(--oe-mint-strong); }

.oe-btn-danger {
  background: transparent;
  border-color: var(--oe-red);
  color: var(--oe-red-strong);
}
.oe-btn-danger:hover { background: var(--oe-red-soft); }

.oe-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--oe-text-dim);
}
.oe-btn-ghost:hover { color: var(--oe-text); background: var(--oe-surface-raised); }

.oe-btn-sm { padding: 5px 12px; font-size: 0.8rem; }

.oe-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- forms: mint-on-black pill inputs/selects (never dark-on-dark) --------------------------- */

.oe-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.oe-field label { font-size: 0.8rem; color: var(--oe-text-dim); font-weight: 600; }

.oe-input, .oe-select {
  background: #04100b;
  border: 1px solid var(--oe-mint-dim);
  color: var(--oe-mint-strong);
  padding: 9px 14px;
  border-radius: var(--oe-radius-pill);
  font-size: 0.9rem;
  font-family: inherit;
}

.oe-input::placeholder { color: var(--oe-text-faint); }

.oe-input:focus, .oe-select:focus {
  outline: none;
  border-color: var(--oe-mint);
  box-shadow: var(--oe-focus-ring);
}

.oe-select { appearance: none; padding-right: 30px; cursor: pointer; }

.oe-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 16px;
  align-items: end;
}

/* --- banners (inline, no popups) -------------------------------------------------------------- */

.oe-banner {
  border-radius: var(--oe-radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.oe-banner-success { background: var(--oe-mint-soft); border: 1px solid var(--oe-mint-dim); color: var(--oe-mint-strong); }
.oe-banner-error { background: var(--oe-red-soft); border: 1px solid var(--oe-red); color: var(--oe-red-strong); }
.oe-banner-info { background: var(--oe-surface-raised); border: 1px solid var(--oe-border); color: var(--oe-text-dim); }

/* --- inline confirm / reveal overlay (never a browser dialog) -------------------------------- */

.oe-overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 7, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.oe-overlay-card {
  background: var(--oe-surface-raised);
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius);
  padding: 22px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.oe-overlay-card.oe-overlay-danger { border-color: var(--oe-red); }
.oe-overlay-card.oe-overlay-danger h3 { color: var(--oe-red-strong); }

.oe-overlay-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* --- key reveal (once-only) -------------------------------------------------------------------- */

.oe-key-reveal {
  background: #04100b;
  border: 1px solid var(--oe-mint);
  border-radius: var(--oe-radius);
  padding: 16px;
  margin-top: 12px;
}

.oe-key-value {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.95rem;
  color: var(--oe-mint-strong);
  word-break: break-all;
  background: #071a13;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 8px 0 12px;
  user-select: all;
}

/* --- login page --------------------------------------------------------------------------- */

.oe-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #0d1a15 0%, var(--oe-bg) 60%);
}

.oe-login-card {
  width: 360px;
  background: var(--oe-surface);
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius);
  padding: 32px 28px;
}

.oe-login-title {
  text-align: center;
  color: var(--oe-mint-strong);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.oe-login-subtitle {
  text-align: center;
  color: var(--oe-text-dim);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

/* --- responsive ------------------------------------------------------------------------------- */

@media (max-width: 780px) {
  .oe-shell { flex-direction: column; }
  .oe-sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    overflow-x: auto;
  }
  .oe-brand { border-bottom: none; margin-bottom: 0; padding: 0 12px 0 0; }
  .oe-nav { flex-direction: row; }
  .oe-sidebar-footer { display: none; }
  .oe-content { padding: 16px; }
}
