/* =========================
   Base
========================= */
* { box-sizing: border-box; }

:root{
  --bg: #f6f7fb;
  --text: #111;
  --muted: #666;

  --card: #fff;
  --shadow: 0 1px 10px rgba(0,0,0,.06);
  --border: #e5e7eb;

  --primary: #2b59ff;
  --primaryFocus: rgba(43,89,255,.15);

  --radius: 12px;
  --radiusSm: 10px;

  /* ✅ Form control width (change once here) */
  --controlMax: 420px;
}

body{
  margin:0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

/* =========================
   Typography / helpers
========================= */
h2,h3{ margin:0 0 12px 0; }

.small{ font-size:12px; color: var(--muted); }
.msg-ok{ color:#0a7a2f; font-weight:700; }
.msg-bad{ color:#b00020; font-weight:700; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid var(--border);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  background:#fafafa;
}

/* =========================
   Card
========================= */
.card{
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

/* =========================
   Buttons
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  padding: 10px 14px;
  border: 0;
  border-radius: var(--radiusSm);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration:none;
  line-height: 1;
}
.btn:active{ transform: translateY(1px); }
.btn[disabled]{ opacity:.6; cursor:not-allowed; transform:none; }

.btn--ghost{
  background:#fff;
  color: var(--text);
  border:1px solid var(--border);
}
.btn--dark{ background:#555; }

/* =========================
   Table
========================= */
table{ width:100%; border-collapse: collapse; }
th,td{
  border-bottom: 1px solid #eee;
  padding: 10px 8px;
  font-size: 13px;
}
th{ text-align:left; background:#fafafa; }

/* =========================
   Form Controls (Input / Select / Textarea)
   ✅ stable + consistent across pages
========================= */
label{
  display:block;
  font-size: 14px;
  font-weight: 600;
  margin: 14px 0 6px;
}

/* ✅ unify controls */
input[type="text"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="password"],
select,
textarea{
  width: 100%;
  max-width: var(--controlMax);
  padding: 12px 14px;
  border-radius: var(--radiusSm);
  border: 1px solid #d0d7e2;
  font-size: 15px;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
  box-sizing: border-box; /* ✅ important */
  color: var(--text);
}

textarea{
  min-height: 90px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder{ color: #9aa3af; }

input:focus,
select:focus,
textarea:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primaryFocus);
}

/* ✅ Select arrow custom */
select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding-right: 44px; /* space for arrow */
  background-image:
    linear-gradient(45deg, transparent 50%, #555 50%),
    linear-gradient(135deg, #555 50%, transparent 50%),
    linear-gradient(to right, #ddd, #ddd);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 15px) calc(50% - 3px),
    calc(100% - 40px) 50%;
  background-size:
    5px 5px,
    5px 5px,
    1px 60%;
  background-repeat: no-repeat;
}

/* ✅ Safari iOS / macOS select height consistency */
select{ line-height: 1.2; }

/* =========================
   Topbar (sticky)
========================= */
.topbar{
  position: sticky;
  top: 0;
  z-index: 20;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;

  background:#fff;
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
}

.topbar__brand{
  text-decoration:none;
  font-weight: 800;
  color: var(--text);
}

.topbar__right{
  display:flex;
  gap: 8px;
  align-items:center;
  flex-wrap: wrap;
}

.icon-btn{
  border: 1px solid #ddd;
  background:#fff;
  padding: 8px 10px;
  border-radius: 10px;
  cursor:pointer;
}

/* =========================
   Sidebar Drawer
========================= */
.sidebar{
  position: fixed;
  top:0; left:0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;

  background:#0f172a;
  color:#fff;

  transform: translateX(-110%);
  transition: transform .2s ease;
  z-index: 50;

  box-shadow: 10px 0 30px rgba(0,0,0,.2);
}
.sidebar.is-open{ transform: translateX(0); }

.sidebar__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.sidebar__brand{ font-weight: 800; }

.sidebar__nav{ padding: 10px 8px; }
.side-title{
  font-size: 11px;
  opacity:.7;
  padding: 10px 14px 6px;
  letter-spacing: .08em;
}
.side-sep{
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 10px 12px;
}

.side-link{
  display:block;
  padding: 12px 12px;
  margin: 4px 6px;
  color: #e5e7eb;
  text-decoration:none;
  border-radius: 12px;
}
.side-link:hover{ background: rgba(255,255,255,.08); }

/* =========================
   Overlay
========================= */
.overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 40;
}
.overlay.is-on{
  opacity: 1;
  pointer-events: auto;
}

.no-scroll{ overflow:hidden; }

/* =========================
   Small responsive tweaks
========================= */
@media (max-width: 520px){
  input, select, textarea{ max-width: 100%; }
  .topbar__right{ gap: 6px; }
}
