/* Efaeto owner dashboard. Eclipse UI tokens, hand-written so the platform needs no build step. */

:root {
  color-scheme: dark;
  --ink: #0f172a;
  --card: #1e293b;
  --border: #334155;
  --input: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --gold: #d9a93e;
  --caramel: #c98a52;
  --emerald: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--ink);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* Login */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border);
  border-radius: 24px; padding: 36px 32px; box-shadow: 0 8px 32px rgba(0,0,0,.45);
}
.brand {
  font-size: 42px; font-weight: 900; letter-spacing: -.02em; text-align: center; margin-bottom: 6px;
  background: linear-gradient(90deg, var(--gold), var(--caramel));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 28px; }

label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 16px; margin-bottom: 16px;
  background: var(--input); border: 1px solid #475569; border-radius: 999px;
  color: var(--text); font-size: 15px; font-family: inherit;
}
textarea { border-radius: 16px; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(59,130,246,.35); }

.btn {
  min-height: 48px; width: 100%; border: none; border-radius: 999px; cursor: pointer;
  font-size: 16px; font-weight: 700; color: #fff; font-family: inherit;
  background: linear-gradient(90deg, var(--gold), var(--caramel));
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 36px; width: auto; padding: 0 14px; font-size: 13px; border-radius: 999px; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-danger { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; }
.btn-blue { background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.4); color: #93c5fd; }
.btn-green { background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.4); color: #6ee7b7; }

.error-msg { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #fca5a5;
  padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; }
.ok-msg { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.35); color: #6ee7b7;
  padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; }

/* Shell */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  padding: 14px 24px; background: rgba(15,23,42,.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-size: 26px; margin: 0; }
.tabs { display: flex; gap: 6px; margin-left: 12px; }
.tab {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: none; cursor: pointer;
  background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { background: rgba(217,169,62,.12); color: var(--gold); }
.spacer { flex: 1; }

main { padding: 24px; max-width: 1400px; margin: 0 auto; }

.section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
h2 { font-size: 22px; font-weight: 800; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--gold); transform: translateY(-2px); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 17px; font-weight: 800; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-green { background: rgba(16,185,129,.12); color: #6ee7b7; }
.pill-amber { background: rgba(245,158,11,.12); color: #fcd34d; }
.pill-red { background: rgba(239,68,68,.12); color: #fca5a5; }
.pill-gray { background: rgba(148,163,184,.12); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-green { background: var(--emerald); box-shadow: 0 0 8px rgba(16,185,129,.8); }
.dot-red { background: var(--red); }
.dot-gray { background: var(--muted); }

.rows { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.row { display: flex; justify-content: space-between; font-size: 13px; }
.row span:first-child { color: var(--muted); }
.row span:last-child { font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }

/* Errors */
.err-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 10px; }
.err-head { display: flex; align-items: center; gap: 12px; }
.err-title { font-weight: 700; font-size: 15px; flex: 1; word-break: break-word; }
.err-meta { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
pre { background: #0b1120; border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  overflow-x: auto; font-size: 12px; color: #cbd5e1; margin-top: 12px; line-height: 1.5; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(15,23,42,.7); backdrop-filter: blur(4px); padding: 24px; }
.modal { width: 100%; max-width: 480px; max-height: 90dvh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 24px; padding: 28px; }
.modal h3 { font-size: 20px; font-weight: 800; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }

.key-reveal {
  background: #0b1120; border: 2px dashed var(--gold); border-radius: 16px; padding: 20px;
  text-align: center; margin: 16px 0;
}
.key-reveal code { font-size: 20px; font-weight: 800; letter-spacing: .06em; color: var(--gold);
  word-break: break-all; font-family: ui-monospace, monospace; }
.key-warn { color: #fcd34d; font-size: 13px; margin-top: 12px; font-weight: 700; }

.qr { display: block; margin: 16px auto; border-radius: 12px; width: 200px; height: 200px; background: #fff; }
