/* ============================================================
   CaregiverPH Admin Panel Styles
   File: admin/assets/css/admin.css
   ============================================================ */

:root {
  --primary: #1e5f74;
  --primary-light: #2a7a94;
  --primary-dark: #164653;
  --accent: #e6b91e;
  --soft-bg: #f6f9fc;
  --gray-bg: #eef2f6;
  --text-dark: #1e2a32;
  --text-muted: #3f4d5a;
  --white: #ffffff;
  --border: #e2e9ef;
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
  --shadow-sm: 0 2px 8px rgba(0,20,30,0.06);
  --shadow-md: 0 8px 24px rgba(0,20,30,0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-width: 260px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--soft-bg);
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }

/* ========== SIDEBAR ========== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--primary-dark) 0%, #0f3542 100%);
  color: #cdd9e0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: white;
  border-radius: 10px;
  padding: 4px;
  flex-shrink: 0;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  color: white;
  font-weight: 700;
  font-size: 1rem;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #b8c7d1;
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.nav-item.active {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(30,95,116,0.35);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}

.badge {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

.badge-danger {
  background: var(--danger);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.admin-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
}

.admin-details {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  overflow: hidden;
}

.admin-name {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-role {
  font-size: 0.75rem;
  color: #8fa3b0;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: rgba(231,76,60,0.12);
  color: #ff9a8f;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: var(--danger);
  color: white;
}

/* ========== MAIN WRAPPER ========== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== TOPBAR ========== */
.topbar {
  background: white;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--primary-dark);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: var(--soft-bg);
}

.topbar-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-dark);
  flex: 1;
}

.topbar-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========== CONTENT ========== */
.content {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.page-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========== ALERTS ========== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.92rem;
  font-weight: 500;
  animation: slideDown 0.4s ease;
}

.alert i {
  font-size: 1.1rem;
  margin-top: 1px;
  flex-shrink: 0;
}

.alert-success {
  background: rgba(46,204,113,0.1);
  color: #1e8449;
  border-left: 4px solid var(--success);
}

.alert-error {
  background: rgba(231,76,60,0.1);
  color: #a93226;
  border-left: 4px solid var(--danger);
}

.alert-info {
  background: rgba(52,152,219,0.1);
  color: #21618c;
  border-left: 4px solid var(--info);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== STATS GRID ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-primary .stat-icon {
  background: rgba(30,95,116,0.1);
  color: var(--primary);
}

.stat-success .stat-icon {
  background: rgba(46,204,113,0.12);
  color: var(--success);
}

.stat-info .stat-icon {
  background: rgba(52,152,219,0.12);
  color: var(--info);
}

.stat-warning .stat-icon {
  background: rgba(243,156,18,0.14);
  color: var(--warning);
}

.stat-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ========== DASHBOARD GRID ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

/* ========== PANEL ========== */
.panel {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 24px;
}

.panel-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header h2 i {
  color: var(--primary);
}

.panel-link {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}

.panel-link:hover {
  gap: 10px;
  color: var(--primary-dark);
}

.panel-body {
  padding: 22px;
}

.panel-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--soft-bg);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-panel .panel-body {
  padding: 26px 22px;
}

/* ========== TABLES ========== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--soft-bg);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(30,95,116,0.03);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.table-link {
  color: var(--primary);
  font-weight: 600;
  transition: color 0.2s;
}

.table-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }

/* ========== STATUS BADGES ========== */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-active {
  background: rgba(46,204,113,0.14);
  color: #1e8449;
}

.status-inactive {
  background: rgba(149,165,166,0.18);
  color: #5d6d7e;
}

.status-unread {
  background: rgba(243,156,18,0.16);
  color: #b9770e;
}

.status-read {
  background: rgba(52,152,219,0.14);
  color: #21618c;
}

/* ========== ACTION BUTTONS ========== */
.action-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-edit {
  background: rgba(52,152,219,0.12);
  color: var(--info);
}

.btn-edit:hover {
  background: var(--info);
  color: white;
}

.btn-delete {
  background: rgba(231,76,60,0.12);
  color: var(--danger);
}

.btn-delete:hover {
  background: var(--danger);
  color: white;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 60px;
  font-weight: 600;
  font-size: 0.88rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30,95,116,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--soft-bg);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #c0392b;
  border-color: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(231,76,60,0.3);
}

/* ========== FORM STYLES ========== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.required {
  color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-dark);
  background: #fbfdff;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(30,95,116,0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ========== EMPTY STATES ========== */
.empty-state {
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: center;
  padding: 20px;
}

.empty-state a {
  color: var(--primary);
  font-weight: 600;
}

.empty-state-box {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state-box i {
  font-size: 3rem;
  color: var(--primary-light);
  opacity: 0.4;
  margin-bottom: 16px;
}

.empty-state-box h3 {
  color: var(--primary-dark);
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.empty-state-box p {
  margin-bottom: 20px;
  font-size: 0.92rem;
}

/* ========== MESSAGES LIST ========== */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 18px;
  border-radius: 60px;
  background: white;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.messages-list {
  display: flex;
  flex-direction: column;
}

.message-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border-radius: 10px;
  transition: background 0.2s;
  position: relative;
}

.message-item:hover {
  background: var(--soft-bg);
}

.message-item.unread {
  background: rgba(243,156,18,0.04);
}

.message-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message-content { flex: 1; min-width: 0; }

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.message-header strong {
  color: var(--primary-dark);
  font-size: 0.92rem;
}

.message-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.message-preview {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warning);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(243,156,18,0.2);
}

.message-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.message-row:last-child { border-bottom: none; }

.message-row:hover {
  background: var(--soft-bg);
}

.message-row.unread {
  background: rgba(243,156,18,0.04);
  border-left: 3px solid var(--warning);
}

.message-row-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.message-row-content {
  flex: 1;
  min-width: 0;
}

.message-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}

.message-row-top strong {
  color: var(--primary-dark);
  font-size: 0.95rem;
}

.message-row-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.message-row-email {
  font-size: 0.82rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.message-row-preview {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-row-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ========== MESSAGE DETAIL ========== */
.message-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.message-detail-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.message-detail-item label i {
  color: var(--primary);
}

.message-detail-item p {
  font-size: 0.95rem;
  color: var(--text-dark);
  font-weight: 500;
}

.message-detail-item a {
  color: var(--primary);
}

.message-detail-item a:hover {
  text-decoration: underline;
}

.message-detail-body label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.message-detail-body label i { color: var(--primary); }

.message-text {
  background: var(--soft-bg);
  padding: 20px;
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  font-size: 0.95rem;
  line-height: 1.7;
  border-left: 4px solid var(--primary);
}

.message-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========== ADMIN FOOTER ========== */
.admin-footer {
  padding: 20px 28px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: white;
}

/* ========== LOGIN PAGE ========== */
.login-page {
  background: linear-gradient(135deg, #ecf3f7 0%, #d9e6ed 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(230,185,30,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: white;
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 24px 60px rgba(0,20,30,0.15);
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.login-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.login-form .form-group {
  margin-bottom: 18px;
}

.input-icon {
  position: relative;
}

.input-icon > i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 1;
}

.input-icon input {
  padding-left: 44px;
  padding-right: 44px;
  height: 48px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.2s;
  font-size: 0.9rem;
}

.password-toggle:hover {
  color: var(--primary);
}

.btn-login {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  margin-top: 8px;
}

.btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(30,95,116,0.35);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.login-footer a {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.login-footer a:hover {
  color: var(--primary);
}

/* ========== SIDEBAR OVERLAY ========== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,25,35,0.5);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0,0,0,0.3);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .menu-toggle {
    display: flex;
  }
  .content {
    padding: 20px;
  }
  .topbar {
    padding: 12px 20px;
  }
}

@media (max-width: 580px) {
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .topbar-title { font-size: 1.1rem; }
  .topbar-time { display: none; }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .stat-card {
    padding: 16px;
    gap: 12px;
  }
  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
  .stat-value { font-size: 1.4rem; }
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .page-header-actions {
    width: 100%;
  }
  .page-header-actions .btn {
    flex: 1;
  }
  .panel-body { padding: 16px; }
  .panel-header { padding: 14px 16px; }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .admin-table th,
  .admin-table td {
    padding: 10px 8px;
    font-size: 0.82rem;
  }
  .message-row {
    padding: 14px 10px;
    gap: 12px;
  }
  .message-row-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }
  .message-row-date { display: none; }
  .message-detail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .login-card {
    padding: 28px 22px;
  }
  .admin-footer {
    padding: 16px;
    font-size: 0.75rem;
  }
}

@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}