/* Trellis admin portal — self-contained CSS, no CDN.
 *
 * Visual language mirrors daisy-gateway/auth/admin_templates.py: dark slate
 * gradient, glass-morphism card, blue accent. Served from the Trellis origin
 * so it doesn't depend on third-party CORS / SRI headers.
 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.5;
}

a { color: #60a5fa; text-decoration: none; }
a:hover { color: #93c5fd; text-decoration: underline; }

/* ── Login + reset shell ───────────────────────────────────────────── */
body.auth-shell { display: flex; align-items: center; justify-content: center; }

.auth-shell .card {
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148,163,184,0.15);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  width: 100%;
  max-width: 420px;
}

.logo { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 0.5rem; color: #60a5fa; }
.subtitle { text-align: center; color: #94a3b8; margin-bottom: 1.5rem; font-size: 0.9rem; }

/* ── Forms ─────────────────────────────────────────────────────────── */
label { display: block; margin-bottom: 0.3rem; font-size: 0.85rem; color: #94a3b8; font-weight: 500; }
input[type="email"], input[type="password"], input[type="text"], input[type="search"] {
  width: 100%; padding: 0.75rem 1rem; border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.2);
  background: rgba(15,23,42,0.6); color: #f1f5f9;
  font-size: 1rem; margin-bottom: 1rem; outline: none;
}
input:focus { border-color: #60a5fa; }

.btn {
  display: inline-block;
  padding: 0.8rem 1.2rem; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white; font-size: 1rem; font-weight: 600; cursor: pointer;
  text-decoration: none; text-align: center;
}
.btn:hover { opacity: 0.9; text-decoration: none; color: white; }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent; color: #cbd5e1;
  border: 1px solid rgba(148,163,184,0.2);
}
.btn-ghost:hover { background: rgba(148,163,184,0.1); color: #f1f5f9; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
.btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); }

/* ── Alerts ────────────────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.85rem;
}
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #4ade80; }
.alert-info { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

.back-link {
  display: block; text-align: center; margin-top: 1.25rem;
  color: #94a3b8; font-size: 0.85rem; text-decoration: none;
}
.back-link:hover { color: #60a5fa; text-decoration: none; }

.aux-link {
  display: block; text-align: center; margin-top: 1.25rem;
  color: #94a3b8; font-size: 0.85rem; text-decoration: none;
}
.aux-link:hover { color: #60a5fa; }

/* ── Top nav + shell ───────────────────────────────────────────────── */
.nav {
  background: rgba(15,23,42,0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(148,163,184,0.1);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0.75rem 1.25rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.nav-brand { font-weight: 700; font-size: 1.05rem; color: #60a5fa; }
.nav-links { display: flex; gap: 1rem; }
.nav-links a { color: #cbd5e1; font-size: 0.9rem; }
.nav-links a:hover { color: #f1f5f9; text-decoration: none; }
.nav-links a.active { color: #60a5fa; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; color: #94a3b8; }
.tenant-badge {
  padding: 0.15rem 0.5rem; border-radius: 999px;
  background: rgba(148,163,184,0.15); color: #cbd5e1; font-size: 0.75rem;
}

.shell { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem; }

/* ── Cards + stats ─────────────────────────────────────────────────── */
.card-section {
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(148,163,184,0.1);
  border-radius: 12px; padding: 1.5rem; margin-bottom: 1rem;
}
.card-title { font-size: 1rem; font-weight: 600; color: #f1f5f9; margin-bottom: 1rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(148,163,184,0.1);
  border-radius: 12px; padding: 1.25rem;
}
.stat-value { font-size: 1.75rem; font-weight: 700; color: #60a5fa; line-height: 1; }
.stat-label { color: #94a3b8; font-size: 0.85rem; margin-top: 0.3rem; }

/* ── Tables ────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
thead th {
  background: rgba(15,23,42,0.6); text-align: left;
  padding: 0.6rem 0.9rem; font-size: 0.8rem; color: #94a3b8;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(148,163,184,0.1);
}
tbody td {
  padding: 0.7rem 0.9rem; font-size: 0.9rem;
  border-bottom: 1px solid rgba(148,163,184,0.08);
  color: #e2e8f0;
}
tbody tr:hover { background: rgba(59,130,246,0.05); }

/* ── Badges ────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 0.15rem 0.55rem;
  border-radius: 999px; font-size: 0.72rem; font-weight: 600;
}
.badge-blue { background: rgba(59,130,246,0.2); color: #93c5fd; }
.badge-green { background: rgba(34,197,94,0.2); color: #86efac; }
.badge-yellow { background: rgba(234,179,8,0.2); color: #fde047; }
.badge-red { background: rgba(239,68,68,0.2); color: #fca5a5; }
.badge-gray { background: rgba(148,163,184,0.2); color: #cbd5e1; }

.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.85rem; }
.text-muted { color: #94a3b8; }

/* ── Layout helpers ────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 2rem; }

h1 { font-size: 1.5rem; font-weight: 700; color: #f1f5f9; margin-bottom: 1rem; }
h2 { font-size: 1.2rem; font-weight: 600; color: #f1f5f9; margin-bottom: 0.75rem; }
