/* ═══════════════════════════════════════
   BOSS INSTALLATIONS - Admin Stylesheet
   ═══════════════════════════════════════ */

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

:root {
  --primary: #00d4ff;
  --primary-dark: #0099cc;
  --accent: #00ff88;
  --danger: #ff6b6b;
  --warning: #ffa726;
  --bg-dark: #0a0e1a;
  --bg-sidebar: #0d1220;
  --bg-card: #131a2e;
  --bg-card-hover: #1a2340;
  --bg-input: #0a0e1a;
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --text-muted: #64748b;
  --border: #1e293b;
  --radius: 10px;
  --transition: 0.3s ease;
}

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--bg-dark);
  border-color: var(--primary);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
  transform: translateY(-1px);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-danger:hover {
  background: rgba(255, 107, 107, 0.1);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: rgba(0, 212, 255, 0.1);
}

.export-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.export-buttons a {
  text-decoration: none;
}

/* ─── LOGIN SCREEN ─── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  padding: 24px;
}

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

.login-logo svg {
  width: 60px;
  height: 72px;
  margin-bottom: 20px;
}

.login-card h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.login-card > p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 32px;
}

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 12px;
  min-height: 20px;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--primary);
}

/* ─── FORM ─── */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  cursor: pointer;
  appearance: none;
}

/* ─── DASHBOARD LAYOUT ─── */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.sidebar-logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.15em;
  color: var(--text-primary);
}

.shield-o {
  color: var(--primary);
}

.sidebar-subtitle {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all var(--transition);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(0, 212, 255, 0.1);
  color: var(--primary);
}

.badge {
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: auto;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.back-to-site {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.back-to-site:hover {
  color: var(--primary);
}

.sidebar-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-footer-row span {
  color: var(--text-secondary);
}

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}

.logout-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 32px;
  min-height: 100vh;
}

.tab-content {
  display: none;
}

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

.tab-content h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  margin-bottom: 24px;
}

/* ─── STATS GRID ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}

.stat-card.accent {
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.05);
}

.stat-value {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 2.4rem;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── OVERVIEW ─── */
.overview-sections {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

.overview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.overview-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.recent-item:last-child {
  border-bottom: none;
}

.recent-item .name {
  font-weight: 600;
  color: var(--text-primary);
}

.recent-item .service {
  color: var(--primary);
  font-size: 0.8rem;
}

.recent-item .date {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.breakdown-item:last-child {
  border-bottom: none;
}

.breakdown-item .count {
  color: var(--primary);
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
}

/* ─── TAB HEADER ─── */
.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.tab-header h2 {
  margin-bottom: 0;
}

.tab-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  width: 220px;
  transition: border-color var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
}

/* ─── DATA TABLE ─── */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.data-table th {
  background: var(--bg-sidebar);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  text-align: left;
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
  background: rgba(0, 212, 255, 0.02);
}

.data-table .actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition);
}

.action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.action-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.action-btn.success:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.unread {
  background: var(--primary);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── SETTINGS ─── */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
}

.settings-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.password-status {
  margin-bottom: 16px;
  font-size: 0.85rem;
  min-height: 20px;
}

.password-status.success {
  color: var(--accent);
}

.password-status.error {
  color: var(--danger);
}

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-body .form-group:last-of-type {
  margin-bottom: 24px;
}

.detail-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 100px;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.detail-value {
  color: var(--text-primary);
  flex: 1;
}

/* ─── MOBILE HEADER ─── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  z-index: 150;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
}

.sidebar-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.sidebar-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.sidebar-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.sidebar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.sidebar-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-brand {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
}

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

/* ─── MOBILE TABLE CARDS ─── */
.mobile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.mobile-card .mobile-card-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.85rem;
}

.mobile-card .mobile-card-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
}

.mobile-card .mobile-card-value {
  color: var(--text-primary);
  text-align: right;
}

.mobile-card .mobile-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    width: 260px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 72px 16px 24px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .overview-sections {
    grid-template-columns: 1fr;
  }
  .tab-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .tab-actions {
    flex-wrap: wrap;
    width: 100%;
  }
  .search-input {
    width: 100%;
  }
  .data-table {
    display: none;
  }
  .table-container .mobile-cards {
    display: block;
  }
  .modal {
    max-width: 95vw;
    margin: 12px;
  }
  .modal-body {
    padding: 16px;
  }
  .detail-row {
    flex-direction: column;
    gap: 4px;
  }
}

@media (min-width: 769px) {
  .table-container .mobile-cards {
    display: none;
  }
}
