@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

/* Dinucci Zeroize - Dashboard Dark Theme */

:root {
  --bg-primary: #07070D;
  --bg-card: #1A1A2E;
  --bg-card-hover: #222240;
  --bg-input: #12121E;
  --gold: #C9A84C;
  --gold-hover: #b8963f;
  --gold-dim: rgba(201, 168, 76, 0.15);
  --text-primary: #FFFFFF;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --border: #2A2A3E;
  --success: #22C55E;
  --danger: #DC2626;
  --danger-hover: #B91C1C;
  --warning: #F59E0B;
  --info: #3B82F6;
  --sidebar-width: 320px;
  --header-height: 56px;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3, .brand, .sidebar-title {
  font-family: 'Space Grotesk', sans-serif;
}

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

/* ===== LOGIN PAGE ===== */

.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  color: var(--gold);
  font-size: 22px;
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 6px;
}

.login-box .subtitle {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  margin-bottom: 28px;
}

.login-box .tab-row {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.login-box .tab-row button {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.login-box .tab-row button.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--gold);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.97); }

.btn-gold {
  background: var(--gold);
  color: var(--bg-primary);
  width: 100%;
}

.btn-gold:hover { background: var(--gold-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover { background: var(--danger-hover); }

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  min-height: 20px;
}

/* ===== DASHBOARD LAYOUT ===== */

.dashboard {
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-areas:
    "header header"
    "sidebar main";
  min-height: 100vh;
}

/* Header */
.header {
  grid-area: header;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.header-brand {
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-email {
  color: var(--text-secondary);
  font-size: 13px;
}

.header .btn-outline {
  padding: 5px 14px;
  font-size: 12px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0;
}

.sidebar-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 16px;
  margin-bottom: 10px;
}

.device-list {
  list-style: none;
}

.device-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.device-item:hover {
  background: var(--bg-card-hover);
}

.device-item.active {
  background: var(--gold-dim);
  border-left-color: var(--gold);
}

.device-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.device-dot.online { background: var(--success); }
.device-dot.offline { background: var(--text-muted); }

.device-name {
  font-size: 13px;
  font-weight: 500;
  white-space: normal;
  word-wrap: break-word;
}

.device-status {
  font-size: 11px;
  color: var(--text-muted);
}

.no-devices {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px 16px;
  text-align: center;
}

/* Main content */
.main {
  grid-area: main;
  overflow-y: auto;
  padding: 20px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover { color: var(--text-secondary); }

.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== MAP TAB ===== */

.map-container {
  width: 100%;
  height: 450px;
  background: var(--bg-input);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 14px;
  flex-direction: column;
  gap: 10px;
}

.map-placeholder .icon { font-size: 36px; opacity: 0.4; }

.location-info {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.location-info .info-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.location-info .info-chip strong {
  color: var(--gold);
}

/* ===== COMMANDS TAB ===== */

.cmd-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.cmd-section {
  border-radius: 12px;
  overflow: visible;
  border: 1px solid rgba(201, 168, 76, 0.12);
  background: linear-gradient(145deg, var(--bg-card) 0%, #13132a 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: box-shadow 0.2s;
}

.cmd-section:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.cmd-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(90deg, rgba(201,168,76,0.06) 0%, transparent 100%);
  border-bottom: 1px solid transparent;
  transition: background 0.2s;
}

.cmd-section.open .cmd-section-header {
  border-bottom-color: rgba(201,168,76,0.15);
  background: linear-gradient(90deg, rgba(201,168,76,0.10) 0%, transparent 100%);
}

.cmd-section-header:hover {
  background: linear-gradient(90deg, rgba(201,168,76,0.14) 0%, rgba(201,168,76,0.03) 100%);
}

.cmd-section-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201,168,76,0.1);
  border-radius: 8px;
  flex-shrink: 0;
}

.cmd-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  flex: 1;
  color: var(--gold);
}

.cmd-section-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(201,168,76,0.12);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(201,168,76,0.2);
}

.cmd-section-chevron {
  font-size: 12px;
  color: var(--gold);
  opacity: 0.5;
  transition: transform 0.3s ease, opacity 0.2s;
}

.cmd-section.open .cmd-section-chevron {
  transform: rotate(180deg);
  opacity: 0.8;
}

.cmd-section-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 10px;
  padding: 16px;
  background: rgba(0,0,0,0.15);
  overflow: visible;
  border-radius: 0 0 12px 12px;
}

.cmd-section.open .cmd-section-grid {
  display: grid;
}

/* All section titles use gold — unified premium look */

/* Danger zone special */
.cmd-section[data-cat="danger"] {
  border-color: rgba(220, 38, 38, 0.25);
  background: linear-gradient(145deg, #1a1020 0%, #150a0a 100%);
}
.cmd-section[data-cat="danger"] .cmd-section-title { color: var(--danger); }
.cmd-section[data-cat="danger"] .cmd-section-icon { background: rgba(220,38,38,0.12); }
.cmd-section[data-cat="danger"] .cmd-section-count {
  color: var(--danger);
  background: rgba(220,38,38,0.1);
  border-color: rgba(220,38,38,0.2);
}
.cmd-section[data-cat="danger"] .cmd-section-header {
  background: linear-gradient(90deg, rgba(220,38,38,0.06) 0%, transparent 100%);
}

.cmd-btn {
  background: linear-gradient(145deg, #1a1a30 0%, #12121e 100%);
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: 10px;
  padding: 14px 8px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.cmd-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(201,168,76,0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}

.cmd-btn:hover::before { opacity: 1; }

.cmd-btn:active { transform: scale(0.95); }

.cmd-btn .cmd-icon {
  font-size: 22px;
  filter: saturate(0.8);
  transition: filter 0.2s, transform 0.2s;
}

.cmd-btn:hover {
  border-color: rgba(201,168,76,0.4);
  color: var(--text-primary);
  box-shadow: 0 2px 12px rgba(201,168,76,0.1);
}

.cmd-btn:hover .cmd-icon {
  filter: saturate(1.2);
  transform: scale(1.1);
}

.cmd-btn.danger-cmd {
  border-color: rgba(220, 38, 38, 0.25);
  color: #FCA5A5;
}

.cmd-btn.danger-cmd::before {
  background: linear-gradient(145deg, rgba(220,38,38,0.08) 0%, transparent 60%);
}

.cmd-btn.danger-cmd:hover {
  border-color: rgba(220,38,38,0.5);
  box-shadow: 0 2px 12px rgba(220,38,38,0.15);
}

.response-area {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  min-height: 200px;
  max-height: 500px;
  overflow-y: auto;
}

.response-area h3 {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.response-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.response-entry:last-child { border-bottom: none; }

.response-entry .re-cmd {
  color: var(--gold);
  font-weight: 600;
  font-size: 12px;
}

.response-entry .re-time {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 8px;
}

.response-entry .re-body {
  margin-top: 4px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.response-entry img,
.response-entry video {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  margin-top: 8px;
}

.response-entry .re-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.re-status.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.re-status.completed { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.re-status.failed { background: rgba(220, 38, 38, 0.15); color: var(--danger); }

/* ===== LIVE TAB ===== */

.live-panel {
  text-align: center;
}

.live-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.live-status {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 14px;
}

.live-status.connected { color: var(--success); }
.live-status.error { color: var(--danger); }

.live-video {
  width: 100%;
  max-width: 720px;
  max-height: 60vh;
  background: var(--bg-input);
  border-radius: 10px;
  border: 1px solid var(--border);
  display: none;
  margin: 0 auto;
}

.live-video.visible { display: block; }

/* ===== SETTINGS TAB ===== */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 700px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.settings-card h3 {
  font-size: 13px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.settings-card .form-group {
  margin-bottom: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.toggle-row span {
  font-size: 14px;
  color: var(--text-secondary);
}

.toggle {
  position: relative;
  width: 42px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--gold);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ===== HISTORY TAB ===== */

.history-table-wrap {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th {
  text-align: left;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-table tr:hover td {
  background: var(--bg-card-hover);
}

.history-table .cmd-cell {
  color: var(--gold);
  font-weight: 600;
}

/* ===== MODALS ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  display: none;
}

.modal-overlay.visible { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 400px;
}

.modal h2 {
  font-size: 16px;
  margin-bottom: 12px;
}

.modal p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== SPINNER ===== */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main";
  }

  .sidebar {
    position: fixed;
    left: -100%;
    top: var(--header-height);
    bottom: 0;
    width: 80%;
    max-width: var(--sidebar-width);
    z-index: 90;
    transition: left 0.25s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: rgba(0, 0, 0, 0.5);
    z-index: 89;
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .menu-toggle {
    display: block;
  }

  .main {
    padding: 14px;
  }

  .header {
    padding: 0 12px;
  }

  .header-right {
    gap: 8px;
  }

  .header-email {
    font-size: 11px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-brand {
    font-size: 13px;
    letter-spacing: 2px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .cmd-sections {
    gap: 8px;
  }

  .cmd-section-header {
    padding: 16px 14px;
    gap: 10px;
  }

  .cmd-section-title {
    font-size: 12px;
    letter-spacing: 1px;
  }

  .cmd-section-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .cmd-btn {
    padding: 16px 6px;
    font-size: 11px;
    min-height: 70px;
    border-radius: 10px;
  }

  .cmd-btn .cmd-icon {
    font-size: 24px;
  }

  .btn {
    min-height: 44px;
  }

  .map-container {
    height: 300px;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tabs {
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 10px 16px;
    font-size: 12px;
  }

  .modal {
    margin: 16px;
    max-width: calc(100% - 32px);
  }

  .login-box {
    padding: 28px 20px;
  }

  .response-area {
    min-height: 150px;
  }

  .location-info {
    gap: 10px;
  }

  .live-video {
    max-height: 50vh;
  }

  /* Hide tooltips on touch devices */
  .cmd-btn[data-tooltip]:hover::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 10px;
  }

  .tab-btn {
    padding: 10px 14px;
    font-size: 12px;
  }

  .cmd-sections {
    gap: 6px;
  }

  .cmd-section-header {
    padding: 14px 12px;
  }

  .cmd-section-icon {
    font-size: 18px;
    width: 28px;
    height: 28px;
  }

  .cmd-section-title {
    font-size: 11px;
  }

  .cmd-section-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
  }

  .cmd-btn {
    padding: 14px 4px;
    font-size: 10px;
    min-height: 64px;
    gap: 4px;
  }

  .cmd-btn .cmd-icon {
    font-size: 22px;
  }

  .response-area {
    padding: 12px;
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .cmd-section-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .cmd-btn {
    padding: 16px 6px;
    font-size: 11px;
    min-height: 72px;
  }

  .cmd-btn .cmd-icon {
    font-size: 26px;
  }
}

/* ===== TOOLTIPS ===== */

.cmd-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #e5e7eb;
    font-size: 11px;
    font-weight: 400;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(201,168,76,0.3);
    white-space: normal;
    max-width: 200px;
    width: max-content;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    line-height: 1.4;
}

/* Hide tooltips when disabled */
body.no-tooltips .cmd-btn[data-tooltip]:hover::after {
    display: none;
}

/* ===== BILLING SECTION ===== */

.billing-current-plan {
    background: linear-gradient(145deg, var(--bg-card) 0%, #13132a 100%);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.billing-current-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.billing-plan-badge {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold);
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid rgba(201, 168, 76, 0.25);
    padding: 4px 16px;
    border-radius: 6px;
    margin-right: 12px;
}

.billing-badge-pro {
    color: var(--info);
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
}

.billing-badge-commander {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.25);
}

.billing-badge-basic {
    color: var(--success);
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
}

.billing-plan-status {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.billing-plan-status.active {
    color: var(--success);
}

.billing-plan-status.expired {
    color: var(--danger);
}

.billing-plan-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Billing period toggle */

.billing-period-toggle {
    display: flex;
    gap: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
    margin: 0 auto 28px auto;
}

.billing-period-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.billing-period-btn.active {
    background: var(--gold);
    color: var(--bg-primary);
}

.billing-period-btn:hover:not(.active) {
    color: var(--text-primary);
}

.billing-save-tag {
    font-size: 10px;
    font-weight: 700;
    background: var(--success);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

/* Plans grid */

.billing-plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.billing-plan-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, #13132a 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.billing-plan-card:hover {
    border-color: rgba(201, 168, 76, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.billing-plan-recommended {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.1);
}

.billing-recommended-tag {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--bg-primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 3px 14px;
    border-radius: 10px;
    white-space: nowrap;
}

.billing-plan-card-header {
    margin-bottom: 16px;
    text-align: center;
}

.billing-plan-card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 8px;
}

.billing-plan-price {
    margin-bottom: 2px;
}

.billing-price-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.billing-price-period {
    font-size: 13px;
    color: var(--text-muted);
}

.billing-price-brl {
    margin-top: 4px;
}

.billing-price-amount-brl {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.billing-price-period-brl {
    font-size: 11px;
    color: var(--text-muted);
}

.billing-plan-features {
    list-style: none;
    flex: 1;
    margin-bottom: 16px;
}

.billing-plan-features li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.billing-plan-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
    font-size: 12px;
}

.billing-plan-card-footer {
    text-align: center;
}

.billing-plan-card-footer .btn {
    width: 100%;
}

/* Checkout Modal */

.checkout-method-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.checkout-method-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.checkout-method-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.checkout-method-tab:hover:not(.active) {
    color: var(--text-secondary);
}

.checkout-summary {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkout-summary-total {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--gold);
}

.checkout-note {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

/* Billing responsive */

@media (max-width: 1024px) {
    .billing-plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .billing-plans-grid {
        grid-template-columns: 1fr;
    }

    .billing-current-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .billing-plan-meta {
        flex-direction: column;
        gap: 4px;
    }

    .billing-period-toggle {
        width: 100%;
    }

    .billing-period-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
    }
}

/* ===== NEW SECTIONS: Map, Timeline, Gallery, Audio ===== */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: #e4e4e7;
}
.date-picker {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 4px 8px;
  color: #e4e4e7;
  font-size: 0.8rem;
}
.map-section, .timeline-section, .gallery-section, .audio-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-card, #0D0F14);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}

/* Activity Timeline */
.activity-timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid rgba(255,255,255,0.06);
}
.timeline-item {
  position: relative;
  padding: 12px 0 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -29px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg-primary);
}
.timeline-item .time {
  font-size: 0.7rem;
  color: #666;
}
.timeline-item .event {
  font-size: 0.85rem;
  color: #d1d5db;
  margin-top: 2px;
}
.timeline-item.alert::before {
  background: #DC2626;
}

/* Photo Gallery */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.gallery-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Audio List */
.audio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.audio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}
.audio-item audio {
  flex: 1;
  height: 32px;
}
.audio-item .audio-meta {
  font-size: 0.75rem;
  color: #666;
}

/* ===== WHATSAPP READER ===== */
.whatsapp-section {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.whatsapp-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.whatsapp-section .section-header h3 {
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 1px;
}
.whatsapp-chat {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wa-msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  word-break: break-word;
}
.wa-msg.received {
  background: #1a2e1a;
  border: 1px solid rgba(34,197,94,0.2);
  align-self: flex-start;
  color: #d1d5db;
}
.wa-msg.sent {
  background: #1a1a2e;
  border: 1px solid rgba(99,102,241,0.2);
  align-self: flex-end;
  color: #d1d5db;
}
.wa-msg .wa-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: #22C55E;
  margin-bottom: 2px;
}
.wa-msg .wa-time {
  font-size: 0.65rem;
  color: #666;
  margin-top: 2px;
  text-align: right;
}
.wa-msg.sent .wa-name {
  color: #818cf8;
}

/* CSP hover effect replacement for inline onmouseover/onmouseout */
.hover-dim { transition: opacity 0.2s; }
.hover-dim:hover { opacity: 0.85; }
