/* ═══════════════════════════════════════════════════════
   WLAN Management — Global Styles
   ═══════════════════════════════════════════════════════ */

:root {
  --sidebar-width:    240px;
  --sidebar-bg:       #1e293b;
  --sidebar-text:     #94a3b8;
  --sidebar-hover:    #334155;
  --sidebar-active:   #0d6efd;
  --primary:          #0d6efd;
  --success:          #198754;
  --header-height:    56px;
}

* { box-sizing: border-box; }

body { margin: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; }

/* ── Public Pages (Login, Reset) ─────────────────────────── */
.public-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.public-container {
  width: 100%;
  max-width: 440px;
}

.public-logo {
  text-align: center;
  margin-bottom: 28px;
  color: #1e293b;
}
.public-logo i {
  font-size: 2.5rem;
  color: var(--primary);
  display: block;
  margin-bottom: 8px;
}
.public-logo span {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.public-card {
  border: none;
  border-radius: 16px;
}

/* ── Create User Page ──────────────────────────────────────── */
.create-body {
  background: #f8fafc;
  min-height: 100vh;
}

.create-navbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  height: var(--header-height);
}

/* Credentials Box */
.credentials-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
}
.cred-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #bbf7d0;
}
.cred-row:last-child { border-bottom: none; }
.cred-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  width: 80px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cred-value {
  font-weight: 500;
  color: #111827;
  word-break: break-all;
}
.cred-password {
  font-family: 'Courier New', monospace;
  font-size: 1.15em;
  letter-spacing: 2px;
  color: #065f46;
  font-weight: 700;
}

.success-icon { animation: popIn 0.4s ease; }
@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── Admin Layout ─────────────────────────────────────────── */
.admin-body {
  display: flex;
  min-height: 100vh;
  background: #f1f5f9;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 1px solid #334155;
}
.sidebar-header i { color: var(--primary); font-size: 1.4rem; }
.sidebar-brand-text { letter-spacing: -0.3px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}
.sidebar-link.active {
  background: rgba(13, 110, 253, 0.15);
  color: #60a5fa;
}
.sidebar-link i { font-size: 1rem; flex-shrink: 0; width: 18px; text-align: center; }

.sidebar-divider {
  height: 1px;
  background: #334155;
  margin: 8px 4px;
}

.sidebar-footer {
  padding: 12px 12px;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--sidebar-text);
  border-radius: 8px;
  padding: 6px 8px;
  transition: background 0.15s;
}
.sidebar-user:hover { background: var(--sidebar-hover); color: #e2e8f0; }

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-username {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-role {
  font-size: 0.7rem;
  color: var(--sidebar-text);
}
.sidebar-logout {
  color: var(--sidebar-text);
  padding: 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.sidebar-logout:hover { background: var(--sidebar-hover); color: #f87171; }

/* Main Content */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.admin-content {
  padding: 28px 32px;
  flex: 1;
}

/* Mobile Header */
.mobile-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 16px;
  align-items: center;
}

/* Sidebar Mobile Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-content {
    padding: 20px 16px;
  }
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
  letter-spacing: -0.3px;
}
.page-subtitle {
  margin: 0;
  font-size: 0.875rem;
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.stat-icon-blue   { background: #dbeafe; color: #2563eb; }
.stat-icon-green  { background: #dcfce7; color: #16a34a; }
.stat-icon-purple { background: #ede9fe; color: #7c3aed; }
.stat-icon-orange { background: #ffedd5; color: #ea580c; }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

/* ── Status Row ───────────────────────────────────────────── */
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
}
.status-row:last-child { border-bottom: none; }

/* ── User Avatar (small) ──────────────────────────────────── */
.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dbeafe;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Log Badges ───────────────────────────────────────────── */
.log-badge { font-weight: 500; letter-spacing: 0.3px; font-size: 0.72rem; }
.log-badge-create_user     { background: #dbeafe !important; color: #1d4ed8 !important; }
.log-badge-login           { background: #dcfce7 !important; color: #15803d !important; }
.log-badge-logout          { background: #f3f4f6 !important; color: #6b7280 !important; }
.log-badge-reset_requested { background: #fef9c3 !important; color: #92400e !important; }
.log-badge-reset_completed { background: #d1fae5 !important; color: #065f46 !important; }
.log-badge-settings_updated{ background: #ede9fe !important; color: #6d28d9 !important; }
.log-badge-user_created    { background: #ffedd5 !important; color: #9a3412 !important; }
.log-badge-template_updated{ background: #fce7f3 !important; color: #9d174d !important; }
.log-badge-password_changed{ background: #ecfdf5 !important; color: #064e3b !important; }

/* ── Cards global ─────────────────────────────────────────── */
.card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: none;
}
.card-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 12px 12px 0 0 !important;
  padding: 12px 16px;
  font-size: 0.875rem;
}

/* ── Utilities ────────────────────────────────────────────── */
.font-monospace { font-family: 'Courier New', monospace; }

/* Table adjustments */
.table > :not(caption) > * > * { padding: 10px 8px; }
.table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}
