/* ============================================
   Rekreana Redesign Prototype - Design System
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Brand Colors */
  --primary: #fe6100;
  --primary-hover: #df5700;
  --primary-light: #fff3ea;
  --primary-50: #fff8f2;
  --primary-100: #fff0e0;
  --primary-gradient: linear-gradient(135deg, #fe6100 0%, #ff8a3d 100%);
  --primary-gradient-hero: linear-gradient(135deg, #fe6100 0%, #8e77fa 100%);

  /* Neutrals */
  --white: #ffffff;
  --gray-50: #fafbfe;
  --gray-100: #f3f6f9;
  --gray-200: #eff2f7;
  --gray-300: #e8ebed;
  --gray-400: #dbe0e6;
  --gray-500: #adb5bd;
  --gray-600: #67748e;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --dark: #29344a;

  /* Semantic */
  --success: #28c76f;
  --success-light: #eaf9f1;
  --warning: #ff9900;
  --warning-light: #fff5e6;
  --danger: #ff4d4d;
  --danger-light: #ffecec;
  --info: #3577f1;
  --info-light: #edf2ff;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --content-max-width: 1280px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
}

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

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

img {
  max-width: 100%;
  height: auto;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--dark);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.text-muted { color: var(--gray-600); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* --- Layout Shell --- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--gray-300);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-slow);
}

.sidebar-logo {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  height: var(--header-height);
}

.sidebar-logo svg {
  height: 32px;
  width: auto;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-sm);
}

.nav-section {
  margin-bottom: var(--space-lg);
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--gray-200);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover {
  background: var(--gray-100);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.6875rem;
  color: var(--gray-500);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

/* Header */
.topbar {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: var(--space-md);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.topbar-breadcrumb a {
  color: var(--gray-500);
}

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

.topbar-breadcrumb .separator {
  color: var(--gray-400);
}

.topbar-breadcrumb .current {
  color: var(--gray-800);
  font-weight: 500;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.1rem;
}

.topbar-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.topbar-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: var(--radius-full);
  border: 2px solid var(--white);
}

.mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 1.25rem;
  color: var(--gray-700);
  cursor: pointer;
}

/* Page Content */
.page-content {
  flex: 1;
  padding: var(--space-lg);
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
}

.page-header {
  margin-bottom: var(--space-lg);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: var(--space-xs);
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.page-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* --- Components --- */

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-body {
  padding: var(--space-lg);
}

.card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}

.card-header h3,
.card-header h4 {
  margin: 0;
}

.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Stat Cards */
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-card);
}

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

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

.stat-icon.primary {
  background: var(--primary-light);
  color: var(--primary);
}

.stat-icon.success {
  background: var(--success-light);
  color: var(--success);
}

.stat-icon.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-icon.danger {
  background: var(--danger-light);
  color: var(--danger);
}

.stat-icon.info {
  background: var(--info-light);
  color: var(--info);
}

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.stat-change {
  font-size: 0.75rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Grid */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--white);
}

.btn-outline {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-outline:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: none;
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

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

.badge-success {
  background: var(--success-light);
  color: #1a9d57;
}

.badge-warning {
  background: var(--warning-light);
  color: #cc7a00;
}

.badge-danger {
  background: var(--danger-light);
  color: #cc3333;
}

.badge-info {
  background: var(--info-light);
  color: #2960c4;
}

.badge-gray {
  background: var(--gray-200);
  color: var(--gray-700);
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-600);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 2px solid var(--gray-200);
  text-align: left;
  white-space: nowrap;
}

tbody td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
  color: var(--gray-800);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--gray-50);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Forms */
.form-group {
  margin-bottom: var(--space-md);
}

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

.form-label .required {
  color: var(--danger);
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-400);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font-primary);
  color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(254, 97, 0, 0.12);
}

.form-input::placeholder {
  color: var(--gray-500);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

/* Search */
.search-box {
  position: relative;
  max-width: 320px;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  font-size: 0.875rem;
}

.search-box .form-input {
  padding-left: 38px;
}

/* Alert */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.alert-danger {
  background: var(--danger-light);
  color: #cc3333;
  border: 1px solid #ffd6d6;
}

.alert-warning {
  background: var(--warning-light);
  color: #cc7a00;
  border: 1px solid #ffe6b3;
}

.alert-info {
  background: var(--info-light);
  color: #2960c4;
  border: 1px solid #c8d8ff;
}

.alert-success {
  background: var(--success-light);
  color: #1a9d57;
  border: 1px solid #b8ecd0;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.pagination-controls {
  display: flex;
  gap: 4px;
}

.pagination-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-700);
  font-size: 0.8125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.pagination-btn:hover {
  background: var(--gray-100);
}

.pagination-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Tabs */
.tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: var(--space-lg);
}

.tab {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--gray-900);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Service Cards */
.service-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-card);
}

.service-card:hover {
  box-shadow: var(--shadow-md);
}

.service-card-header {
  padding: var(--space-lg);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
}

.service-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
}

.service-card-number {
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.service-card-body {
  padding: var(--space-md) var(--space-lg);
}

.service-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
}

.service-card-row:not(:last-child) {
  border-bottom: 1px solid var(--gray-100);
}

.service-card-label {
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.service-card-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark);
}

.service-card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* Order Step Flow */
.step-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--space-2xl);
  padding: 0 var(--space-2xl);
}

.step {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-500);
  background: var(--white);
  flex-shrink: 0;
}

.step-label {
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-weight: 500;
  white-space: nowrap;
}

.step.active .step-number {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

.step.completed .step-number {
  background: var(--success);
  border-color: var(--success);
  color: var(--white);
}

.step.completed .step-label {
  color: var(--success);
}

.step-line {
  height: 2px;
  width: 60px;
  background: var(--gray-300);
  margin: 0 var(--space-sm);
  flex-shrink: 0;
}

.step-line.completed {
  background: var(--success);
}

/* Product Cards (Order) */
.product-card {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  background: var(--white);
}

.product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.product-card.selected {
  border-color: var(--primary);
  background: var(--primary-50);
}

.product-card.selected::after {
  content: "\2713";
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.product-card-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-gradient);
  color: var(--white);
  padding: 4px 16px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.product-card-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: var(--space-xs);
}

.product-card-desc {
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

.product-card-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.product-card-price span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
}

.product-card-features {
  margin-top: var(--space-md);
  list-style: none;
}

.product-card-features li {
  padding: 6px 0;
  font-size: 0.8125rem;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.product-card-features li::before {
  content: "\2713";
  color: var(--success);
  font-weight: 700;
  font-size: 0.75rem;
}

/* Greeting Card */
.greeting-card {
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  color: var(--white);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.greeting-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
}

.greeting-card h2 {
  color: var(--white);
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.greeting-card p {
  opacity: 0.9;
  font-size: 0.9375rem;
  max-width: 500px;
}

.greeting-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.greeting-actions .btn {
  background: var(--white);
  color: var(--primary);
  font-weight: 600;
}

.greeting-actions .btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

.greeting-actions .btn-ghost-white {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.greeting-actions .btn-ghost-white:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--gray-500);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-state h4 {
  color: var(--gray-700);
  margin-bottom: var(--space-sm);
}

/* Quick Actions */
.quick-action-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-card);
}

.quick-action-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.quick-action-label {
  font-weight: 600;
  color: var(--dark);
  font-size: 0.9375rem;
}

.quick-action-desc {
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin-top: 2px;
}

/* Account Info */
.account-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.account-info-item {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
}

.account-info-icon {
  color: var(--primary);
  font-size: 0.875rem;
  margin-top: 2px;
}

.account-info-label {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.account-info-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-900);
}

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
}

.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.login-form-container {
  width: 100%;
  max-width: 400px;
}

.login-logo {
  margin-bottom: var(--space-2xl);
}

.login-logo svg {
  height: 40px;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: var(--space-xs);
}

.login-subtitle {
  font-size: 0.9375rem;
  color: var(--gray-600);
  margin-bottom: var(--space-xl);
}

.login-right {
  flex: 1;
  background: var(--primary-gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.login-right::before {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  top: -100px;
  right: -100px;
}

.login-right::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  bottom: -50px;
  left: -50px;
}

.login-right-content {
  text-align: center;
  color: var(--white);
  position: relative;
  z-index: 1;
}

.login-right-content h2 {
  color: var(--white);
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.login-right-content p {
  opacity: 0.9;
  font-size: 1.0625rem;
  max-width: 360px;
  line-height: 1.6;
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.form-check input[type="checkbox"] {
  accent-color: var(--primary);
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.form-link {
  font-size: 0.8125rem;
  color: var(--primary);
  font-weight: 500;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gray-300);
}

.social-btns {
  display: flex;
  gap: var(--space-sm);
}

.social-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.social-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

/* Prototype Nav (demo only) */
.proto-nav {
  background: var(--dark);
  color: var(--white);
  padding: var(--space-sm) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.8125rem;
  position: sticky;
  top: 0;
  z-index: 9999;
  overflow-x: auto;
}

.proto-nav a {
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.proto-nav a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.proto-nav a.active {
  color: var(--white);
  background: var(--primary);
}

.proto-nav .proto-label {
  font-weight: 700;
  color: var(--primary);
  margin-right: var(--space-sm);
}

/* Switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-400);
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
  cursor: pointer;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
}

.switch input:checked + .switch-slider {
  background: var(--primary);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(18px);
}

/* Progress bar */
.progress-bar-track {
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  transition: width var(--transition-slow);
}

/* Two column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

/* Avatar */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.avatar.sm { width: 24px; height: 24px; font-size: 0.625rem; }
.avatar.lg { width: 42px; height: 42px; font-size: 1rem; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-toggle {
    display: flex;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }

  .greeting-card {
    padding: var(--space-lg);
  }

  .step-flow {
    flex-wrap: wrap;
    padding: 0;
  }

  .step-line {
    width: 30px;
  }

  .login-right {
    display: none;
  }

  .account-info-grid {
    grid-template-columns: 1fr;
  }

  .page-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }
}

/* Utility */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: 'SF Mono', 'Menlo', monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.hidden { display: none; }

/* ============================================
   Block 2 Additions - Interactivity & Details
   ============================================ */

/* --- Sidebar Overlay (Mobile) --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

body.sidebar-open {
  overflow: hidden;
}

/* --- Dropdown Menu --- */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
  padding: var(--space-xs) 0;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu-header {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dark);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  font-size: 0.8125rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.dropdown-item i {
  width: 16px;
  text-align: center;
  color: var(--gray-500);
}

.dropdown-divider {
  height: 1px;
  background: var(--gray-100);
  margin: var(--space-xs) 0;
}

/* Notification dropdown items */
.notification-item {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--gray-50);
}

.notification-item:hover {
  background: var(--gray-50);
}

.notification-item.unread {
  background: var(--primary-50);
}

.notification-item.unread:hover {
  background: var(--primary-100);
}

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 5px;
}

.notification-dot.read {
  background: var(--gray-300);
}

.notification-text {
  flex: 1;
}

.notification-title {
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.dropdown-menu-footer {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--gray-100);
  text-align: center;
}

.dropdown-menu-footer a {
  font-size: 0.8125rem;
  font-weight: 500;
}

/* User menu (sidebar footer dropdown) */
.sidebar-footer {
  position: relative;
}

.sidebar-footer .dropdown-menu {
  bottom: calc(100% + 6px);
  top: auto;
  left: var(--space-sm);
  right: var(--space-sm);
  min-width: 0;
}

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.modal-dialog {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  margin: var(--space-md);
  transform: translateY(16px) scale(0.98);
  transition: transform var(--transition-fast);
}

.modal.show .modal-dialog {
  transform: translateY(0) scale(1);
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

body.modal-open {
  overflow: hidden;
}

/* --- Alert with close button --- */
.alert {
  position: relative;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.alert-close {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  font-size: 0.875rem;
  padding: 4px;
  line-height: 1;
  transition: opacity var(--transition-fast);
}

.alert-close:hover {
  opacity: 1;
}

/* --- Tab Panels --- */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* --- Detail Page Styles --- */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.detail-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.detail-header-left .back-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  font-size: 1rem;
}

.detail-header-left .back-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.detail-id {
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-family: 'SF Mono', 'Menlo', monospace;
  margin-bottom: 2px;
}

.detail-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
}

.detail-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Detail Info Grid */
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.detail-info-item {
  padding: var(--space-md);
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

.detail-info-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  margin-bottom: var(--space-xs);
}

.detail-info-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dark);
}

/* Timeline / Activity log */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-lg);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-dot i {
  font-size: 0.5rem;
}

.timeline-dot.primary {
  border-color: var(--primary);
  color: var(--primary);
}

.timeline-dot.success {
  border-color: var(--success);
  color: var(--success);
}

.timeline-dot.warning {
  border-color: var(--warning);
  color: var(--warning);
}

.timeline-dot.info {
  border-color: var(--info);
  color: var(--info);
}

.timeline-content {
  font-size: 0.875rem;
  color: var(--gray-800);
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 2px;
}

/* Data row (key-value pairs in detail) */
.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  font-size: 0.875rem;
}

.data-row:not(:last-child) {
  border-bottom: 1px solid var(--gray-100);
}

.data-row-label {
  color: var(--gray-600);
}

.data-row-value {
  font-weight: 500;
  color: var(--dark);
  text-align: right;
}

/* Large stat for detail pages */
.detail-stat {
  text-align: center;
  padding: var(--space-lg);
}

.detail-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
}

.detail-stat-label {
  font-size: 0.8125rem;
  color: var(--gray-600);
  margin-top: var(--space-xs);
}

/* Usage meter (for service detail) */
.usage-meter {
  margin-bottom: var(--space-md);
}

.usage-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-sm);
}

.usage-meter-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--dark);
}

.usage-meter-value {
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.usage-meter-bar {
  height: 10px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.usage-meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  transition: width var(--transition-slow);
}

.usage-meter-fill.warning {
  background: linear-gradient(135deg, var(--warning), #ffb84d);
}

.usage-meter-fill.danger {
  background: linear-gradient(135deg, var(--danger), #ff8080);
}

/* Btn danger */
.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #e63939;
  border-color: #e63939;
  color: var(--white);
}

.btn-outline-danger {
  background: var(--white);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger-light);
}

/* Proto-nav update for new pages */
.proto-nav {
  flex-wrap: nowrap;
  min-height: 40px;
}

/* --- Improved Responsive --- */

/* Tablet breakpoint refinements */
@media (max-width: 1024px) {
  .detail-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Better topbar on mobile */
  .topbar {
    padding: 0 var(--space-md);
  }

  .page-content {
    padding: var(--space-md);
  }

  /* Sidebar overlay on mobile */
  .sidebar {
    box-shadow: var(--shadow-lg);
  }

  /* Table: responsive card-like on mobile */
  .table-container {
    margin: 0 calc(var(--space-md) * -1);
  }

  thead th,
  tbody td {
    padding: var(--space-sm) var(--space-sm);
    font-size: 0.8125rem;
  }

  /* Hide less important columns on mobile */
  .hide-mobile {
    display: none;
  }

  /* Stats cards: 2 columns on mobile */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }

  /* Detail page responsive */
  .detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-actions {
    width: 100%;
  }

  .detail-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .detail-info-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Tabs scroll horizontally on mobile */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Modal full-width on mobile */
  .modal-dialog {
    max-width: none;
    margin: var(--space-sm);
    max-height: calc(100vh - 16px);
  }

  /* Greeting card smaller on mobile */
  .greeting-card h2 {
    font-size: 1.25rem;
  }

  .greeting-card p {
    font-size: 0.8125rem;
  }

  .greeting-actions {
    flex-direction: column;
  }

  .greeting-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   Block 3 Additions - Settings, Toasts, Dark Mode
   ============================================ */

/* --- Settings Page Styles --- */
.settings-avatar-section {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--gray-100);
}

.settings-notification-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--gray-100);
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.settings-payment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}

.text-danger { color: var(--danger); }

/* --- Toast / Snackbar System --- */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-800);
  min-width: 280px;
  max-width: 420px;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hiding {
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 2px;
  font-size: 0.875rem;
  line-height: 1;
  transition: color var(--transition-fast);
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--gray-700);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: width linear;
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}
.toast.toast-success .toast-icon {
  background: var(--success-light);
  color: var(--success);
}
.toast.toast-success .toast-progress {
  background: var(--success);
}

.toast.toast-error {
  border-left: 4px solid var(--danger);
}
.toast.toast-error .toast-icon {
  background: var(--danger-light);
  color: var(--danger);
}
.toast.toast-error .toast-progress {
  background: var(--danger);
}

.toast.toast-warning {
  border-left: 4px solid var(--warning);
}
.toast.toast-warning .toast-icon {
  background: var(--warning-light);
  color: var(--warning);
}
.toast.toast-warning .toast-progress {
  background: var(--warning);
}

.toast.toast-info {
  border-left: 4px solid var(--info);
}
.toast.toast-info .toast-icon {
  background: var(--info-light);
  color: var(--info);
}
.toast.toast-info .toast-progress {
  background: var(--info);
}

/* --- Dark Mode Toggle Button (topbar) --- */
.dark-mode-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.1rem;
}

.dark-mode-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --white: #1a1d23;
  --gray-50: #12141a;
  --gray-100: #1e2028;
  --gray-200: #2a2d36;
  --gray-300: #363940;
  --gray-400: #4a4e57;
  --gray-500: #6e7380;
  --gray-600: #9ca2b0;
  --gray-700: #c0c5d0;
  --gray-800: #dfe2e8;
  --gray-900: #eef0f4;
  --dark: #eef0f4;

  --primary-light: rgba(254, 97, 0, 0.15);
  --primary-50: rgba(254, 97, 0, 0.08);
  --primary-100: rgba(254, 97, 0, 0.12);

  --success-light: rgba(40, 199, 111, 0.15);
  --warning-light: rgba(255, 153, 0, 0.15);
  --danger-light: rgba(255, 77, 77, 0.15);
  --info-light: rgba(53, 119, 241, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] body {
  color-scheme: dark;
}

[data-theme="dark"] .proto-nav {
  background: #0d0f14;
}

[data-theme="dark"] .sidebar {
  border-right-color: var(--gray-200);
}

[data-theme="dark"] .greeting-card {
  background: linear-gradient(135deg, #c44e00 0%, #6b5dbd 100%);
}

[data-theme="dark"] .badge-success {
  background: rgba(40, 199, 111, 0.2);
}
[data-theme="dark"] .badge-warning {
  background: rgba(255, 153, 0, 0.2);
}
[data-theme="dark"] .badge-danger {
  background: rgba(255, 77, 77, 0.2);
}
[data-theme="dark"] .badge-info {
  background: rgba(53, 119, 241, 0.2);
}
[data-theme="dark"] .badge-gray {
  background: var(--gray-300);
}

[data-theme="dark"] .login-left {
  background: var(--gray-50);
}

[data-theme="dark"] .toast {
  background: #1e2028;
  border-color: var(--gray-300);
}

[data-theme="dark"] .dark-mode-btn {
  color: var(--gray-600);
}

[data-theme="dark"] .dark-mode-btn:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

[data-theme="dark"] img,
[data-theme="dark"] svg .st0 {
  fill: var(--gray-800);
}

[data-theme="dark"] .sidebar-logo svg .st0 {
  fill: var(--gray-800);
}

/* --- Toast mobile --- */
@media (max-width: 768px) {
  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    top: auto;
    bottom: var(--space-lg);
  }
  .toast {
    min-width: 0;
    max-width: none;
    transform: translateY(120%);
  }
  .toast.show {
    transform: translateY(0);
  }
  .toast.hiding {
    transform: translateY(120%);
  }
  .settings-notification-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .detail-info-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 1.25rem;
  }

  h1 { font-size: 1.5rem; }

  /* Stat card compact */
  .stat-card {
    padding: var(--space-md);
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* ============================================
   Onboarding / First-Run Wizard
   ============================================ */
.onboarding-wrapper {
  min-height: 100vh;
  background: var(--gray-50);
  padding: var(--space-xl) var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.onboarding-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.onboarding-content {
  width: 100%;
  max-width: 1100px;
}

.onboarding-hero {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.onboarding-hero-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.onboarding-radio-card {
  flex: 1;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.onboarding-radio-card:hover {
  border-color: var(--gray-400);
  background: var(--gray-50);
}

.onboarding-radio-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ============================================
   Notification Center
   ============================================ */
.notifications-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.notification-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  transition: all var(--transition-fast);
  position: relative;
}

.notification-card:hover {
  box-shadow: var(--shadow-md);
}

.notification-card.unread {
  background: var(--primary-50);
  border-color: var(--primary-100);
}

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

.notification-card-content {
  flex: 1;
  min-width: 0;
}

.notification-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
}

.notification-card-header h5 {
  margin: 0;
  font-size: 0.9375rem;
}

.notification-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
}

.notification-card:not(.unread) .notification-card-dot {
  display: none;
}

/* ============================================
   Two-col layout custom widths
   ============================================ */
.two-col {
  --col-left: 1fr;
  --col-right: 1fr;
}

/* ============================================
   Textarea
   ============================================ */
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-400);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  resize: vertical;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(254, 97, 0, 0.1);
}

/* ============================================
   Misc helpers
   ============================================ */
.mb-sm { margin-bottom: var(--space-sm); }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.flex-wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* 3-col form row */
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 768px) {
  .form-row-3 {
    grid-template-columns: 1fr;
  }
  .notification-card {
    padding: var(--space-md);
  }
  .notification-card-header {
    flex-direction: column;
    gap: var(--space-xs);
  }
  .onboarding-radio-card {
    padding: var(--space-md);
  }
}

@media (max-width: 480px) {
  .onboarding-wrapper {
    padding: var(--space-md) var(--space-sm);
  }
}

/* Dark mode overrides for new components */
[data-theme="dark"] .notification-card {
  background: var(--dark);
  border-color: #3a3f4b;
}

[data-theme="dark"] .notification-card.unread {
  background: #2e2520;
  border-color: #4a3520;
}

[data-theme="dark"] .notification-card-icon {
  opacity: 0.9;
}

[data-theme="dark"] .onboarding-wrapper {
  background: #1a1d24;
}

[data-theme="dark"] .onboarding-radio-card {
  border-color: #3a3f4b;
  background: var(--dark);
}

[data-theme="dark"] .onboarding-radio-card.selected {
  border-color: var(--primary);
  background: #2e2520;
}

[data-theme="dark"] .form-textarea {
  background: var(--dark);
  border-color: #3a3f4b;
  color: #e0e0e0;
}
