/* ============================================================
   Private Lessons Manager — Design System
   Palette: ink navy + warm paper + muted gold, ledger/gradebook feel
   ============================================================ */

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

:root {
  --ink: #1B2A4A;
  --ink-soft: #33456b;
  --paper: #FAF8F3;
  --paper-raised: #FFFFFF;
  --slate: #5B6478;
  --gold: #B98B3E;
  --gold-soft: #ECD9B3;
  --rule: #E1DACB;
  --success: #3F7A5E;
  --success-bg: #E6F0EA;
  --danger: #A8452F;
  --danger-bg: #F7E9E4;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 6px;
  --shadow: 0 1px 2px rgba(27,42,74,0.06), 0 4px 12px rgba(27,42,74,0.05);
}

* { box-sizing: border-box; }

html:focus-within { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5rem;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

a { color: var(--ink-soft); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  background: var(--ink);
  color: #EDEFF4;
  padding: 1.75rem 1.25rem;
  flex-shrink: 0;
}
.sidebar .brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.15rem;
}
.sidebar .brand-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold-soft);
  letter-spacing: 0.06em;
  margin-bottom: 2rem;
  display: block;
}
.sidebar nav a {
  display: block;
  color: #C9CEDC;
  text-decoration: none;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
  border-left: 2px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active {
  background: rgba(185,139,62,0.15);
  color: #fff;
  border-left: 2px solid var(--gold);
}
.sidebar .who {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.82rem;
  color: #9BA3B8;
}
.sidebar .who form { margin-top: 0.5rem; }

.main {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1100px;
}

/* ---------- Login screen ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  background-image: radial-gradient(circle at 20% 20%, rgba(185,139,62,0.15), transparent 45%);
}
.login-card {
  background: var(--paper-raised);
  padding: 2.5rem 2.25rem;
  border-radius: var(--radius);
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.login-card .eyebrow { display: block; margin-bottom: 0.4rem; }
.login-card h1 { font-size: 1.6rem; margin-bottom: 1.5rem; }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.3rem; color: var(--ink-soft); }
input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=number], input[type=date], input[type=time], input[type=file],
select, textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  margin-bottom: 1rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
.form-row { display: flex; gap: 1rem; }
.form-row > div { flex: 1; }

button, .btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--ink-soft); }
.btn-gold { background: var(--gold); }
.btn-gold:hover { background: #a37b34; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-outline:hover { background: #fff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8a3924; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* ---------- Cards & grid ---------- */
.card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.2rem; }
.stat-card .num { font-family: var(--font-display); font-size: 1.8rem; color: var(--ink); }
.stat-card .label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate); }

/* ---------- Ledger-style tables (signature element) ---------- */
table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.ledger th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate);
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 2px solid var(--ink);
}
table.ledger td {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
table.ledger tr:last-child td { border-bottom: none; }
table.ledger td.mono, table.ledger th.mono { font-family: var(--font-mono); }
table.ledger tr:hover td { background: #FBF7EE; }
.row-actions { display: flex; gap: 0.4rem; }

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: var(--gold-soft);
  color: #6b4e1e;
}
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.bad { background: var(--danger-bg); color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--slate);
}

/* ---------- Flash messages ---------- */
.flash {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.flash.success { background: var(--success-bg); color: var(--success); border: 1px solid #cfe3d7; }
.flash.error   { background: var(--danger-bg); color: var(--danger); border: 1px solid #e8cec3; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1.5rem; }
.text-muted { color: var(--slate); font-size: 0.88rem; }

@media (max-width: 800px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; }
  .main { padding: 1.5rem; }
}
