/* ============================================================
   style.css  –  Shared dark-scientific theme
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:        #080c10;
  --surface:   #0d1117;
  --surface2:  #161b22;
  --surface3:  #21262d;
  --border:    #30363d;
  --border2:   #3d444d;
  --text:      #e6edf3;
  --text-muted:#768390;
  --accent:    #14b8a6;
  --accent2:   #0d9488;
  --accent-glow: rgba(20,184,166,.25);
  --red:       #ef4444;
  --green:     #22c55e;
  --yellow:    #eab308;
  --mono:      'Space Mono', monospace;
  --sans:      'DM Sans', system-ui, sans-serif;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,.5);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Links ── */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Inputs ── */
input, select, textarea {
  font-family: var(--sans);
  font-size: .9375rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: .65rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder { color: var(--text-muted); }

/* ── Buttons ── */
.btn {
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 500;
  padding: .65rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: background .2s, transform .1s, box-shadow .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: var(--accent2); box-shadow: 0 0 20px var(--accent-glow); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }

.btn-danger {
  background: rgba(239,68,68,.15);
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-danger:hover { background: rgba(239,68,68,.25); }

.btn-success {
  background: rgba(34,197,94,.15);
  color: var(--green);
  border: 1px solid var(--green);
}
.btn-success:hover { background: rgba(34,197,94,.25); }

.btn-sm {
  font-size: .8125rem;
  padding: .4rem .9rem;
}
.btn-full { width: 100%; justify-content: center; }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

/* ── Form group ── */
.form-group { display: flex; flex-direction: column; gap: .5rem; }
.form-group label { font-size: .875rem; color: var(--text-muted); font-weight: 500; }

/* ── Badge ── */
.badge {
  font-family: var(--mono);
  font-size: .7rem;
  padding: .2rem .6rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.badge-active  { background: rgba(34,197,94,.12);  color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.badge-inactive{ background: rgba(239,68,68,.12);  color: var(--red);   border: 1px solid rgba(239,68,68,.3); }
.badge-admin   { background: rgba(20,184,166,.12); color: var(--accent);border: 1px solid rgba(20,184,166,.3); }
.badge-user    { background: rgba(118,131,144,.12);color: var(--text-muted);border: 1px solid var(--border); }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.page-header .logo {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: .05em;
  font-weight: 700;
}
.page-header .user-info {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .875rem;
  color: var(--text-muted);
}

/* ── Page wrapper ── */
.page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.data-table th {
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--surface2); }

/* ── Section title ── */
.section-title {
  font-family: var(--mono);
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

/* ── Loading overlay ── */
#page-loader {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  transition: opacity .4s;
}
#page-loader.hidden { opacity: 0; pointer-events: none; }
#page-loader .loader-inner {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
#page-loader .loader-logo {
  font-family: var(--mono);
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: .1em;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .page-content { padding: 1rem; }
  .page-header { padding: .75rem 1rem; }
  .card { padding: 1.25rem; }
  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: .65rem .6rem; }
}
