:root {
  --navy: #08223D;
  --navy-light: #123255;
  --teal: #0E7C86;
  --cyan: #22C9E8;
  --ink: #101820;
  --muted: #64748B;
  --muted-2: #4B5A63;
  --line: #DCE3E8;
  --line-2: #EEF2F4;
  --bg: #F5F7F9;
  --card: #FFFFFF;
  --danger: #C0362C;
  --warn: #B8890B;
  --ok: #0E7C86;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Liberation Sans", "DejaVu Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
}
.topbar .brand { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.topbar .brand i { font-style: normal; font-weight: 500; color: #9FB3C8; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  color: #D8E1EA; padding: 8px 12px; border-radius: 6px; font-size: 13.5px; font-weight: 600;
}
.topbar nav a:hover, .topbar nav a.active { background: var(--navy-light); color: #fff; text-decoration: none; }
.topbar .userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #C7D2DC; }
.topbar form { margin: 0; }
.topbar .logout-btn {
  background: none; border: 1px solid #33547A; color: #D8E1EA; border-radius: 6px;
  padding: 6px 10px; font-size: 12.5px; cursor: pointer;
}
.topbar .logout-btn:hover { background: var(--navy-light); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.wrap.wide { max-width: 1300px; }

h1.page-title { font-size: 22px; font-weight: 800; color: var(--navy); margin: 0 0 4px; }
.page-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 22px; margin-bottom: 18px;
}
.card h2 { font-size: 15px; font-weight: 800; color: var(--navy); margin: 0 0 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 5px; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=tel], .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: var(--teal); }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field label { text-transform: none; font-weight: 600; font-size: 13.5px; margin: 0; }

.checkbox-row { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.checkbox-row label { font-size: 13px; font-weight: 600; color: var(--ink); text-transform: none; display: flex; align-items: center; gap: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: #fff;
  border: none; border-radius: 7px; padding: 10px 16px; font-size: 13.5px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--navy-light); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--line-2); }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #EED2CE; }
.btn.danger:hover { background: #FBEEEC; }
.btn.small { padding: 6px 10px; font-size: 12.5px; }
.btn.teal { background: var(--teal); }
.btn.teal:hover { background: #0b626a; }

table.data { width: 100%; border-collapse: collapse; }
table.data thead th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 0 8px 8px; border-bottom: 1px solid var(--line);
}
table.data tbody td { padding: 10px 8px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; vertical-align: middle; }
table.data tbody tr:hover { background: #FAFBFC; }
table.data td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--line-2); color: var(--muted-2);
}
.pill.draft { background: #EEF2F4; color: var(--muted-2); }
.pill.sent { background: #FFF6E0; color: #8A6300; }
.pill.won { background: #E7F5EC; color: #15803D; }
.pill.lost { background: #FBEEEC; color: var(--danger); }

.error-box {
  background: #FBEEEC; border: 1px solid #EED2CE; color: var(--danger);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}
.ok-box {
  background: #E7F5EC; border: 1px solid #BFE3CC; color: #15803D;
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}

.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg);
}
.auth-card {
  width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 32px 28px;
}
.auth-card .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--navy); margin-bottom: 22px; }
.auth-card .brand i { font-style: normal; font-weight: 500; color: #282D33; }
.auth-card .hint { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

.logo-badge { width: 26px; height: auto; flex-shrink: 0; display: block; }
.logo-full { height: 24px; width: auto; flex-shrink: 0; display: block; }
.logo-full.lg { height: 34px; }

.pw-field { position: relative; }
.pw-field input { padding-right: 40px !important; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 6px; cursor: pointer; color: var(--muted);
  display: flex; align-items: center; justify-content: center; border-radius: 5px;
}
.pw-toggle:hover { background: var(--line-2); color: var(--ink); }
.pw-toggle svg { width: 18px; height: 18px; display: block; }
.pw-toggle .eye-off { display: none; }
.pw-toggle.is-visible .eye { display: none; }
.pw-toggle.is-visible .eye-off { display: block; }

.summary-row { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 20px; }
.summary-row > div { flex: 1; padding: 14px 18px; }
.summary-row > div + div { border-left: 1px solid var(--line); }
.summary-row .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; margin-bottom: 5px; }
.summary-row .num { font-size: 21px; font-weight: 800; }
.summary-row .num.teal { color: var(--teal); }

.item-photo { width: 40px; height: 40px; border-radius: 6px; object-fit: contain; background: #fff; border: 1px solid var(--line); }

.picker-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.picker-tab {
  border: 1px solid var(--line); background: #fff; color: var(--muted-2); border-radius: 999px;
  padding: 6px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.picker-tab:hover { background: var(--line-2); }
.picker-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 4px; }
.eq-card {
  border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: #fff;
  display: flex; flex-direction: column; gap: 8px;
}
.eq-card .eq-photo {
  height: 72px; display: flex; align-items: center; justify-content: center;
  background: var(--line-2); border-radius: 6px; overflow: hidden;
}
.eq-card .eq-photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.eq-card .eq-photo .ph-placeholder { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.eq-card .eq-name { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.eq-card .eq-desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; flex: 1; }
.eq-card .eq-price { font-size: 13.5px; font-weight: 800; color: var(--navy); }
.eq-card .eq-add-row { display: flex; gap: 6px; }
.eq-card .eq-add-row input[type=number] {
  width: 52px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; text-align: center;
}
.eq-card .eq-add-row button { flex: 1; padding: 6px 8px; font-size: 12.5px; }
.eq-empty { grid-column: 1 / -1; }
.muted { color: var(--muted); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }

.inline-form { display: inline; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--teal); }

@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .wrap { padding: 20px 14px 40px; }
}
