/* ===============================
   EpicTime Theme — Grey + Blue
   =============================== */

/* ====== Design tokens ====== */
:root{
  /* Dark mode defaults */
  --bg: #0f1318;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.04);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.62);
  --border: rgba(255,255,255,0.12);

  /* Accent palette */
  --brand: #60a5fa;   /* light blue */
  --brand-soft: rgba(96,165,250,0.25);
  --danger: #ef4444;

  --shadow: 0 12px 32px rgba(0,0,0,0.35);
  --radius: 16px;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --focus: 0 0 0 3px rgba(96,165,250,0.35);
}

/* ====== Light mode ====== */
@media (prefers-color-scheme: light){
  :root{
    --bg: #f4f6fa;
    --card: #ffffff;
    --card2: #ffffff;
    --text: rgba(15,23,42,0.92);
    --muted: rgba(15,23,42,0.62);
    --border: rgba(15,23,42,0.12);
    --shadow: 0 10px 28px rgba(15,23,42,0.10);
  }
}

/* ====== Base ====== */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: var(--sans);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(96,165,250,0.25), transparent 55%),
    var(--bg);
  color: var(--text);
}

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

a{ color: inherit; text-decoration:none; }
a:hover{ opacity: .9; }

/* ====== Header ====== */
header.top{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom: 18px;
}

.brand h1{
  margin:0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.subtitle{
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

/* ====== Cards ====== */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 16px 0;
  backdrop-filter: blur(10px);
}

.card.flat{
  background: var(--card2);
  box-shadow: none;
}

/* ====== Pills ====== */
.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  background: rgba(255,255,255,0.04);
}

/* ====== Buttons ====== */
.btn{
  display:inline-flex;
  gap:8px;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-weight: 650;
  font-size: 14px;
  cursor:pointer;
  transition:
    transform .08s ease,
    background .12s ease,
    border-color .12s ease,
    box-shadow .12s ease;
}

.btn:hover{
  background: rgba(255,255,255,0.08);
}

.btn:active{
  transform: translateY(1px);
}

.btn:focus{
  outline:none;
  box-shadow: var(--focus);
}

/* Primary (blue) */
.btn.primary{
  border-color: rgba(96,165,250,0.6);
  background: linear-gradient(
    135deg,
    rgba(96,165,250,0.85),
    rgba(96,165,250,0.65)
  );
  color: #0b1220;
}

.btn.primary:hover{
  box-shadow: 0 10px 28px rgba(96,165,250,0.35);
}

/* Danger */
.btn.danger{
  border-color: rgba(239,68,68,0.6);
  background: rgba(239,68,68,0.25);
  color: #fff;
}

/* ====== Forms ====== */
label{
  display:block;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 6px;
}

input, textarea, select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 15px;
}

textarea{
  min-height: 96px;
  resize: vertical;
}

input:focus, textarea:focus, select:focus{
  outline:none;
  box-shadow: var(--focus);
}

/* ====== Layout helpers ====== */
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 760px){
  .grid2{ grid-template-columns:1fr; }
}

/* ====== Tables ====== */
table{
  width:100%;
  border-collapse:collapse;
  border-radius: 12px;
  overflow:hidden;
}

th, td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align:left;
  vertical-align:top;
}

th{
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

tr:hover td{
  background: rgba(255,255,255,0.04);
}

.right{ text-align:right; }

/* ====== Text helpers ====== */
.muted{ color: var(--muted); }

.big{
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.dangerText{ color: var(--danger); }

code{
  font-family: var(--mono);
  font-size: 0.95em;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
}

/* ====== Toast / flash ====== */
.toast{
  position: sticky;
  top: 14px;
  z-index: 50;
  display:flex;
  justify-content:center;
  margin: 10px 0 18px;
}

.toastInner{
  width: 100%;
  max-width: 900px;
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.08);
  box-shadow: var(--shadow);
}

.toast.success .toastInner{
  border-color: rgba(96,165,250,0.6);
  background: rgba(96,165,250,0.18);
}

.toast.error .toastInner{
  border-color: rgba(239,68,68,0.6);
  background: rgba(239,68,68,0.18);
}

.toastTitle{
  font-weight: 850;
  letter-spacing: -0.01em;
}

.toastX{
  margin-left:auto;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 18px;
  cursor:pointer;
  opacity:.7;
}

.toastX:hover{ opacity:1; }
