﻿/* ============================================================
   WhatsApp Multi-Device API — Premium White Dashboard
   Pure CSS — No Frameworks
   ============================================================ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg-root:        #f0f2f5;
  --bg-nav:         #ffffff;
  --bg-card:        #ffffff;
  --bg-input:       #f8f9fc;
  --bg-modal:       #ffffff;

  --border:         #e4e8ef;
  --border-light:   #eef1f6;
  --border-focus:   #128C7E;

  --primary:        #128C7E;
  --primary-hover:  #0f7269;
  --primary-dim:    rgba(18, 140, 126, 0.08);
  --primary-glow:   rgba(18, 140, 126, 0.2);

  --accent:         #25d366;
  --accent-dim:     rgba(37, 211, 102, 0.1);

  --text-1:         #111827;
  --text-2:         #4b5563;
  --text-3:         #9ca3af;
  --text-inv:       #ffffff;

  --red:            #dc2626;
  --red-dim:        rgba(220, 38, 38, 0.08);
  --amber:          #d97706;
  --amber-dim:      rgba(217, 119, 6, 0.1);
  --green:          #059669;
  --green-dim:      rgba(5, 150, 105, 0.1);

  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      20px;

  --shadow-sm:      0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-card:    0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-nav:     0 1px 0 var(--border);
  --shadow-modal:   0 20px 60px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.1);

  --transition:     0.18s ease;
  --font:           'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 18px; }
body {
  font-family: var(--font);
  background: var(--bg-root);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Utilities ──────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-root); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-ring {
  0%   { transform: scale(1);    opacity: 1; }
  100% { transform: scale(2.2);  opacity: 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}

/* ═══════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════ */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(145deg, #f0f4ff 0%, #e8f5e9 50%, #f0f2f5 100%);
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-modal);
  animation: fadeUp 0.35s ease both;
}

/* Brand */
.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.login-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* W letter mark */
.login-brand-mark::after {
  content: 'W';
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.05em;
}

.login-brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
}
.login-brand p {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 1px;
}

.login-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 1.75rem;
}

/* Form */
.login-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.login-input-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.login-input-wrap input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.login-input-wrap input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-dim);
  background: #fff;
}
.login-input-wrap input::placeholder { color: var(--text-3); }

.btn-login {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  letter-spacing: 0.01em;
}
.btn-login:hover  { background: var(--primary-hover); box-shadow: 0 4px 14px var(--primary-glow); }
.btn-login:active { transform: scale(0.98); }

.login-error {
  margin-top: 0.9rem;
  padding: 0.65rem 0.9rem;
  background: var(--red-dim);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   NAV HEADER
   ═══════════════════════════════════════════════════════════ */
.nav-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  box-shadow: var(--shadow-nav);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-brand-mark::after {
  content: 'W';
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.05em;
}

.nav-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.nav-brand-name span {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-status-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-dim);
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  border: 1px solid rgba(18, 140, 126, 0.15);
}

.nav-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
}
.nav-status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: pulse-ring 1.8s ease-out infinite;
}

.btn-logout {
  padding: 0.4rem 1rem;
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.01em;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD WRAPPER
   ═══════════════════════════════════════════════════════════ */
.dashboard-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Stats Bar ──────────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.3s ease both;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-card); }

.stat-bar-accent {
  width: 4px;
  height: 40px;
  border-radius: 99px;
  flex-shrink: 0;
}
.stat-bar-accent.green  { background: var(--green); }
.stat-bar-accent.teal   { background: var(--primary); }
.stat-bar-accent.amber  { background: var(--amber); }

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 500;
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.35s ease both;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}
.section-head h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

/* ── Add Device Row ─────────────────────────────────────── */
.add-device-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.add-device-row .field { flex: 1; min-width: 160px; margin-bottom: 0; }

/* ── Form Fields ────────────────────────────────────────── */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-dim);
  background: #fff;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-3); }
.field textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 4px 12px var(--primary-glow); }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--primary-dim); border-color: var(--primary); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--border);
}
.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-root); color: var(--text-1); }

.btn-sm  { padding: 0.4rem 0.85rem; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-full { width: 100%; justify-content: center; }

/* ── Devices Grid ───────────────────────────────────────── */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.device-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.device-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  border-radius: 2px 0 0 2px;
}
.device-card.ready::before       { background: var(--green); }
.device-card.connecting::before  { background: var(--amber); }
.device-card.disconnected::before{ background: var(--border); }
.device-card:hover { box-shadow: var(--shadow-card); border-color: #d1d5db; }

.dc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.dc-id {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

.dc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dc-badge.ready       { background: var(--green-dim); color: var(--green); border: 1px solid rgba(5,150,105,0.2); }
.dc-badge.connecting  { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(217,119,6,0.2); }
.dc-badge.disconnected{ background: #f3f4f6; color: var(--text-3); border: 1px solid var(--border); }

.dc-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dc-badge.ready .dc-badge-dot       { background: var(--green); }
.dc-badge.connecting .dc-badge-dot  { background: var(--amber); }
.dc-badge.disconnected .dc-badge-dot{ background: var(--text-3); }

.dc-info {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.dc-info span { color: var(--text-2); }

.dc-qr {
  margin: 0.9rem 0;
  text-align: center;
  padding: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dc-qr img {
  max-width: 160px;
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto 0.5rem;
}
.dc-qr-hint {
  font-size: 0.73rem;
  color: var(--text-3);
  line-height: 1.4;
}

.dc-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

/* ── Device Select Bar ──────────────────────────────────── */
.device-select-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.device-select-bar label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.device-select-bar select {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 2.2rem 0.6rem 0.9rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.875rem;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.device-select-bar select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-dim);
  background-color: #fff;
}

/* ── Send Tabs ──────────────────────────────────────────── */
.send-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
}

.send-tab {
  padding: 0.65rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  letter-spacing: 0.01em;
}
.send-tab:hover  { color: var(--text-1); }
.send-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.send-panel { display: none; }
.send-panel.active { display: block; animation: fadeUp 0.2s ease both; }

/* ── Feedback ───────────────────────────────────────────── */
.feedback {
  display: none;
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.feedback.show   { display: block; animation: fadeUp 0.2s ease both; }
.feedback.success{ background: var(--green-dim);   border-left-color: var(--green); color: var(--green); }
.feedback.error  { background: var(--red-dim);     border-left-color: var(--red);   color: var(--red); }
.feedback.info   { background: var(--primary-dim); border-left-color: var(--primary); color: var(--primary); }

/* ── Spinner ────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
.spinner.dark {
  border-color: rgba(18,140,126,0.2);
  border-top-color: var(--primary);
}

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-3);
}
.empty-state-marker {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  border: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-3);
}
.empty-state p { font-size: 0.875rem; color: var(--text-3); }

/* ── FAB ────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  padding: 0.7rem 1.4rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  letter-spacing: 0.02em;
  z-index: 90;
}
.fab:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 24px var(--primary-glow); }
.fab:active { transform: scale(0.97) translateY(0); }

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-overlay.show { display: flex; }

.modal-box {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: fadeUp 0.25s ease both;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-head h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}
.modal-close:hover { background: var(--red-dim); border-color: var(--red); color: var(--red); }

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}

/* ── API Docs ────────────────────────────────────────────── */
.api-notice {
  display: flex;
  gap: 0.6rem;
  background: var(--amber-dim);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.api-notice strong { color: var(--amber); }
.api-notice code {
  font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.8rem;
  background: rgba(217, 119, 6, 0.12);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  color: var(--amber);
}

.api-group { margin-bottom: 1.25rem; }
.api-group h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.6rem;
}

.api-divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

.api-key-display {
  font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.82rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  color: var(--primary);
  word-break: break-all;
  letter-spacing: 0.04em;
}

.api-endpoint-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-2);
}

.endpoint-path {
  font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--text-1);
}

.http-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-family: var(--font);
  flex-shrink: 0;
}
.http-get  { background: var(--accent-dim);   color: #047857; border: 1px solid rgba(37,211,102,0.2); }
.http-post { background: var(--primary-dim);  color: var(--primary); border: 1px solid rgba(18,140,126,0.2); }
.http-del  { background: var(--red-dim);      color: var(--red); border: 1px solid rgba(220,38,38,0.2); }

.api-code {
  font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.78rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
  margin-top: 0.5rem;
}

.api-param-list {
  list-style: none;
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.api-param-list li {
  font-size: 0.8rem;
  color: var(--text-2);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.param-name {
  font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.75rem;
  background: var(--primary-dim);
  color: var(--primary);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-3);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .nav-inner { padding: 0 1rem; }
  .nav-brand-name span { display: none; }
  .dashboard-wrap { padding: 1rem; }

  .stats-bar { grid-template-columns: 1fr; gap: 0.75rem; }
  .stat-card  { padding: 1rem 1.25rem; }

  .card { padding: 1.25rem; }

  .add-device-row { flex-direction: column; }
  .add-device-row .btn { width: 100%; }

  .devices-grid { grid-template-columns: 1fr; }

  .send-tabs { overflow-x: auto; }
  .send-tab  { white-space: nowrap; }

  .device-select-bar { flex-direction: column; align-items: stretch; }
  .device-select-bar select { min-width: unset; }

  .fab { bottom: 1rem; right: 1rem; padding: 0.65rem 1.2rem; }
  .modal-box { max-height: 95vh; border-radius: var(--radius-lg); }
}

