/* ============================================================
   The Mindless — Server Change Log theme
   Ported from git.c3lelouch.com custom.css (July 14, 2026)
   Obsidian #0b0c10, crimson #ff1f4c, violet #8b2cf5, gold #ffd700
   ============================================================ */

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

:root {
  --bg-primary:    #0b0c10;
  --bg-secondary:  #0f1118;
  --bg-card:       #141622;
  --bg-card-hover: #1a1c2c;
  --accent:        #ff1f4c;
  --accent-dark:   #e61942;
  --accent-glow:   rgba(255, 31, 76, 0.35);
  --accent-2:      #8b2cf5;
  --accent-3:      #ffd700;
  --text-primary:  #f1f3f9;
  --text-muted:    #8b92b0;
  --border:        rgba(139, 44, 245, 0.18);
  --input-border:  rgba(139, 44, 245, 0.28);
  --radius:        14px;
  --shadow:        0 4px 32px rgba(0, 0, 0, 0.6);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: rgba(255, 31, 76, 0.4); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #1e2133; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; width: 100%; }

/* ── Navbar: glassy obsidian bar (mirrors git site) ── */
.navbar {
  background: rgba(11, 12, 16, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.6);
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-primary); }
.logo { width: 30px; height: 30px; flex: none; }
.logo-lg { width: 64px; height: 64px; }
.logo-nav { width: auto; height: 30px; border-radius: 4px; }
.logo-login { width: 210px; height: auto; border-radius: 8px; margin-bottom: 4px; }
.brand-name { font-size: 17px; font-weight: 600; color: var(--text-primary); }
.brand-sub { font-size: 12px; color: var(--text-muted); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.inline-form { display: inline; margin: 0; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 16px var(--accent-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 24px var(--accent-glow), 0 0 12px rgba(139, 44, 245, 0.4);
}
.btn-secondary { background: var(--bg-card); }
.btn-danger { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger:hover { background: var(--accent-dark); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; margin-top: 10px; }

/* ── Flash ── */
.flash {
  padding: 10px 14px;
  border-radius: 10px;
  margin: 14px 0;
  border: 1px solid;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.flash-ok { background: rgba(63, 185, 80, 0.12); border-color: #3fb950; color: #7ee2a0; }
.flash-error { background: rgba(255, 31, 76, 0.12); border-color: var(--accent); color: #ff738c; }
.flash-x { background: none; border: none; font-size: 16px; cursor: pointer; color: inherit; padding: 0 4px; }

/* ── Layout ── */
main { flex: 1; padding-bottom: 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 22px 0 14px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; color: var(--text-primary); }
h3 { font-size: 14px; margin: 22px 0 8px; color: var(--text-primary); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.section-text { margin: 0 0 4px; white-space: pre-wrap; }

/* ── Stat cards ── */
.stat-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  box-shadow: var(--shadow);
}
.stat-num { font-size: 20px; font-weight: 600; color: var(--text-primary); }
.stat-label { font-size: 11px; color: var(--text-muted); }

/* ── Box / card ── */
.box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.box-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}
.box-body { padding: 16px; }
.box-narrow { max-width: 520px; }
.meta { color: var(--text-muted); font-weight: 400; font-size: 13px; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

/* ── Table ── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 9px 12px; border-bottom: 1px solid rgba(139, 44, 245, 0.12); vertical-align: middle; color: var(--text-primary); }
.table tbody tr:last-child td { border-bottom: none; }
.row-link { cursor: pointer; }
.row-link:hover { background: var(--bg-card-hover); }
.title-cell { max-width: 420px; }
.tkt { color: var(--accent); font-weight: 600; }
.table td.tkt { color: var(--accent); }
.table td a.pdf-link { color: var(--accent-2); }
.table td a.pdf-link:hover { color: var(--accent); }
.tkt-lg { font-size: 15px; }
.empty { text-align: center; color: var(--text-muted); padding: 30px !important; }
.pdf-link { color: var(--accent-2); font-weight: 600; text-decoration: none; }
.pdf-link:hover { color: var(--accent); }
.table-timeline { margin-top: 4px; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  vertical-align: middle;
}
/* ITIL ticket types */
.type-incident { background: var(--accent); }
.type-bug { background: var(--accent-3); color: #0b0c10; }
.type-change { background: var(--accent-2); }
/* Severity */
.sev-critical { background: var(--accent); }
.sev-high { background: #ff5777; }
.sev-medium { background: var(--accent-3); color: #0b0c10; }
.sev-low { background: #6e748f; }
.sev-info { background: var(--accent-2); }
/* ITIL statuses per lifecycle */
.st-new { background: var(--accent); }
.st-open { background: var(--accent-3); color: #0b0c10; }
.st-in-progress { background: var(--accent-2); }
.st-submitted { background: #8b92b0; }
.st-assessed { background: var(--accent-2); }
.st-approved { background: #9846f6; }
.st-implemented { background: #9846f6; }
.st-fixed { background: #2ea043; }
.st-resolved { background: #3fb950; }
.st-verified { background: #3fb950; }
.st-closed { background: #6e748f; }
.cat { background: var(--accent-2); }

/* ── Forms ── */
.form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.input, .field input, .field select, .field textarea, .search-input {
  font-family: inherit;
  font-size: 14px;
  padding: 7px 10px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: #11131c;
  color: var(--text-primary);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 60px; }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: #666b82; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-grid { display: grid; gap: 14px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.span-3 { grid-column: span 3; }
.form-head { gap: 14px; }
.form-actions { display: flex; gap: 8px; margin-top: 6px; }

/* ── Filter bar ── */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; }
.search-input { flex: 1; min-width: 200px; }
.filter-bar select { width: auto; }

/* ── Entry page ── */
.entry-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin: 22px 0 14px; flex-wrap: wrap; }
.entry-title-line { display: flex; align-items: baseline; gap: 12px; }
.entry-title-line h2 { margin: 0; font-size: 20px; color: var(--text-primary); }
.entry-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.whys { margin: 4px 0 0; padding-left: 22px; }
.whys li { margin-bottom: 8px; color: var(--text-primary); }

/* ── Login ── */
.login-wrap { display: flex; justify-content: center; padding-top: 9vh; }
.login-card {
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  background: var(--bg-card);
  box-shadow: 0 0 48px rgba(255, 31, 76, 0.12), var(--shadow);
}
.login-head { text-align: center; margin-bottom: 18px; }
.login-head h1 { font-size: 19px; margin: 10px 0 4px; color: var(--text-primary); }
.login-head p { margin: 0; font-size: 13px; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 14px 0;
  font-size: 12px;
  color: var(--text-muted);
}
.footer-inner { display: flex; justify-content: space-between; }

@media (max-width: 720px) {
  .form-grid-2, .form-grid-4 { grid-template-columns: 1fr; }
  .span-3 { grid-column: span 1; }
  .brand-sub { display: none; }
  .title-cell { max-width: 180px; }
}
