@charset "UTF-8";
/* =========================================================
   Ultra-Modern Clean Dashboard Design System (Matching Ref UI) 🎨
   ========================================================= */

:root {
  --sidebar-w: 250px;
  --sidebar-collapsed-w: 68px;
  
  /* Brand Accent Colors */
  --accent: #38BDF8;
  --accent-dark: #0284C7;
  --accent-bg: #F0F9FF;
  
  /* Typography */
  --font-main: 'Anuphan', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Background & Surface Tokens matching Ref UI */
  --bg: #F0F4F9;
  --surface: #FFFFFF;
  --border: rgba(226, 232, 240, 0.8);
  --border-subtle: #F1F5F9;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-hint: #94A3B8;
  --hover: #F8FAFC;
  
  /* Soft Status Colors */
  --success-bg: #ECFDF5;
  --success-text: #059669;
  --danger-bg: #FEF2F2;
  --danger-text: #DC2626;
  --warning-bg: #FFFBEB;
  --warning-text: #D97706;
}

[data-theme="dark"] {
  --bg: #090D16;
  --surface: #111827;
  --border: #1F2937;
  --border-subtle: #1F2937;
  --text: #F9FAFB;
  --text-muted: #9CA3AF;
  --text-hint: #6B7280;
  --hover: #1F2937;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

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

/* Headings Typography */
h1, h2, h3, .h1, .h2, .h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 0;
}

h4, h5, h6, .h4, .h5, .h6 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text);
  margin-bottom: 0;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1040;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s ease;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.02);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  height: 64px;
  flex-shrink: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.brand-text {
  white-space: nowrap;
  overflow: hidden;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  line-height: 1.2;
}

.brand-ver {
  font-size: 11px;
  color: var(--text-hint);
  font-weight: 500;
}

/* Nav Items */
.nav-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px;
}

.nav-section {
  margin-bottom: 14px;
}

.nav-cap {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-hint);
  padding: 6px 10px 4px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  transition: all 0.18s ease;
}

.nav-item:hover {
  background: var(--hover);
  color: var(--text);
}

.nav-item.active {
  background: #F0F9FF;
  color: #0284C7;
  font-weight: 700;
}

.nav-item i {
  font-size: 18px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.nav-badge {
  background: var(--accent-dark);
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

.nav-badge.danger {
  background: #EF4444;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
}

.user-info {
  white-space: nowrap;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.user-role {
  font-size: 11px;
  color: var(--text-hint);
}

/* Collapsed Sidebar Rules */
body.sidebar-collapsed {
  --sidebar-w: var(--sidebar-collapsed-w);
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-w);
}

body.sidebar-collapsed .brand-block {
  padding: 12px;
  justify-content: center;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-cap,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .user-info,
body.sidebar-collapsed .role-card-label,
body.sidebar-collapsed .nav-role-badge {
  display: none !important;
}

body.sidebar-collapsed .role-card-wrap {
  padding-left: 8px !important;
  padding-right: 8px !important;
}

body.sidebar-collapsed .role-card-box {
  justify-content: center !important;
  padding: 8px 0 !important;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
}

body.sidebar-collapsed .user-card {
  justify-content: center;
}

body.sidebar-collapsed .sidebar:hover {
  width: 250px;
  box-shadow: 4px 0 25px rgba(0,0,0,0.08);
}

body.sidebar-collapsed .sidebar:hover .brand-text,
body.sidebar-collapsed .sidebar:hover .nav-cap,
body.sidebar-collapsed .sidebar:hover .nav-label,
body.sidebar-collapsed .sidebar:hover .nav-badge,
body.sidebar-collapsed .sidebar:hover .user-info,
body.sidebar-collapsed .sidebar:hover .role-card-label,
body.sidebar-collapsed .sidebar:hover .nav-role-badge {
  display: block !important;
}

body.sidebar-collapsed .sidebar:hover .role-card-box {
  justify-content: space-between !important;
  padding: 8px 12px !important;
}

body.sidebar-collapsed .sidebar:hover .nav-item {
  justify-content: flex-start;
  padding: 9px 14px;
}

/* ── MAIN WRAP & TOPBAR ── */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.page-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}

.topbar-search {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 12.5px;
  color: var(--text);
  width: 100%;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.18s ease;
  font-size: 15px;
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}

/* Content Area */
.content {
  padding: 28px;
  flex: 1;
}

/* ── VIBRANT GRADIENT KPI CARDS (Matching Reference Image) ── */
.kpi-gradient-card {
  border-radius: 22px;
  padding: 20px 22px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
}

.kpi-gradient-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.14);
}

.kpi-gradient-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Gradient Presets matching Reference Image */
.kpi-gradient-1 {
  background: linear-gradient(135deg, #38B6FF 0%, #0096FF 100%);
}

.kpi-gradient-2 {
  background: linear-gradient(135deg, #20C997 0%, #0DB583 100%);
}

.kpi-gradient-3 {
  background: linear-gradient(135deg, #8C52FF 0%, #682BD7 100%);
}

.kpi-gradient-4 {
  background: linear-gradient(135deg, #3B82F6 0%, #1D4EDB 100%);
}

.kpi-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  color: #0096FF;
}

.kpi-gradient-2 .kpi-icon-circle { color: #0DB583; }
.kpi-gradient-3 .kpi-icon-circle { color: #682BD7; }
.kpi-gradient-4 .kpi-icon-circle { color: #1D4EDB; }

.kpi-glass-badge {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kpi-val-number {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-top: 12px;
  color: #ffffff;
}

.kpi-val-label {
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0.92;
  margin-top: 2px;
  color: #ffffff;
}

/* Wave Background Decoration SVG */
.kpi-wave-svg {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 60px;
  opacity: 0.35;
  pointer-events: none;
}

/* ── PANELS & CARDS ── */
.panel {
  background: var(--surface);
  border: none;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

/* Date Navigation Strip (Top Right Calendar Bar) */
.calendar-strip-box {
  background: var(--surface);
  border-radius: 22px;
  padding: 16px 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  position: relative;
  overflow: hidden;
}

.date-pill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 16px;
  min-width: 48px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.18s ease;
}

.date-pill-item .day-name {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
}

.date-pill-item .day-num {
  font-size: 14px;
  font-weight: 700;
}

.date-pill-item.active {
  background: linear-gradient(135deg, #38B6FF 0%, #0096FF 100%);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(56, 182, 255, 0.4);
}

.date-pill-item:hover:not(.active) {
  background: var(--hover);
  color: var(--text);
}

/* Analytics Subnav & Progress Section */
.analytics-subnav {
  background: #F8FAFC;
  border-radius: 16px;
  padding: 8px;
}

.analytics-subnav-item {
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
}

.analytics-subnav-item.active {
  background: #ffffff;
  color: #0096FF;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  border-left: 3px solid #0096FF;
}

.analytics-progress-card {
  background: #F8FAFC;
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 12px;
}

.emoji-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

/* Action Pill Buttons (like "View Profile" in reference UI) */
.btn-action-pill {
  background: linear-gradient(135deg, #38B6FF 0%, #0096FF 100%);
  color: #ffffff !important;
  border-radius: 14px;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 12px rgba(56, 182, 255, 0.28);
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-action-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(56, 182, 255, 0.38);
  color: #ffffff !important;
}

/* Item Row Cards (Bottom Right Patient Application List) */
.customer-item-card {
  background: #F8FAFC;
  border-radius: 18px;
  padding: 12px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.customer-item-card:hover {
  background: #ffffff;
  border-color: #E2E8F0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Table Design */
.table-custom {
  color: var(--text);
  font-size: 13px;
}

.table-custom th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.table-custom td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 16px;
  vertical-align: middle;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: 250px !important;
  }

  .sidebar.show-mobile {
    transform: translateX(0);
    box-shadow: 0 0 30px rgba(0,0,0,0.15);
  }

  .main-wrap {
    margin-left: 0 !important;
  }

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 16px;
  }
}