/* ============================================================
   AmpDesk — Main Stylesheet v2.2
   Font: Outfit (all weights — display + body)
   Palette: lifted slate dark, warm whites, teal accent
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Backgrounds — deep navy base, clearly elevated cards */
  --bg:           #111e30;
  --surface:      #1c3050;
  --surface2:     #243c62;
  --surface3:     #2c4874;
  --border:       #355884;
  --border-light: #4268a0;

  /* Accent — teal, legible on dark */
  --accent:       #34d9c3;
  --accent-dim:   rgba(52,217,195,.16);
  --accent2:      #fb923c;
  --accent2-dim:  rgba(251,146,60,.15);
  --red:          #f87171;
  --red-dim:      rgba(248,113,113,.15);
  --blue:         #60a5fa;
  --blue-dim:     rgba(96,165,250,.15);

  /* Text — warm off-white, proper hierarchy */
  --text:         #eef1f8;
  --text-dim:     #b0c8e4;
  --text-muted:   #8aaac8;

  --radius:       10px;
  --shadow:       0 4px 24px rgba(0,0,0,.5);

  /* Single font family — Outfit handles display AND body beautifully */
  --font-display: 'Outfit', sans-serif;
  --font-body:    'Outfit', sans-serif;
  --font-mono:    'DM Mono', ui-monospace, monospace;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────── */
.app-wrap { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: 244px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(52,217,195,.3);
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.5px;
  color: var(--text);
}
.logo-text span { color: var(--accent); }

.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-section  { padding: 14px 12px 6px; }

.nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  transition: all .15s;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-event-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
}
.event-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 5px;
}
.event-name  { font-size: 13px; font-weight: 600; margin-bottom: 2px; color: var(--text); }
.event-dates { font-size: 11px; color: var(--text-muted); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }

.lang-switcher { display: flex; gap: 4px; margin-bottom: 10px; }
.lang-btn {
  flex: 1; text-align: center; padding: 5px;
  border-radius: 6px; font-size: 11px; font-weight: 700;
  color: var(--text-muted); background: var(--surface2);
  border: 1px solid var(--border); text-decoration: none; transition: all .15s;
  letter-spacing: .4px;
}
.lang-btn:hover  { color: var(--text); text-decoration: none; }
.lang-btn.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

.user-card { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #161c28;
  flex-shrink: 0; text-transform: uppercase;
}
.user-info { flex: 1; overflow: hidden; }
.user-info .name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.user-info .role { font-size: 11px; color: var(--text-muted); }
.logout-btn { color: var(--text-muted); font-size: 16px; padding: 4px; border-radius: 6px; transition: color .15s; text-decoration: none; }
.logout-btn:hover { color: var(--red); text-decoration: none; }

/* ── Main content ───────────────────────────────────────────── */
.main-content { flex: 1; overflow-y: auto; background: var(--bg); position: relative; }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(22,28,40,.95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 60px;
  display: flex; align-items: center; gap: 14px;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
  flex: 1;
}
.topbar-actions { display: flex; gap: 10px; align-items: center; }

/* ── Page body ──────────────────────────────────────────────── */
.page-body { padding: 28px; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--border-light); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 8px;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none; white-space: nowrap; letter-spacing: .1px;
}
.btn-primary   { background: var(--accent); color: #161c28; }
.btn-primary:hover   { background: #2bcdb8; text-decoration: none; color: #161c28; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface3); text-decoration: none; color: var(--text); }
.btn-ghost     { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-light); text-decoration: none; }
.btn-danger    { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,.25); }
.btn-danger:hover { background: var(--red); color: #fff; text-decoration: none; }
.btn-sm    { padding: 5px 11px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  letter-spacing: -.2px; color: var(--text);
}

/* ── Stats grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.green::before  { background: var(--accent); }
.stat-card.orange::before { background: var(--accent2); }
.stat-card.red::before    { background: var(--red); }
.stat-card.blue::before   { background: var(--blue); }

.stat-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 8px; }
.stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-sub   { font-size: 12px; color: var(--text-muted); }
.stat-card.green  .stat-value { color: var(--accent); }
.stat-card.orange .stat-value { color: var(--accent2); }
.stat-card.red    .stat-value { color: var(--red); }
.stat-card.blue   .stat-value { color: var(--blue); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-muted); text-align: left;
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--text);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.025); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: .2px;
}
.badge-green  { background: var(--accent-dim);  color: var(--accent); }
.badge-orange { background: var(--accent2-dim); color: var(--accent2); }
.badge-red    { background: var(--red-dim);     color: var(--red); }
.badge-blue   { background: var(--blue-dim);    color: var(--blue); }
.badge-muted  { background: var(--surface3);    color: var(--text-dim); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-section { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: none; }
.form-section-title {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px; color: var(--text);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-row.four  { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-row.full  { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
label { font-size: 12px; color: var(--text-dim); font-weight: 600; letter-spacing: .1px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
select option { background: var(--surface2); color: var(--text); }
input.error, select.error, textarea.error { border-color: var(--red); }
.field-error { font-size: 11.5px; color: var(--red); margin-top: 3px; font-weight: 500; }
textarea { min-height: 80px; resize: vertical; }

/* Toggle switch */
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.toggle { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.toggle input { display: none; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: 11px; cursor: pointer; transition: all .2s;
}
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; background: var(--text-muted);
  border-radius: 50%; transition: all .2s; pointer-events: none;
}
.toggle input:checked + .toggle-track { background: var(--accent-dim); border-color: var(--accent); }
.toggle input:checked + .toggle-track .toggle-thumb { left: 19px; background: var(--accent); }

/* Day checkboxes */
.day-checkboxes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.day-check {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--text-dim);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px; transition: all .15s; user-select: none;
}
.day-check:has(input:checked) { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.day-check input { display: none; }

/* Socket grid */
.socket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.socket-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.socket-item label { font-size: 12px; color: var(--text); flex: 1; margin-bottom: 0; }
.socket-item input[type="number"] { width: 58px; padding: 5px 8px; text-align: center; }

/* ── Flash messages ─────────────────────────────────────────── */
.flash {
  padding: 12px 20px; font-size: 13.5px;
  border-left: 3px solid; margin: 0; font-weight: 500;
}
.flash-success { background: var(--accent-dim);  border-color: var(--accent);  color: var(--accent); }
.flash-error   { background: var(--red-dim);     border-color: var(--red);     color: var(--red); }
.flash-info    { background: var(--blue-dim);    border-color: var(--blue);    color: var(--blue); }
.flash-warning { background: var(--accent2-dim); border-color: var(--accent2); color: var(--accent2); }

/* ── Zone cards ─────────────────────────────────────────────── */
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.zone-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; cursor: pointer; transition: all .15s;
}
.zone-card:hover { border-color: var(--border-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.zone-card-icon { font-size: 22px; margin-bottom: 8px; }
.zone-card-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; color: var(--text); }
.zone-card-type { font-size: 11px; color: var(--text-muted); }
.zone-card-kw   { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--accent); }

/* ── Power bars ─────────────────────────────────────────────── */
.power-bar-row { margin-bottom: 12px; }
.power-bar-label { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.power-bar-kw  { font-size: 12px; font-weight: 600; color: var(--accent); }
.power-bar-track { height: 6px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
.power-bar-fill  { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #28bfac); transition: width .6s cubic-bezier(.16,1,.3,1); }

/* ── Grid helpers ───────────────────────────────────────────── */
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Login page ─────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(52,217,195,.08) 0%, transparent 60%),
    var(--bg);
}
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 40px; width: 400px; max-width: 100%;
  box-shadow: var(--shadow);
}
.login-logo  { text-align: center; margin-bottom: 28px; }
.login-title { font-family: var(--font-display); font-size: 23px; font-weight: 700; text-align: center; margin-bottom: 6px; color: var(--text); letter-spacing: -.3px; }
.login-sub   { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }

/* ── Guest (supplier) pages ─────────────────────────────────── */
.guest-wrap { max-width: 740px; margin: 0 auto; padding: 36px 24px; }
.guest-header { text-align: center; margin-bottom: 32px; }
.guest-event-badge {
  display: inline-block;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(52,217,195,.3);
  border-radius: 20px; padding: 5px 16px;
  font-size: 12px; font-weight: 600; margin-bottom: 14px;
}
.guest-title    { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-bottom: 8px; color: var(--text); letter-spacing: -.3px; }
.guest-subtitle { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

.zone-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.zone-tab {
  padding: 7px 16px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s;
  color: var(--text-dim); text-decoration: none; display: inline-block;
}
.zone-tab:hover  { border-color: var(--border-light); color: var(--text); text-decoration: none; }
.zone-tab.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.zone-tab.complete::after { content: ' ✓'; color: var(--accent); }

/* ── Misc ───────────────────────────────────────────────────── */
.section-title {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  margin-bottom: 14px; margin-top: 24px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text); letter-spacing: -.2px;
}
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state-icon  { font-size: 40px; margin-bottom: 12px; }
.empty-state-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }

.zone-pill {
  display: inline-block; padding: 2px 8px;
  background: var(--surface3); border-radius: 4px;
  font-size: 11px; margin-right: 3px; margin-top: 2px;
  color: var(--text-dim); font-weight: 500;
}

.mono        { font-family: var(--font-mono); }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-right  { text-align: right; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row.three, .form-row.four { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row   { grid-template-columns: 1fr; }
  .page-body  { padding: 16px; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  /* Un-clip the scroll containers so all content renders */
  .app-wrap     { height: auto !important; overflow: visible !important; }
  .main-content { height: auto !important; overflow: visible !important; }
  /* Hide chrome */
  .sidebar, .topbar, .no-print { display: none !important; }
  /* Cards: allow page breaks inside, remove clipping and shadows */
  .card { overflow: visible !important; box-shadow: none !important; break-inside: auto; }
  /* Keep individual rows from splitting mid-row */
  .print-row { break-inside: avoid; }
}
