/* ═══════════════════════════════════════════════
   Guest2Go Customer Portal — Stylesheet
   ═══════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #060F1A;
  --bg2:      #0A1A2C;
  --card:     #0D2035;
  --card2:    #091625;
  --border:   rgba(255,255,255,.08);
  --border2:  rgba(255,255,255,.05);
  --accent:   #1B6EF3;
  --accent-hv:#1458C8;
  --text:     #E2EDF8;
  --mid:      #7A9BBF;
  --muted:    #3D5A7A;
  --online:   #22C55E;
  --inuse:    #F59E0B;
  --offline:  #EF4444;
  --maint:    #8B5CF6;
  --radius:   10px;
  --shadow:   0 4px 24px rgba(0,0,0,.4);
  --topbar-h: 60px;
  --sidebar-w:220px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

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

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--accent-hv); }

.btn-outline {
  background: none; color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.btn-outline:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.04); }

.btn-ghost {
  background: none; color: var(--mid); border: none; padding: 7px 14px;
  font-size: 13px; cursor: pointer; border-radius: 6px; transition: color .15s, background .15s;
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.05); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--mid);
  text-transform: uppercase; letter-spacing: .5px; }
.form-input {
  background: var(--card2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 9px 12px; font-size: 14px; width: 100%;
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); }
select.form-input { cursor: pointer; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }

.form-section { background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; }
.form-section-title {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.form-footer { display: flex; justify-content: flex-end; align-items: center;
  gap: 14px; margin-top: 20px; }
.form-status { font-size: 13px; color: var(--online); }
.form-status.error { color: var(--offline); }
.help-text { font-size: 13px; color: var(--mid); line-height: 1.65; margin-bottom: 16px; }
.input-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] {
  width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 8px;
  padding: 3px; background: var(--card2); cursor: pointer; flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #0A1929;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

.login-wrap { width: 100%; max-width: 400px; padding: 24px; }

.login-card {
  background: linear-gradient(160deg, #0E1E33 0%, #091625 100%);
  border: 1px solid #1E3A5F;
  border-radius: 12px;
  padding: 38px 36px 32px;
  box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(27,110,243,.08);
}

.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo-img {
  height: 120px; max-height: 120px; width: auto; max-width: 300px;
  display: block; margin: 0 auto 0;
  filter: drop-shadow(0 2px 12px rgba(27,110,243,.5));
}
.login-brand-name { font-size: 24px; font-weight: 700; letter-spacing: -.2px; color: #fff; margin: 0 0 3px; }
.login-brand-sub  { font-size: 12px; color: #8899AA; margin-top: 2px; letter-spacing: .3px; text-transform: uppercase; }

.login-divider {
  border: none; border-top: 1px solid #1E3A5F; margin: 0 0 22px;
}

.login-card .form-group label { color: #8899AA; }
.login-card .form-input {
  background: #132F4C; border-color: #1E3A5F;
  font-family: 'Segoe UI', sans-serif;
}
.login-card .form-input:focus { border-color: #1B6EF3; background: #0D2137; }
.login-card .form-input::placeholder { color: #445566; }

.login-btn {
  width: 100%; padding: 11px; font-size: 14px; margin-top: 4px;
  font-family: 'Segoe UI', sans-serif; font-weight: 600;
  background: linear-gradient(135deg, #1B6EF3, #4A8FF7);
  border: 1px solid #1B6EF3; border-radius: 8px;
  letter-spacing: .2px;
}
.login-btn:hover { background: linear-gradient(135deg, #1458C8, #1B6EF3); }

.login-error {
  background: rgba(255,82,82,.1); border: 1px solid rgba(255,82,82,.3);
  color: #FF8A8A; border-radius: 6px; padding: 9px 13px;
  font-size: 13px; margin-bottom: 14px;
}
.login-footer { text-align: center; margin-top: 20px; font-size: 12px; color: #445566; }
.login-footer a { color: #4A8FF7; }

/* ═══════════════════════════════════════════════
   PORTAL LAYOUT
   ═══════════════════════════════════════════════ */
.portal-page { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
#portal-root  { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ── Top bar ──────────────────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h); flex-shrink: 0;
  background: var(--card2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.topbar-icon { font-size: 20px; }
.topbar-name  { color: var(--text); }
.topbar-sep   { color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-email { font-size: 13px; color: var(--mid); }

.plan-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 3px 10px;
  border-radius: 99px; text-transform: uppercase;
}
.plan-badge.standard { background: rgba(27,110,243,.2);  color: #7ABEFF; border: 1px solid rgba(27,110,243,.3); }
.plan-badge.pro      { background: rgba(245,158,11,.2); color: #FCD34D; border: 1px solid rgba(245,158,11,.3); }

/* ── Body (sidebar + main) — CSS Grid keeps sidebar pinned regardless of content ── */
#portal-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
  /* Grid column 1 — always exactly --sidebar-w, content cannot affect this */
  background: var(--card2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 0;
  overflow: hidden; min-height: 0;
}

#sidebar nav { display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: none; border: none; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-weight: 500; color: var(--mid);
  cursor: pointer; transition: background .15s, color .15s;
}
.nav-item:hover   { background: rgba(255,255,255,.05); color: var(--text); }
.nav-item.active  { background: rgba(27,110,243,.15); color: var(--text); }
.nav-icon { font-size: 16px; }

#sidebar-counts {
  margin-top: auto; padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.count-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mid); }
.count-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.count-dot.online  { background: var(--online); }
.count-dot.inuse   { background: var(--inuse); }
.count-dot.offline { background: var(--offline); }

/* ── Main ────────────────────────────────────────────────────────────────── */
#main { min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 28px 32px; }

.section-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 24px;
}
.section-header h1 { font-size: 24px; font-weight: 900; letter-spacing: -.3px; }
.muted-sm { font-size: 12px; color: var(--muted); }
.section-subheader {
  font-size: 13px; font-weight: 700; color: var(--mid);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px;
  margin-top: 28px;
}

/* ── Summary bar ─────────────────────────────────────────────────────────── */
.summary-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px; }
.summary-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; text-align: center;
}
.summary-num { font-size: 32px; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.summary-lbl { font-size: 12px; color: var(--mid); font-weight: 500; }
.online-card  .summary-num { color: var(--online); }
.inuse-card   .summary-num { color: var(--inuse); }
.offline-card .summary-num { color: var(--offline); }

@media (max-width: 768px) { .summary-bar { grid-template-columns: repeat(2,1fr); } }

/* ── Device cards ────────────────────────────────────────────────────────── */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.device-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; cursor: default; transition: border-color .2s, box-shadow .2s;
}
.device-card:hover { border-color: rgba(27,110,243,.3); box-shadow: 0 0 0 1px rgba(27,110,243,.1); }

.device-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 14px;
}
.device-name { font-size: 15px; font-weight: 700; color: var(--text); }
.device-card-body {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border2);
}
.device-stat { display: flex; flex-direction: column; gap: 2px; min-width: 68px; }
.ds-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.ds-val   { font-size: 16px; font-weight: 700; color: var(--text); }
.device-card-footer { display: flex; justify-content: space-between; align-items: center; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .3px; padding: 3px 9px;
  border-radius: 99px; text-transform: uppercase; flex-shrink: 0;
}
.badge-online  { background: rgba(34,197,94,.15);  color: #4ADE80; border: 1px solid rgba(34,197,94,.3); }
.badge-inuse   { background: rgba(245,158,11,.15); color: #FCD34D; border: 1px solid rgba(245,158,11,.3); }
.badge-offline { background: rgba(239,68,68,.12);  color: #FDA4A4; border: 1px solid rgba(239,68,68,.25); }
.badge-maint   { background: rgba(139,92,246,.15); color: #C4B5FD; border: 1px solid rgba(139,92,246,.3); }

/* ── Stat grid ───────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-label { font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.stat-val { font-size: 26px; font-weight: 900; color: var(--text); line-height: 1; }
@media (max-width: 768px) { .stat-grid { grid-template-columns: repeat(2,1fr); } }

/* ── Chart ───────────────────────────────────────────────────────────────── */
.chart-section { margin-top: 28px; }
.chart-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; overflow-x: auto;
}
.hourly-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 12px;
}
.hourly-label { width: 48px; text-align: right; color: var(--mid); flex-shrink: 0; }
.hourly-bar-wrap { flex: 1; background: rgba(255,255,255,.05); border-radius: 3px; height: 14px; }
.hourly-bar { height: 14px; border-radius: 3px; background: var(--accent);
  transition: width .4s ease; min-width: 2px; }
.hourly-count { width: 36px; color: var(--muted); }

.app-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.app-name { width: 160px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.app-bar-wrap { flex: 1; background: rgba(255,255,255,.05); border-radius: 4px; height: 14px; overflow: hidden; }
.app-bar { height: 14px; border-radius: 4px; background: linear-gradient(90deg, #1B6EF3, #00D4FF); transition: width .5s cubic-bezier(.4,0,.2,1); }
.app-count { width: 80px; text-align: right; color: var(--muted); flex-shrink: 0; }

/* ── Vertical Column Chart ───────────────────────────────────────────────── */
.vchart { width: 100%; }
.vchart-plot {
  height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  position: relative;
  background-image: linear-gradient(
    to top,
    transparent 0%, transparent calc(25% - .5px),
    rgba(255,255,255,.06) calc(25% - .5px), rgba(255,255,255,.06) 25%,
    transparent 25%, transparent calc(50% - .5px),
    rgba(255,255,255,.06) calc(50% - .5px), rgba(255,255,255,.06) 50%,
    transparent 50%, transparent calc(75% - .5px),
    rgba(255,255,255,.06) calc(75% - .5px), rgba(255,255,255,.06) 75%,
    transparent 75%
  );
}
.vchart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  cursor: default;
}
.vchart-bar {
  width: 72%;
  max-width: 36px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(0deg, #1254c8, var(--accent));
  transition: height .5s cubic-bezier(.4,0,.2,1);
}
.vchart-bar:hover { filter: brightness(1.3); }
.vchart-bar-zero { background: rgba(255,255,255,.05) !important; }
.vchart-axis { display: flex; gap: 3px; margin-top: 5px; }
.vchart-xlabel {
  flex: 1;
  text-align: center;
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.3;
}

/* ── Usage controls ──────────────────────────────────────────────────────── */
.usage-controls { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }

/* ── Live Status Card ────────────────────────────────────────────────────── */
.usage-live-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px;
}
.live-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.live-pulse-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34,197,94,.25);
  animation: live-pulse 1.8s infinite;
  flex-shrink: 0;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
  50%       { box-shadow: 0 0 0 6px rgba(34,197,94,.08); }
}
.live-card-title { font-size: 13px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .5px; }
.live-last-update { font-size: 11px; color: var(--muted); margin-left: auto; }
.live-device-rows { display: flex; flex-direction: column; gap: 10px; }
.live-device-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px;
}
.live-row-info { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.live-row-name { font-weight: 600; font-size: 14px; color: var(--text); }
.live-app-chip {
  font-size: 12px; color: var(--text); background: rgba(27,110,243,.15);
  border: 1px solid rgba(27,110,243,.3); border-radius: 20px; padding: 3px 10px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-app-chip.muted { background: rgba(255,255,255,.05); border-color: var(--border); color: var(--muted); }
.live-dur { font-size: 12px; color: #4ADE80; background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.25); border-radius: 20px; padding: 3px 10px; }
.live-seen { font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* ── Ticker ──────────────────────────────────────────────────────────────── */
.ticker-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ticker-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px;
}
.ticker-text { flex: 1; font-size: 14px; color: var(--text); }
.ticker-remove {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 4px;
  transition: color .15s;
}
.ticker-remove:hover { color: var(--offline); }
.ticker-add-row { display: flex; gap: 10px; margin-top: 4px; }

/* ── Background image preview thumbnail ─────────────────────────────────── */
.bg-image-preview {
  width: 100%; max-width: 320px; height: 130px; margin-top: 10px;
  background: center / cover no-repeat var(--card2);
  border-radius: var(--radius); border: 1px solid var(--border);
}
.bg-image-preview-sm { max-width: 200px; height: 80px; }

/* ── Customize tags ──────────────────────────────────────────────────────── */
.pro-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
  background: rgba(245,158,11,.18); color: #FCD34D;
  border: 1px solid rgba(245,158,11,.3); padding: 2px 8px; border-radius: 99px;
}
.all-plans-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
  background: rgba(34,197,94,.12); color: #4ADE80;
  border: 1px solid rgba(34,197,94,.25); padding: 2px 8px; border-radius: 99px;
}
.pro-banner {
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.pro-banner-icon { font-size: 24px; flex-shrink: 0; }
.pro-banner p { font-size: 13px; color: var(--mid); margin-top: 4px; }
.pro-banner strong { color: var(--text); }

/* ── Billing ─────────────────────────────────────────────────────────────── */
.billing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.billing-card-wide { grid-column: 1 / -1; }
@media (max-width: 680px) { .billing-grid { grid-template-columns: 1fr; } }

.billing-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px;
}
.billing-card-label { font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; }
.billing-plan-name { font-size: 28px; font-weight: 900; }
.billing-plan-desc { font-size: 13px; color: var(--mid); margin-top: 6px; line-height: 1.6; }
.billing-cost-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.billing-cost-row span { font-size: 20px; font-weight: 700; }
.billing-x { color: var(--muted) !important; font-weight: 400 !important; font-size: 16px !important; }
.billing-total { color: var(--online) !important; font-size: 28px !important; font-weight: 900 !important; }
.billing-note { font-size: 13px; color: var(--mid); margin-top: 10px; line-height: 1.6; }

/* ── Customer Modal ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 300;
}
.modal-box {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 480px; max-width: calc(100vw - 32px);
  background: linear-gradient(160deg,#0E1E33,#091625);
  border: 1px solid #1E3A5F; border-radius: 12px;
  padding: 28px 28px 24px; z-index: 301;
  display: flex; flex-direction: column; gap: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
  font-family: 'Segoe UI', sans-serif;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.modal-title { font-size: 16px; font-weight: 700; color: #fff; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 12px;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid #1E3A5F;
}
.modal-box-wide { width: 600px; }

/* Device picker list inside Assign Device modal */
.device-picker-list {
  max-height: 300px; overflow-y: auto;
  border: 1px solid #1E3A5F; border-radius: 8px;
  background: rgba(0,0,0,.2);
}
.device-picker-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #1a2e45;
  transition: background .15s;
}
.device-picker-row:last-child { border-bottom: none; }
.device-picker-row:hover   { background: rgba(27,110,243,.12); }
.device-picker-row.selected{ background: rgba(27,110,243,.22); }
.picker-row-info   { flex: 1; min-width: 0; }
.picker-row-name   { font-size: 13px; font-weight: 600; color: #E2E8F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-row-sub    { font-size: 11px; color: var(--mid); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-status-lbl { font-size: 11px; font-weight: 600; white-space: nowrap; }
.picker-status-lbl.online  { color: var(--online); }
.picker-status-lbl.inuse   { color: var(--inuse); }
.picker-status-lbl.offline { color: var(--mid); }
.picker-check      { font-size: 14px; color: var(--primary); font-weight: 700; }

/* ── Customer Table ──────────────────────────────────────────────────────── */
.customer-table-wrap {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.customer-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.customer-table thead tr {
  background: var(--card2); border-bottom: 1px solid var(--border);
}
.customer-table th {
  padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700;
  color: var(--mid); text-transform: uppercase; letter-spacing: .5px;
}
.customer-table tbody tr { border-bottom: 1px solid var(--border2); }
.customer-table tbody tr:last-child { border-bottom: none; }
.customer-table tbody tr:hover { background: rgba(255,255,255,.03); }
.customer-table td { padding: 10px 14px; color: var(--text); vertical-align: middle; }
.cust-property { font-weight: 600; }
.cust-contact  { color: var(--text); }
.cust-email    { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cust-num      { text-align: center; font-weight: 700; }
.cust-since    { color: var(--mid); font-size: 12px; }
.online-num    { color: var(--online); }
.plan-tag      { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-pro-sm       { background: rgba(245,158,11,.15); color: #FCD34D; border: 1px solid rgba(245,158,11,.25); }
.badge-standard-sm  { background: rgba(27,110,243,.15);  color: #7ABEFF; border: 1px solid rgba(27,110,243,.25); }
.cust-status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.cust-status-dot.active   { background: var(--online); }
.cust-status-dot.inactive { background: var(--offline); }
.cust-actions { white-space: nowrap; }
.cust-btn-edit, .cust-btn-delete, .cust-btn-device {
  border: none; border-radius: 5px; padding: 4px 10px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: 'Segoe UI', sans-serif;
}
.cust-btn-device { background: rgba(34,197,94,.18); color: #6EE7A0; margin-right: 6px; }
.cust-btn-device:hover { background: rgba(34,197,94,.35); }
.cust-btn-edit   { background: rgba(27,110,243,.2); color: #7ABEFF; margin-right: 6px; }
.cust-btn-edit:hover   { background: rgba(27,110,243,.4); }
.cust-btn-delete { background: rgba(239,68,68,.15); color: #FDA4A4; }
.cust-btn-delete:hover { background: rgba(239,68,68,.3); }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.loading-msg { color: var(--muted); font-size: 13px; padding: 20px; }
.empty-msg   { color: var(--muted); font-size: 14px; grid-column: 1 / -1; padding: 32px 0; text-align: center; line-height: 1.7; }

/* ═══════════════════════════════════════════════
   DEVICE DETAIL PANEL
   ═══════════════════════════════════════════════ */
.panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 200;
}
.device-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 100vw;
  background: #0D2137; border-left: 1px solid #1E3A5F;
  z-index: 201; display: flex; flex-direction: column;
  box-shadow: -12px 0 48px rgba(0,0,0,.6);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}
.device-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #1E3A5F;
  background: #091625; flex-shrink: 0;
}
.panel-header-left { display: flex; align-items: center; gap: 10px; }
.panel-device-name { font-size: 15px; font-weight: 700; color: #fff; }
.panel-meta {
  display: flex; gap: 18px; padding: 7px 18px;
  background: #071320; border-bottom: 1px solid #1E3A5F;
  flex-shrink: 0; flex-wrap: wrap;
}
.panel-meta-item { font-size: 12px; color: #8899AA; }

/* Panel tabs */
.panel-tabs {
  display: flex; border-bottom: 1px solid #1E3A5F;
  background: #091625; flex-shrink: 0;
}
.panel-tab {
  flex: 1; padding: 10px 6px; font-size: 12px; font-weight: 600;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: #8899AA; cursor: pointer;
  transition: color .15s, border-color .15s;
  font-family: 'Segoe UI', sans-serif;
}
.panel-tab:hover { color: #CCDDEE; }
.panel-tab.active { color: #fff; border-bottom-color: #1B6EF3; }
.panel-tab-content { flex: 1; overflow-y: auto; padding: 16px 18px; }

/* Clickable device card */
.device-card-clickable { cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.device-card-clickable:hover { border-color: #1B6EF3; background: #132F4C; transform: translateY(-1px); }
.device-card-manage { font-size: 11px; color: #4A8FF7; font-weight: 600; margin-left: auto; }

/* Command buttons */
.cmd-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.cmd-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 18px 12px; border-radius: 10px;
  border: 1px solid #1E3A5F; background: #132F4C;
  cursor: pointer; transition: background .15s, border-color .15s;
  font-family: 'Segoe UI', sans-serif;
}
.cmd-btn:hover  { background: #1A3F6F; border-color: #1B6EF3; }
.cmd-btn:active { background: #0D2B4F; }
.cmd-btn-green { border-color: #00C853 !important; }
.cmd-btn-green:hover { background: #0A2B1A !important; border-color: #00E676 !important; }
.cmd-btn-red { border-color: #F44336 !important; }
.cmd-btn-red:hover { background: #2B0A0A !important; border-color: #FF5252 !important; }
.cmd-icon  { font-size: 26px; }
.cmd-label { font-size: 13px; font-weight: 700; color: #fff; }
.cmd-desc  { font-size: 11px; color: #8899AA; text-align: center; }

/* Toggle switches */
.toggle-group {
  border: 1px solid #1E3A5F; border-radius: 8px; overflow: hidden;
  margin-bottom: 14px;
}
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #0D2137;
  border-bottom: 1px solid #1E3A5F;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; color: #CCDDEE; }
.toggle-switch { position: relative; width: 38px; height: 20px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0; background: #1E3A5F; border-radius: 20px;
  cursor: pointer; transition: background .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 14px; height: 14px; left: 3px; top: 3px;
  background: #8899AA; border-radius: 50%;
  transition: transform .2s, background .2s;
}
.toggle-switch input:checked + .toggle-slider { background: #1B6EF3; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }

/* Config section headings */
.config-section-title {
  font-size: 11px; font-weight: 700; color: #8899AA;
  text-transform: uppercase; letter-spacing: .8px;
  margin: 18px 0 8px;
}
.config-section-title:first-child { margin-top: 4px; }

/* Panel info grid (key-value rows) */
.panel-info-grid {
  border: 1px solid #1E3A5F; border-radius: 8px; overflow: hidden;
}
.panel-info-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; border-bottom: 1px solid #1E3A5F;
}
.panel-info-row:last-child { border-bottom: none; }
.pi-label { font-size: 12px; color: #8899AA; width: 110px; flex-shrink: 0; }
.pi-val   { font-size: 13px; color: #CCDDEE; font-family: 'Consolas', monospace; word-break: break-all; }

/* ── Themes section ──────────────────────────────────────────────────────────── */
.theme-device-bar {
  display: flex; align-items: flex-end; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.theme-device-badge {
  font-size: 12px; font-weight: 700; padding: 5px 12px;
  border-radius: 20px; white-space: nowrap; margin-bottom: 4px;
}
.theme-device-badge.online  { background: rgba(34,197,94,.15); color: var(--online); border: 1px solid rgba(34,197,94,.3); }
.theme-device-badge.inuse   { background: rgba(59,130,246,.15); color: var(--inuse); border: 1px solid rgba(59,130,246,.3); }
.theme-device-badge.offline { background: rgba(100,116,139,.12); color: var(--mid); border: 1px solid rgba(100,116,139,.25); }

/* Live color preview bar */
.theme-preview-bar { border-radius: 10px; overflow: hidden; margin-bottom: 20px; min-height: 72px; }
.tp-bg {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 8px; padding: 12px 20px 14px;
  transition: background .3s;
}
.tp-top-row { display: flex; align-items: center; gap: 14px; width: 100%; }
.tp-accent {
  width: 8px; height: 44px; border-radius: 4px; flex-shrink: 0;
  transition: background .3s;
}
.tp-welcome {
  font-size: 18px; font-weight: 700;
  transition: color .3s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tp-tiles-row { display: flex; gap: 6px; padding-left: 22px; }
.tp-tile-swatch {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.15);
  transition: background .3s;
}

/* Theme cards */
.theme-card {
  background: rgba(255,255,255,.03); border: 1px solid #1E3A5F;
  border-radius: 10px; padding: 18px 20px; margin-bottom: 16px;
}
.theme-card-title {
  font-size: 12px; font-weight: 700; color: #8899AA;
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 14px;
}
.theme-field-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 640px) { .theme-field-grid { grid-template-columns: 1fr; } }

/* Color pickers */
.theme-color-row {
  display: flex; gap: 32px; flex-wrap: wrap;
}
.theme-color-field { display: flex; flex-direction: column; gap: 8px; }
.theme-color-field label { font-size: 12px; color: var(--mid); }
.color-input-group { display: flex; align-items: center; gap: 10px; }
.color-input-group input[type="color"] {
  width: 38px; height: 38px; border: 1px solid #1E3A5F; border-radius: 8px;
  padding: 3px; background: #132F4C; cursor: pointer; flex-shrink: 0;
}
.color-hex { width: 100px; }

/* Save bar */
.theme-save-bar {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 14px; padding: 14px 0; margin-top: 4px;
  border-top: 1px solid #1E3A5F;
}

/* ── Theme presets ───────────────────────────────────────────────────────────── */
.theme-preset-row {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.theme-preset-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 2px solid transparent;
  border-radius: 10px; padding: 6px 8px; cursor: pointer;
  transition: border-color .15s, transform .1s;
  font-family: 'Segoe UI', sans-serif;
}
.theme-preset-swatch:hover { border-color: rgba(255,255,255,.2); transform: translateY(-2px); }
.theme-preset-swatch.selected { border-color: var(--primary); }
.preset-bg {
  width: 52px; height: 34px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.1);
}
.preset-accent {
  width: 14px; height: 22px; border-radius: 3px;
  opacity: .9;
}
.preset-name {
  font-size: 11px; font-weight: 600; color: var(--mid);
  white-space: nowrap;
}
.theme-preset-swatch.selected .preset-name { color: #E2E8F0; }

/* ── Alert Settings section ──────────────────────────────────────────────────── */
.settings-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
}
.settings-card-title {
  font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px;
}
.settings-card-desc {
  font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.5;
}
.settings-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px;
}
.settings-card .toggle-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 0; background: none; border-bottom: none; justify-content: flex-start;
}
.settings-card .toggle-row:last-child { border-bottom: none; }
.settings-card .toggle-label { font-size: 13px; color: var(--text); }

/* ── Ticker scheduling ────────────────────────────────────────────────────────── */
.ticker-item-block {
  flex-direction: column; align-items: stretch; padding: 10px 14px;
}
.ticker-item-header {
  display: flex; align-items: center; gap: 8px;
}
.ticker-item-header .ticker-text { flex: 1; }
.ticker-sched-badge {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 99px;
  background: rgba(99,102,241,.18); color: #A5B4FC; border: 1px solid rgba(99,102,241,.3);
  white-space: nowrap;
}
.ticker-sched-always {
  background: rgba(100,116,139,.18); color: var(--muted); border-color: var(--border);
}
.ticker-sched-toggle { padding: 3px 8px !important; font-size: 11px !important; white-space: nowrap; }
.ticker-sched-panel {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ticker-sched-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
  font-size: 12px; color: var(--muted);
}
.ticker-sched-row:last-child { margin-bottom: 0; }
.ticker-sched-row label { font-size: 12px; color: var(--mid); white-space: nowrap; }
.ticker-time-input { width: 110px !important; font-size: 12px; padding: 4px 8px !important; }
.ticker-sched-hint { font-size: 11px; color: var(--muted); font-style: italic; }
.day-btns-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.day-btn {
  font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--card2); color: var(--muted);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.day-btn:hover { border-color: var(--primary); color: var(--text); }
.day-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-link {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 11px; padding: 2px 4px; text-decoration: underline;
}

/* ── Applications tab (signups from start.guest2go.com) ───────────────── */
.nav-badge {
  display: inline-block;
  margin-left: 6px; padding: 1px 7px;
  background: #F44336; color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 10px; min-width: 16px; text-align: center;
  vertical-align: middle;
}

.applications-list { display: flex; flex-direction: column; gap: 10px; }

.app-card {
  background: var(--card, #0d1f33);
  border: 1px solid var(--border, #1f3b5e);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s;
}
.app-card[open] { border-color: #1B6EF3; }
.app-card[open] .app-card-summary { border-bottom: 1px solid var(--border, #1f3b5e); }

.app-card-summary {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.app-card-summary::-webkit-details-marker { display: none; }
.app-card-summary::before {
  content: '▶'; color: var(--mid); font-size: 10px;
  transition: transform .15s; flex-shrink: 0;
}
.app-card[open] .app-card-summary::before { transform: rotate(90deg); }

.app-card-main { flex: 1; min-width: 0; }
.app-card-hotel {
  font-size: 15px; font-weight: 600; color: var(--text, #fff);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-card-meta {
  font-size: 12px; color: var(--mid); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.app-card-tier { font-size: 12px; font-weight: 600; }
.app-card-time { font-size: 11px; color: var(--mid); }

.app-card-body { padding: 18px 18px 16px; }
.app-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 6px 18px;
}
.app-field {
  display: flex; gap: 10px; padding: 4px 0;
  border-bottom: 1px solid rgba(31, 59, 94, 0.4);
  font-size: 13px;
}
.app-field-key {
  flex-shrink: 0; min-width: 110px;
  color: var(--mid); font-weight: 500;
}
.app-field-val { color: var(--text, #fff); word-break: break-word; }

.app-notes {
  margin-top: 14px; padding: 12px 14px;
  background: rgba(27, 110, 243, 0.05);
  border: 1px solid rgba(27, 110, 243, 0.25);
  border-radius: 8px;
}
.app-notes-label {
  font-size: 11px; letter-spacing: 1px;
  color: #1B6EF3; text-transform: uppercase; font-weight: 700;
  margin-bottom: 6px;
}
.app-notes-body { font-size: 13px; color: var(--text, #fff); white-space: pre-wrap; }

.app-card-actions {
  display: flex; gap: 8px; align-items: center;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border, #1f3b5e);
}
.btn-danger {
  background: #5a1a1a; color: #FF8A80; border: 1px solid #8b2727;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-family: inherit;
  transition: background .15s, border-color .15s;
}
.btn-danger:hover { background: #8b2727; border-color: #F44336; color: #fff; }
