/* ===========================
   PushNotify - Main Stylesheet
   Color Scheme: #00adee, #f8f9fa, white
=========================== */

:root {
  --primary: #00adee;
  --primary-dark: #0090cc;
  --primary-light: #e3f6ff;
  --bg: #ffffff;
  --surface: #f8f9fa;
  --border: #e9ecef;
  --text: #212529;
  --text-muted: #6c757d;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--surface);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ===========================
   SIDEBAR
=========================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s;
  box-shadow: var(--shadow);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.sidebar-logo i { font-size: 1.4rem; }

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover { background: var(--primary-light); color: var(--primary); }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-link i { width: 18px; text-align: center; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}

.user-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: var(--text-muted); text-transform: capitalize; }

.logout-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}
.logout-btn:hover { background: #ffebee; color: var(--danger); }

/* ===========================
   MAIN CONTENT
=========================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  background: none; border: none;
  font-size: 1.1rem; color: var(--text-muted);
  cursor: pointer; padding: 6px;
  border-radius: 6px;
  display: none;
}
.menu-toggle:hover { background: var(--surface); }

.page-title { font-size: 1.1rem; font-weight: 700; flex: 1; }
.topbar-right { color: var(--text-muted); font-size: 0.9rem; }
.topbar-user { display: flex; align-items: center; gap: 6px; }

.page-body { padding: 24px; flex: 1; }

/* ===========================
   CARDS
=========================== */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h3 i { color: var(--primary); }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }
.mt-4 { margin-top: 20px; }

/* ===========================
   BUTTONS
=========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

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

.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #000; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 0.85rem; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* ===========================
   FORMS
=========================== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-label i { margin-right: 4px; color: var(--primary); }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 173, 238, 0.15);
}

.form-control-sm { padding: 7px 12px; font-size: 0.85rem; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 100px; }

.input-group { display: flex; position: relative; }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-toggle {
  border: 1px solid var(--border);
  border-left: none;
  background: var(--surface);
  padding: 0 12px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  color: var(--text-muted);
}
.input-toggle:hover { color: var(--primary); }

/* ===========================
   ALERTS
=========================== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: opacity 0.5s;
}

.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }

/* ===========================
   BADGES
=========================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-muted { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.badge-warning { background: #fff8e1; color: #e65100; }
.badge-all { background: var(--primary-light); color: var(--primary); }
.badge-individual { background: #f3e5f5; color: #6a1b9a; }
.badge-selected { background: #fff3e0; color: #e65100; }

/* ===========================
   TABLE
=========================== */
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  background: var(--surface);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface); }

.user-cell { display: flex; align-items: center; gap: 10px; }
.mini-avatar {
  width: 30px; height: 30px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0;
}

.action-btns { display: flex; gap: 6px; align-items: center; }
.card-header-actions { display: flex; gap: 8px; align-items: center; }

/* ===========================
   STATS GRID
=========================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-number { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ===========================
   DASHBOARD GRID
=========================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
  margin-bottom: 20px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  transition: all 0.2s;
  color: var(--text);
}

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

.quick-action-btn i { font-size: 1.2rem; color: var(--primary); }
.quick-action-btn strong { display: block; font-size: 0.875rem; }
.quick-action-btn small { color: var(--text-muted); font-size: 0.78rem; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; padding-bottom: 0; }

.notif-icon {
  width: 32px; height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.notif-content { flex: 1; min-width: 0; }
.notif-content strong { display: block; font-size: 0.875rem; }
.notif-content small { display: block; color: var(--text-muted); font-size: 0.78rem; margin: 2px 0 4px; }
.notif-meta { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-muted); }

/* ===========================
   SEND NOTIFICATION FORM
=========================== */
.send-notif-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: start;
}

.send-type-tabs {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.send-type-tab {
  flex: 1;
  cursor: pointer;
}

.send-type-tab input { display: none; }

.send-type-tab span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  background: var(--bg);
}

.send-type-tab input:checked + span {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.send-type-tab span:hover { border-color: var(--primary); }

.user-checkbox-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
}

.user-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.user-checkbox-item:hover { background: var(--surface); }
.user-checkbox-item.no-sub { opacity: 0.6; }

.user-checkbox-item input { accent-color: var(--primary); }
.user-checkbox-item strong { display: block; font-size: 0.85rem; }
.user-checkbox-item small { display: block; color: var(--text-muted); font-size: 0.75rem; }
.sub-badge { margin-left: auto; }

.select-all-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Notification preview */
.notif-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.notif-preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.notif-preview-icon { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.notif-preview-body { font-size: 0.85rem; color: var(--text-muted); }

.tips-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tips-list li { font-size: 0.85rem; color: var(--text-muted); }

/* ===========================
   AUTH PAGES
=========================== */
.auth-body {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-container { width: 100%; max-width: 420px; }

.auth-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon {
  width: 60px; height: 60px;
  background: var(--primary);
  color: #fff;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 12px;
}
.auth-logo h1 { font-size: 1.4rem; font-weight: 700; }
.auth-logo p { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

.auth-form { margin-top: 20px; }

.auth-demo {
  margin-top: 20px;
  padding: 14px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ===========================
   USER DASHBOARD
=========================== */
.permission-banner {
  background: linear-gradient(135deg, var(--primary), #0090cc);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideDown 0.4s ease;
}

@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.permission-banner-icon { font-size: 2rem; flex-shrink: 0; }
.permission-banner-content { flex: 1; }
.permission-banner-content strong { display: block; font-size: 1rem; font-weight: 600; }
.permission-banner-content p { font-size: 0.85rem; opacity: 0.9; margin-top: 4px; }
.permission-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
.permission-banner .btn-outline { border-color: rgba(255,255,255,0.4); color: #fff; }
.permission-banner .btn-outline:hover { background: rgba(255,255,255,0.15); }

.subscribed-notice {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: #2e7d32;
  font-size: 0.9rem;
}
.subscribed-notice i { font-size: 1.1rem; }
.subscribed-notice .btn { margin-left: auto; }

.user-welcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.welcome-card {
  display: flex;
  align-items: center;
  padding: 24px !important;
  gap: 20px;
}

.welcome-avatar {
  width: 60px; height: 60px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.welcome-info h2 { font-size: 1.1rem; font-weight: 700; }
.welcome-info p { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }

.notif-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.status-active { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.status-inactive { background: var(--surface); color: var(--text-muted); }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.setting-row p { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

.permission-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  background: #fff3e0;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #e65100;
  border: 1px solid #ffe0b2;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.info-grid .card { padding: 24px; }
.info-grid .card.text-center { text-align: center; }

.info-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin: 0 auto 12px;
}
.info-grid h4 { font-size: 0.9rem; font-weight: 600; }
.info-grid p { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* ===========================
   TOAST NOTIFICATIONS
=========================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-size: 0.875rem;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s;
  box-shadow: var(--shadow-md);
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

/* ===========================
   EMPTY STATE
=========================== */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; display: block; }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .dashboard-grid, .send-notif-grid, .user-welcome-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
  .send-type-tabs { flex-direction: column; }
  .permission-banner { flex-direction: column; text-align: center; }
  .permission-banner-actions { flex-wrap: wrap; justify-content: center; }
}
