@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ── tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface-2:    #1c2230;
  --border:       #21262d;
  --border-2:     #30363d;
  --text:         #e6edf3;
  --muted:        #8b949e;
  --accent:       #1fc07a;
  --accent-2:     #19a366;
  --accent-glow:  rgba(31,192,122,0.18);
  --accent-soft:  rgba(31,192,122,0.10);
  --red:          #f85149;
  --red-soft:     rgba(248,81,73,0.12);
  --blue:         #58a6ff;
  --blue-soft:    rgba(88,166,255,0.10);
  --gold:         #d29922;
  --gold-soft:    rgba(210,153,34,0.12);
  --radius:       8px;
  --radius-lg:    12px;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:         'IBM Plex Mono', 'Courier New', monospace;
}

/* ── reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
button { font-family: var(--font); cursor: pointer; }

/* ── scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

/* ════════════════════════════════════════════════════════════════ */
/*  LOGIN PAGE — full-page collage background                        */
/* ════════════════════════════════════════════════════════════════ */

/* Page root: center the card over the full-page bg */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060a0f;
}

/* ── Full-page blurred photo collage ────────────────────────────── */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.login-collage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 2fr 1.5fr 2fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "a a b"
    "c d e";
  gap: 0;
}

.collage-cell {
  overflow: hidden;
}

.collage-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(4px) brightness(0.55) saturate(0.8);
  transform: scale(1.06);
}

/* Dark vignette overlay */
.login-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 70% at 50% 50%, rgba(6,10,15,0.45) 0%, rgba(6,10,15,0.80) 100%);
}

/* ── Frosted-glass login card ────────────────────────────────────── */
.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  margin: 24px;
  padding: 48px 44px;
  background: rgba(13, 17, 23, 0.78);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(31, 192, 122, 0.07),
    inset 0 1px 0 rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Subtle top-edge accent line */
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(31,192,122,0.5), transparent);
  border-radius: 99px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(31,192,122,0.4));
}
.login-logo span {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.login-copy h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 8px;
}
.login-copy p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.login-actions { display: flex; flex-direction: column; gap: 12px; }

.btn-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 24px;
  background: var(--accent);
  color: #071a0e;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 28px rgba(31,192,122,0.30);
}
.btn-discord:hover {
  background: var(--accent-2);
  box-shadow: 0 0 40px rgba(31,192,122,0.40);
}
.btn-discord svg { flex-shrink: 0; }

.auth-error {
  display: none;
  padding: 11px 14px;
  background: var(--red-soft);
  border: 1px solid rgba(248,81,73,0.25);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 13px;
}

/* ════════════════════════════════════════════════════════════════ */
/*  APP SHELL                                                        */
/* ════════════════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: rgba(13, 17, 23, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 32px;
}
.sidebar-logo img { width: 30px; height: 30px; object-fit: contain; }
.sidebar-logo-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px;
  margin-bottom: 6px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.nav-link svg { flex-shrink: 0; width: 16px; height: 16px; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-link.active svg { color: var(--accent); }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  object-fit: cover;
}
#username {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.12s, background 0.12s;
}
.btn:hover { border-color: var(--accent); background: var(--surface-2); }
.btn:active { opacity: 0.85; }

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a1f15;
  font-weight: 700;
  box-shadow: 0 0 16px var(--accent-glow);
}
.btn-accent:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }

.btn-danger {
  background: transparent;
  border-color: transparent;
  color: var(--red);
}
.btn-danger:hover { background: var(--red-soft); border-color: rgba(248,81,73,0.3); }

.btn-danger-solid {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-danger-solid:hover { background: #e04040; border-color: #e04040; }

/* ── main content ────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  background: transparent;
}

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.page-head {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}
.page-head .eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.page-head h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section { margin-bottom: 36px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

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

/* ── duty ticket ─────────────────────────────────────────────────── */
.ticket {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.ticket::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-2);
  border-radius: 0 2px 2px 0;
  transition: background 0.2s;
}
.ticket.on {
  border-color: rgba(31,192,122,0.3);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(31,192,122,0.04) 100%);
}
.ticket.on::before { background: var(--accent); }
.ticket.break { border-color: rgba(88,166,255,0.3); }
.ticket.break::before { background: var(--blue); }

/* Glow when on shift */
.ticket.on::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.ticket-status { display: flex; align-items: center; gap: 16px; }

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-2);
  flex-shrink: 0;
  transition: background 0.2s;
}
.ticket.on .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(31,192,122,0.5);
  animation: pulse-green 2s infinite;
}
.ticket.break .status-dot { background: var(--blue); }

@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(31,192,122,0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(31,192,122,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,192,122,0); }
}

.ticket-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}
.ticket-type {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.ticket.on .ticket-type { color: var(--accent); }

.break-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--blue-soft);
  color: var(--blue);
}

.ticket-timer {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.ticket.on .ticket-timer { color: var(--accent); }
.ticket.break .ticket-timer { color: var(--blue); }

.controls-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── quota bars ──────────────────────────────────────────────────── */
.quota-row { margin-bottom: 20px; }
.quota-row:last-child { margin-bottom: 0; }

.quota-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.quota-row-head .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.quota-row-head .value {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bar-fill {
  height: 100%;
  background: var(--accent-soft);
  border-radius: 99px;
  position: relative;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
  min-width: 3px;
}
.bar-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 99px;
}
.bar-fill.met {
  background: rgba(31,192,122,0.25);
}
.bar-fill.met::after { background: var(--accent); }

/* ── pill ────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pill.good { background: rgba(31,192,122,0.12); color: var(--accent); border: 1px solid rgba(31,192,122,0.2); }
.pill.warn { background: var(--red-soft); color: var(--red); border: 1px solid rgba(248,81,73,0.2); }
.pill.neutral { background: var(--blue-soft); color: var(--blue); border: 1px solid rgba(88,166,255,0.2); }

/* ── table ───────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
td.mono, th.mono { font-family: var(--mono); }

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 28px 0;
  text-align: center;
}

/* ── forms ───────────────────────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 14px;
}

input, select {
  font-family: var(--font);
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  outline: none;
  color-scheme: dark;
  transition: border-color 0.12s;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31,192,122,0.1);
}
input[type="number"] { width: 100px; }
input::placeholder { color: var(--muted); }

/* ── responsive ──────────────────────────────────────────────────── */
@media (max-width: 800px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-bg { display: none; }
  .auth-panel { padding: 40px 32px; justify-content: flex-start; padding-top: 60px; }

  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    overflow-x: auto;
  }
  .sidebar-logo { margin-bottom: 0; }
  .sidebar-nav { flex-direction: row; flex: 1; gap: 2px; }
  .sidebar-section-label { display: none; }
  .sidebar-footer {
    border-top: none;
    border-left: 1px solid var(--border);
    margin-top: 0;
    padding-top: 0;
    padding-left: 12px;
    flex-direction: row;
    align-items: center;
  }
  .page { padding: 24px 16px 60px; }
}

@media (max-width: 540px) {
  .ticket { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ticket-timer { font-size: 28px; }
}
