/* =====================================================
   AURABRAIN - UTILITY STYLES (non-glass pages)
   For SuperAdmin/Tenant pages using card-based layout
   ===================================================== */
.wrapper { display: flex; min-height: 100vh; }

/* Page Header */
.page-header { margin-bottom: 24px; }
.page-header h1 {
  font-size: 1.5rem; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}
.page-header .page-description { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  font-weight: 600; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 20px; }
.card-footer { background: transparent; border-top: 1px solid var(--border-color); padding: 12px 20px; }

/* --- Modern Tables --- */
.table {
  width: 100%; margin-bottom: 0;
  border-collapse: collapse;
}
.table thead th {
  background: #f8fafc;
  padding: 10px 14px;
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
}
.table tbody td {
  padding: 10px 14px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: none; }

/* --- Buttons --- */
.btn {
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  transition: all var(--transition-base);
  font-size: 0.85rem;
  display: inline-flex; align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.4;
  text-decoration: none;
}
.btn:focus { box-shadow: 0 0 0 3px rgba(91,108,255,0.15); outline: none; }
.btn-sm { padding: 4px 10px; font-size: 0.78rem; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(91,108,255,0.3); }
.btn-success { background: var(--success); border-color: var(--success); color: white; }
.btn-success:hover { background: #15803d; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(22,163,74,0.3); }
.btn-danger { background: #EF4444; border-color: #EF4444; color: white; }
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,0.3); }
.btn-outline-primary { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn-outline-primary:hover { background: var(--accent); color: white; }
.btn-outline-secondary { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }
.btn-outline-secondary:hover { background: #f8fafc; border-color: var(--text-secondary); color: var(--text-primary); }
.btn-outline-danger { background: transparent; border: 1px solid #EF4444; color: #EF4444; }
.btn-outline-danger:hover { background: #EF4444; color: white; }

/* --- Forms --- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; }
.form-control {
  display: block; width: 100%; padding: 9px 12px; font-size: 0.88rem; font-family: inherit;
  color: var(--text-primary); background: #fff;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}
.form-control:focus { border-color: var(--accent); background: white; box-shadow: 0 0 0 3px rgba(91,108,255,0.1); outline: none; }
.form-control-sm { padding: 5px 8px; font-size: 0.8rem; }
.form-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; }

/* --- Alerts --- */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.85rem;
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
  animation: slideDown 0.25s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.alert-success { background: rgba(16,185,129,0.1); color: #166534; border-left: 4px solid var(--success); }
.alert-danger { background: rgba(239,68,68,0.1); color: #991b1b; border-left: 4px solid #EF4444; }
.alert-warning { background: rgba(245,158,11,0.1); color: #92400e; border-left: 4px solid #F59E0B; }
.alert-info { background: rgba(91,108,255,0.1); color: var(--accent); border-left: 4px solid var(--accent); }

/* --- Modal --- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.5); backdrop-filter: blur(4px);
  z-index: 9999; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex !important; }
.modal-dialog {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); width: 90%; max-width: 500px;
  max-height: 85vh; overflow-y: auto; animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-20px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.modal-header h5 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.modal-close { width: 30px; height: 30px; border: none; background: transparent; font-size: 1.2rem; cursor: pointer; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.modal-close:hover { background: var(--bg-body); color: var(--text-primary); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border-color); }
.delete-icon { width: 56px; height: 56px; border-radius: 50%; background: rgba(239,68,68,0.1); color: #EF4444; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin: 0 auto 12px; }

/* --- Badges --- */
.badge { font-weight: 500; font-size: 0.75rem; padding: 3px 8px; border-radius: 20px; }
.bg-primary-light { background: rgba(91,108,255,0.1) !important; color: var(--accent) !important; }
.bg-success-light { background: rgba(16,185,129,0.1) !important; color: var(--success) !important; }
.bg-danger-light { background: rgba(239,68,68,0.1) !important; color: #EF4444 !important; }
.bg-warning-light { background: rgba(245,158,11,0.1) !important; color: #F59E0B !important; }

/* --- Device Badge --- */
.device-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 0.7rem; font-weight: 600; }
.device-badge.online { background: rgba(16,185,129,0.1); color: var(--success); }
.device-badge.offline { background: rgba(239,68,68,0.1); color: #EF4444; }

/* --- Utility --- */
.text-primary { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: #EF4444 !important; }
.text-warning { color: #F59E0B !important; }
.text-muted { color: var(--text-muted) !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }

/* --- Responsive for non-glass pages --- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
}
