/* ── Shared base styles for all Tebiz Portal services ───────────────────── */
/* Served at /shared/base.css via Caddy (auth-service frontend mount)       */

/* ── Reset & Variables ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #1a1f2e;
  --bg-raised:    #222838;
  --bg-hover:     rgba(255,255,255,0.06);
  --bg-active:    rgba(255,255,255,0.10);
  --sidebar-bg:   #151a26;
  --border:       #2a3346;
  --border-mid:   #354055;
  --text-1:       #e2e8f0;
  --text-2:       #94a3b8;
  --text-3:       #64748b;
  --text-4:       #475569;
  --input-bg:     #1e2433;
  --accent:       #f0f4f8;
  --green:        #34d399;
  --red:          #f87171;
  --radius:       12px;
  --font:         'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Utilities ──────────────────────────────────────────────────────────── */
.hidden, [hidden] { display: none !important; }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-1); }

/* ── Messages ──────────────────────────────────────────────────────────── */
.error-msg {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  margin-bottom: 12px;
}

.success-msg {
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.3);
  color: var(--green);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  margin-bottom: 12px;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a4556; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4a5568; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn-primary {
  background: #3b82f6;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 20px;
  transition: background 0.15s;
}
.btn-primary:hover { background: #2563eb; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  padding: 10px 20px;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--text-3); color: var(--text-1); }

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--red);
  border-radius: 10px;
  color: var(--red);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 20px;
  transition: all 0.15s;
}
.btn-danger-outline:hover { background: var(--red); color: #fff; }

.btn-accent {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #151a26;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 20px;
  transition: background 0.15s;
}
.btn-accent:hover { background: #dde3eb; }

.btn-inline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-inline:hover { border-color: var(--text-2); color: var(--text-1); }
.btn-inline.danger { border-color: var(--red); color: var(--red); }
.btn-inline.danger:hover { background: var(--red); color: #fff; }

.btn-small { padding: 8px 16px; font-size: 0.8125rem; }

/* ── Error page ────────────────────────────────────────────────────────── */
#error-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.error-page {
  text-align: center;
  max-width: 400px;
  padding: 40px 24px;
}
.error-icon {
  color: var(--red);
  margin-bottom: 20px;
}
.error-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}
.error-message {
  font-size: 0.9375rem;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 24px;
}
.error-btn {
  display: inline-block;
  background: var(--accent);
  color: #151a26;
  text-decoration: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  transition: background 0.15s;
}
.error-btn:hover { background: #dde3eb; }

/* ── Confirm dialog ────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.confirm-box {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  padding: 24px 24px 16px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}
.confirm-icon { color: var(--text-3); margin-bottom: 12px; }
.confirm-title { font-size: 1.0625rem; font-weight: 600; margin-bottom: 8px; }
.confirm-message { font-size: 0.875rem; color: var(--text-2); line-height: 1.5; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 8px; justify-content: center; }

/* ── Badge ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 500;
  margin-left: 8px;
}
.badge-admin { background: rgba(52,211,153,0.15); color: var(--green); }
