/* ===================================================
   CURHATI DESIGN SYSTEM & STYLESHEET
   Modern Professional Healthcare & Wellness SaaS
   =================================================== */

:root {
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-light: #f0fdfa;
  --primary-border: #99f6e4;
  
  --secondary: #4f46e5;
  --secondary-hover: #4338ca;
  --secondary-light: #eef2ff;

  --accent-amber: #d97706;
  --accent-amber-light: #fffbeb;

  --success: #10b981;
  --success-light: #ecfdf5;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --crisis-rose: #e11d48;
  --crisis-light: #fff1f2;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--slate-50);
  color: var(--slate-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

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

/* Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Role Simulator Bar (Top Bar) */
.role-simulator-bar {
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 0.5rem 1.5rem;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
}

.simulator-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.simulator-tag .pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #34d399;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

.role-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.role-select {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.role-select option {
  background: #1e293b;
  color: #fff;
}

.role-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3);
}

/* Main Layout Structure */
.app-container {
  display: flex;
  min-height: calc(100vh - 41px);
}

/* Sidebar Navigation */
.app-sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}

.brand-text h1 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.brand-text p {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 1rem 0.875rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.nav-group-title {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--slate-400);
  padding: 0 0.75rem;
  margin-bottom: 0.375rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-600);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.nav-link i, .nav-link svg {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  color: inherit;
}

.nav-link:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
}

.nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background-color: var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.125rem 0.45rem;
  border-radius: var(--radius-full);
}

.badge-count {
  background-color: var(--danger);
  color: white;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--slate-100);
  background-color: var(--slate-50);
}

.user-compact-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
}

.user-info-text .name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.user-info-text .role-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-block;
}

/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.top-navbar {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 41px;
  z-index: 100;
}

.page-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.01em;
}

.page-title p {
  font-size: 0.8125rem;
  color: var(--slate-500);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.2);
  transition: all 0.2s;
}

.quick-action-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.content-viewport {
  padding: 2rem;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Banner Notices */
.ethics-notice-banner {
  background: linear-gradient(to right, #eff6ff, #f0fdfa);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.ethics-icon {
  color: #2563eb;
  font-size: 1.25rem;
  margin-top: 0.125rem;
}

.ethics-text h4 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 0.25rem;
}

.ethics-text p {
  font-size: 0.8125rem;
  color: #3b82f6;
  line-height: 1.4;
}

.crisis-banner {
  background: var(--crisis-light);
  border: 1px solid #fecdd3;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.crisis-banner h4 {
  color: var(--crisis-rose);
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.crisis-banner p {
  color: #9f1239;
  font-size: 0.8125rem;
}

.crisis-hotline-btn {
  background: var(--crisis-rose);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(225, 29, 72, 0.2);
}

/* Metric / Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--slate-400);
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.stat-sub.positive {
  color: var(--success);
  font-weight: 600;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.icon-teal { background: var(--primary-light); color: var(--primary); }
.icon-indigo { background: var(--secondary-light); color: var(--secondary); }
.icon-amber { background: var(--accent-amber-light); color: var(--accent-amber); }
.icon-emerald { background: var(--success-light); color: var(--success); }
.icon-rose { background: var(--danger-light); color: var(--danger); }

/* Card & Section Container */
.dashboard-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--slate-800);
}

.card-header p {
  font-size: 0.8125rem;
  color: var(--slate-500);
  margin-top: 0.125rem;
}

.card-body {
  padding: 1.5rem;
}

/* Modern Tables */
.data-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  background-color: var(--slate-50);
  color: var(--slate-600);
  font-weight: 600;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--slate-200);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-700);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: #fafbfc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-paid, .badge-confirmed, .badge-completed {
  background-color: var(--success-light);
  color: #065f46;
}

.badge-pending, .badge-scheduled, .badge-in_progress {
  background-color: var(--accent-amber-light);
  color: #92400e;
}

.badge-ongoing {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

.badge-new {
  background-color: #eff6ff;
  color: #1d4ed8;
}

.badge-high {
  background-color: var(--danger-light);
  color: #991b1b;
}

.badge-cancelled, .badge-failed {
  background-color: var(--slate-100);
  color: var(--slate-600);
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

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

.btn-secondary {
  background-color: var(--secondary);
  color: #ffffff;
}
.btn-secondary:hover {
  background-color: var(--secondary-hover);
}

.btn-outline {
  background-color: #ffffff;
  border-color: var(--slate-300);
  color: var(--slate-700);
}
.btn-outline:hover {
  background-color: var(--slate-50);
  border-color: var(--slate-400);
  color: var(--slate-900);
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

/* Service Card Selection (Reservation Module) */
.service-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.service-selection-card {
  background: #ffffff;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.service-selection-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.service-selection-card.selected {
  border-color: var(--primary);
  background: #f0fdfa;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.service-icon-box {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.service-price-tag {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-top: 1rem;
}

.service-price-tag span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--slate-500);
}

/* Counselor Card */
.counselors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.counselor-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.counselor-card.selected {
  border-color: var(--primary);
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

.counselor-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.slot-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.slot-pill {
  padding: 0.375rem 0.75rem;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  transition: all 0.15s;
}

.slot-pill:hover {
  background: var(--slate-200);
}

.slot-pill.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Chat Module Component */
.chat-container {
  display: flex;
  height: 600px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: #ffffff;
  overflow: hidden;
}

.chat-sidebar {
  width: 280px;
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
}

.chat-search-box {
  padding: 1rem;
  border-bottom: 1px solid var(--slate-100);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
}

.chat-item {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--slate-50);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-item:hover, .chat-item.active {
  background: var(--slate-50);
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background: var(--slate-50);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-bubble {
  max-width: 65%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  line-height: 1.4;
  position: relative;
}

.message-in {
  align-self: flex-start;
  background: #ffffff;
  color: var(--slate-800);
  border: 1px solid var(--slate-200);
  border-bottom-left-radius: var(--radius-sm);
}

.message-out {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: var(--radius-sm);
}

.message-meta {
  font-size: 0.6875rem;
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  opacity: 0.8;
}

.chat-input-area {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--slate-200);
  display: flex;
  gap: 0.75rem;
  background: #ffffff;
}

.chat-input {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  outline: none;
}

.chat-input:focus {
  border-color: var(--primary);
}

/* Modals & Dialogs */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--slate-100);
  background: var(--slate-50);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 0.375rem;
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  outline: none;
  background-color: #fff;
  transition: border-color 0.15s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: #ffffff;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 0.875rem 1.25rem;
  min-width: 300px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: auto;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.875rem;
  color: var(--slate-800);
}

.toast-success { border-left-color: var(--success); }
.toast-danger { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--accent-amber); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM (MOBILE & TABLET FIX)
   Sangat rapi di layar HP (<768px): No overlapping, full horizontal scroll tabs
   ========================================================================== */
@media (max-width: 900px) {
  /* Hilangkan sticky overlap di mobile */
  .role-simulator-bar {
    position: relative !important;
    top: auto !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.625rem !important;
    padding: 0.75rem 1rem !important;
  }

  .role-select-wrapper {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    justify-content: flex-start !important;
    width: 100% !important;
  }

  .role-select {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  /* Susun container utama vertikal agar sidebar tidak memakan ruang horizontal */
  .app-container {
    flex-direction: column !important;
    min-height: auto !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Sidebar berubah menjadi horizontal swipeable pills */
  .app-sidebar {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--slate-200) !important;
    background: #ffffff !important;
    flex-direction: column !important;
  }

  .sidebar-header {
    padding: 0.625rem 1rem !important;
    border-bottom: 1px solid var(--slate-100) !important;
    justify-content: flex-start !important;
    gap: 0.625rem !important;
  }

  .brand-text {
    display: block !important;
  }

  .brand-text h1 {
    font-size: 0.9375rem !important;
    line-height: 1.2 !important;
  }

  .brand-text p {
    font-size: 0.65rem !important;
  }

  .sidebar-nav {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0.5rem 0.75rem !important;
    gap: 0.5rem !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none !important;
  }

  .nav-group {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.35rem !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }

  .nav-group-title {
    display: none !important;
  }

  .nav-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0.45rem 0.85rem !important;
    border-radius: var(--radius-full) !important;
    font-size: 0.8125rem !important;
    background: var(--slate-100) !important;
    color: var(--slate-700) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    gap: 0.4rem !important;
    border: 1px solid var(--slate-200) !important;
    transition: all 0.15s ease !important;
  }

  .nav-link span {
    display: inline !important;
  }

  .nav-link i, .nav-link svg {
    font-size: 0.85rem !important;
    width: 14px !important;
    height: 14px !important;
  }

  .nav-link.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    font-weight: 600 !important;
  }

  .nav-link.active::before {
    display: none !important;
  }

  .sidebar-footer {
    display: none !important;
  }

  /* Main viewport & topbar */
  .app-main {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .top-navbar {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    padding: 0.75rem 1rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.625rem !important;
    background: #ffffff !important;
    border-bottom: 1px solid var(--slate-200) !important;
  }

  .page-title h2 {
    font-size: 1.05rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.15rem !important;
  }

  .page-title p {
    font-size: 0.75rem !important;
    line-height: 1.35 !important;
  }

  .top-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    justify-content: flex-start !important;
    padding-top: 0.4rem !important;
    border-top: 1px dashed var(--slate-100) !important;
  }

  .content-viewport {
    padding: 0.875rem 0.75rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Header fleksibel di dalam view */
  .flex.justify-between,
  .flex.items-center.justify-between {
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
  }

  .flex.justify-between > div,
  .flex.items-center.justify-between > div {
    width: 100% !important;
  }

  .flex.justify-between > button,
  .flex.justify-between > a,
  .flex.items-center.justify-between > button,
  .flex.items-center.justify-between > a {
    align-self: flex-start !important;
  }

  /* Grid & Cards */
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .stat-card {
    padding: 1rem 1.15rem !important;
  }

  .stat-value {
    font-size: 1.4rem !important;
  }

  .card-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    padding: 0.875rem 1rem !important;
  }

  .card-header .btn {
    align-self: flex-start !important;
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* Tabel data responsif dengan touch scroll horizontal */
  .data-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 0.5rem !important;
  }

  .data-table {
    min-width: 540px !important;
  }

  .data-table th, .data-table td {
    padding: 0.65rem 0.625rem !important;
    font-size: 0.8125rem !important;
    white-space: nowrap !important;
  }

  .ethics-notice-banner {
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0.875rem 1rem !important;
  }
}
