/* 
  SENTINEL Healthcare Platform
  Premium Design System
*/

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Colors */
  --primary-color: #0d9488;
  --primary-hover: #0f766e;
  --secondary-color: #0ea5e9;
  --secondary-hover: #0284c7;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --warning-hover: #d97706;
  --dark-color: #0f172a;
  --light-color: #f8fafc;
  --bg-color: #f1f5f9;
  --surface-color: rgba(255, 255, 255, 0.9);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: rgba(226, 232, 240, 0.8);

  /* Typography */
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  /* Layout */
  --border-radius: 16px;
  --box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--dark-color);
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navbar */
.navbar {
  background-color: var(--surface-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.3);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3);
}

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

.btn-outline:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-1px);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background-color: #f8fafc;
  border-radius: 12px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: var(--transition);
  color: var(--text-primary);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.alert-success {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
}
.badge-success {
  background-color: #dcfce7;
  color: #15803d;
}
.badge-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}
.badge-warning {
  background-color: #fef9c3;
  color: #a16207;
}
.badge-secondary {
  background-color: #f1f5f9;
  color: #475569;
}

/* Role Badges */
.badge-role-doctor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d4ed8;
  background-color: #dbeafe;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-role-patient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #15803d;
  background-color: #dcfce7;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-role-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7c2d12;
  background-color: #ffedd5;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Cards */
.card {
  background-color: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.card-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  color: var(--primary-color);
}

/* Hero Section */
.hero {
  padding: 5rem 0;
  text-align: center;
  background: linear-gradient(135deg, rgba(13,148,136,0.05) 0%, rgba(14,165,233,0.05) 100%);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--dark-color);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: white;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li a {
  display: block;
  padding: 0.85rem 1.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  border-left: 3px solid transparent;
  font-size: 0.95rem;
  transition: var(--transition);
}

.sidebar-nav li a:hover, .sidebar-nav li a.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-left-color: #ffffff;
}

.main-content {
  flex: 1;
  padding: 2.5rem;
  overflow-y: auto;
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.alert-danger {
  background-color: #fef2f2;
  color: var(--danger-color);
  border: 1px solid #fecaca;
}

.alert-success {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
}
.badge-success {
  background-color: #dcfce7;
  color: #15803d;
}
.badge-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}
.badge-warning {
  background-color: #fef9c3;
  color: #a16207;
}
.badge-secondary {
  background-color: #f1f5f9;
  color: #475569;
}

/* Role Badges */
.badge-role-doctor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d4ed8;
  background-color: #dbeafe;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-role-patient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #15803d;
  background-color: #dcfce7;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-role-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7c2d12;
  background-color: #ffedd5;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 1.25rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.data-table th {
  background-color: rgba(13, 148, 136, 0.04);
  color: var(--dark-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.data-table tr:hover {
  background-color: rgba(13, 148, 136, 0.02);
}
.data-table td {
  color: var(--text-primary);
  vertical-align: middle;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Notification Badge */
.nav-badge-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background-color: var(--danger-color);
  color: white;
  border-radius: 50%;
  padding: 0.15rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   GLOBAL DARK THEME ENGINE
   ========================================================================== */
html.dark-theme,
body.dark-theme {
  --primary-color: #2dd4bf;
  --primary-hover: #14b8a6;
  --secondary-color: #38bdf8;
  --secondary-hover: #0284c7;
  --dark-color: #f8fafc;
  --light-color: #0f172a;
  --bg-color: #090d16;
  --surface-color: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  background-color: #090d16 !important;
  color: #f8fafc !important;
}

body.dark-theme .dashboard-layout,
body.dark-theme .main-content {
  background-color: #090d16 !important;
  color: #f8fafc !important;
}

body.dark-theme .sidebar {
  background: #0f172a !important;
  border-right-color: #1e293b !important;
}

body.dark-theme .card,
body.dark-theme .checkout-card,
body.dark-theme .settings-module-card,
body.dark-theme .chat-container,
body.dark-theme .priority-card,
body.dark-theme .stat-card,
body.dark-theme .auth-card,
body.dark-theme .panel {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6,
body.dark-theme strong,
body.dark-theme .brand-text,
body.dark-theme label,
body.dark-theme .page-header h1,
body.dark-theme th {
  color: #ffffff !important;
}

body.dark-theme p,
body.dark-theme span,
body.dark-theme .text-muted,
body.dark-theme .form-row label {
  color: #cbd5e1;
}

body.dark-theme input[type="text"],
body.dark-theme input[type="email"],
body.dark-theme input[type="password"],
body.dark-theme input[type="number"],
body.dark-theme input[type="date"],
body.dark-theme input[type="time"],
body.dark-theme select,
body.dark-theme textarea,
body.dark-theme .form-control {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
  color: #64748b !important;
}

body.dark-theme table,
body.dark-theme .data-table {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

body.dark-theme table th,
body.dark-theme .data-table th {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-bottom-color: #334155 !important;
}

body.dark-theme table td,
body.dark-theme .data-table td {
  color: #cbd5e1 !important;
  border-bottom-color: #334155 !important;
}

body.dark-theme table tr:hover,
body.dark-theme .data-table tr:hover {
  background-color: #334155 !important;
}

body.dark-theme .nav-tooltip,
body.dark-theme .tooltip-arrow {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-theme .btn-outline {
  border-color: #334155 !important;
  color: #2dd4bf !important;
}
body.dark-theme .btn-outline:hover {
  background-color: rgba(45, 212, 191, 0.15) !important;
}

body.dark-theme .tier-card {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}
body.dark-theme .tier-card.selected {
  border-color: #2dd4bf !important;
  background-color: rgba(45, 212, 191, 0.12) !important;
}

body.dark-theme .sub-active-card {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

body.dark-theme div[id$="ModalOverlay"] > div,
body.dark-theme div[id$="Modal"] > div {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

/* Global Print Stylesheet Rules */
@media print {
  .sidebar,
  .patient-sidebar,
  .doctor-sidebar,
  .admin-sidebar,
  .sos-float-btn,
  .no-print,
  .btn,
  button,
  .navbar,
  .theme-toggle-btn,
  .welcome-container-anim {
    display: none !important;
  }
  
  body, html {
    background: #ffffff !important;
    color: #000000 !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
}

