:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #111827;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --danger: #b91c1c;
}

@font-face {
  font-family: 'GaugeFont';
  src: url('/fonts/gauge-c.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100%;
}

.sidebar {
  background: var(--panel-2);
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}
.brand h1 {
  margin: 0;
  font-size: 20px;
}
.brand p {
  margin: 6px 0 0;
  color: #cbd5e1;
  font-size: 13px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 0 10px;
}

.nav-link {
  border: 1px solid transparent;
  color: #e5e7eb;
  padding: 12px 14px;
  border-radius: 12px;
  transition: 0.15s ease;
}

.nav-link:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.06);
}

.nav-link.active {
  background: rgba(37,99,235,0.22);
  border-color: rgba(96,165,250,0.45);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

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

.topbar {
  height: 72px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h2 {
  margin: 0;
  font-size: 22px;
}
.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.content {
  padding: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

.grid {
  display: grid;
  gap: 18px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
}
.stat-label {
  color: var(--muted);
  font-size: 13px;
}
.stat-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
}

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

.tool-tile {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
}
.tool-tile:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}
.tool-tile h3 {
  margin: 0 0 8px;
}
.tool-tile p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.section-title {
  margin: 0 0 14px;
  font-size: 18px;
}

.placeholder-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.iframe-wrap {
  height: calc(100vh - 140px);
  min-height: 720px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}
.iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.page-head h3 {
  margin: 0;
  font-size: 22px;
}
.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid .full {
  grid-column: 1 / -1;
}
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.field textarea { min-height: 100px; resize: vertical; }
.form-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.code-block {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  overflow: auto;
  font-size: 13px;
}

.authScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f7fb;
  padding: 24px;
}

.authCard {
  width: 100%;
  max-width: 380px;
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.authCard h2 {
  margin: 0 0 8px 0;
}

.authCard label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #333;
}

.authCard input {
  border: 1px solid #d7dbe7;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.authButtons {
  display: flex;
  gap: 10px;
}

.authButtons button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.authMessage {
  font-size: 13px;
  color: #c62828;
  min-height: 18px;
}

.authHint {
  margin: -2px 0 4px 0;
  font-size: 13px;
  color: #5f6577;
}

.authMessageInfo {
  color: #4b5563;
}

@media (max-width: 960px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 20; }
  .grid.two, .grid.three, .form-grid { grid-template-columns: 1fr; }
  .iframe-wrap { height: 80vh; min-height: 520px; }
}

/* SIDE BAR CSS */
.mobile-menu-btn,
.mobile-close-btn {
  display: none;
}

@media (max-width: 920px) {
  .mobile-menu-btn {
    display: inline-flex;
    position: sticky;
    top: 10px;
    z-index: 1001;
    margin: 10px;
    border: 1px solid #334155;
    background: #0f172a;
    color: white;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
  }

  .mobile-close-btn {
    display: inline-flex;
    margin-bottom: 12px;
    border: 1px solid #334155;
    background: #0f172a;
    color: white;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 1000;
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }
}

