/* ===================================================================
   TRUCK BROKER & TRIP MANAGEMENT SYSTEM
   PREMIUM WHITE CLAYMORPHISM DESIGN SYSTEM
   =================================================================== */

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

:root {
  /* Palette Tokens */
  --bg-main: #f0f3f8;
  --bg-surface: #ffffff;
  --bg-card: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-inset: #e8ecf4;

  /* Typography Colors */
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  /* Accent & Status Colors */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;

  --success: #10b981;
  --success-dark: #059669;
  --success-soft: #ecfdf5;

  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-soft: #fffbeb;

  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-soft: #fef2f2;

  --info: #0284c7;
  --info-soft: #f0f9ff;

  /* Claymorphism Elevation Shadows */
  --clay-shadow: 8px 8px 18px #d1d9e6, -8px -8px 18px #ffffff;
  --clay-shadow-sm: 4px 4px 10px #d4dce8, -4px -4px 10px #ffffff;
  --clay-shadow-lg: 12px 12px 28px #cbd5e1, -12px -12px 28px #ffffff;
  --clay-inset: inset 3px 3px 6px #d1d9e6, inset -3px -3px 6px #ffffff;
  --clay-inset-focus: inset 2px 2px 4px #c2cddc, inset -2px -2px 4px #ffffff, 0 0 0 3px rgba(37, 99, 235, 0.2);

  /* Borders & Radii */
  --border-subtle: 1px solid rgba(226, 232, 240, 0.8);
  --border-clay: 1px solid rgba(255, 255, 255, 0.9);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-collapsed-width: 68px;
  --sidebar-expanded-width: 250px;
  --sidebar-width: var(--sidebar-collapsed-width);
}

html {
  font-size: 13.5px; /* High-density proportional scaling matching 75% zoom comfort at 100% */
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

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

/* App Layout Grid */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar Styles (Auto-close collapsed icon mode, hover-open drawer) */
.sidebar {
  width: var(--sidebar-collapsed-width);
  background: var(--bg-surface);
  border-right: var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 250;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04);
  transition: width 0.24s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.24s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  white-space: nowrap;
}

.sidebar:hover,
.sidebar.hover-expanded,
.sidebar.pinned-open {
  width: var(--sidebar-expanded-width);
  box-shadow: 12px 0 30px rgba(15, 23, 42, 0.12);
}

.sidebar-header {
  padding: 8px 14px;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 3px 3px 10px rgba(37, 99, 235, 0.3);
  flex-shrink: 0;
}

.brand-details {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease, max-width 0.24s ease;
}

.sidebar:hover .brand-details,
.sidebar.hover-expanded .brand-details,
.sidebar.pinned-open .brand-details {
  opacity: 1;
  max-width: 180px;
  pointer-events: auto;
}

.brand-details h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.brand-details span {
  font-size: 0.70rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.sidebar-menu {
  padding: 8px 6px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.menu-category {
  display: none;
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.08em;
  padding: 12px 14px 4px;
  list-style: none;
  white-space: nowrap;
  background: transparent;
  height: auto;
  border: none;
  line-height: 1.2;
}

.sidebar:hover .menu-category,
.sidebar.hover-expanded .menu-category,
.sidebar.pinned-open .menu-category {
  display: block;
}

.sidebar-divider {
  display: block;
  height: 1px;
  background: #e2e8f0;
  margin: 6px 12px;
  list-style: none;
}

.sidebar:hover .sidebar-divider,
.sidebar.hover-expanded .sidebar-divider,
.sidebar.pinned-open .sidebar-divider {
  display: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 13px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
}

.sidebar-link i, .sidebar-link svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  stroke-width: 2.2;
  flex-shrink: 0;
}

.sidebar-link span {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease, max-width 0.22s ease;
  display: inline-block;
}

.sidebar:hover .sidebar-link span,
.sidebar.hover-expanded .sidebar-link span,
.sidebar.pinned-open .sidebar-link span {
  opacity: 1;
  max-width: 180px;
  pointer-events: auto;
}

.sidebar-link:hover {
  background: var(--bg-main);
  color: var(--primary);
  transform: translateX(2px);
}

.sidebar-link.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 3px 3px 12px rgba(37, 99, 235, 0.35);
  font-weight: 600;
}

.sidebar-link.active i, .sidebar-link.active svg {
  color: #ffffff;
}

.sidebar-footer {
  padding: 8px 6px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfd;
  flex-shrink: 0;
  overflow: hidden;
}

.user-badge-card {
  background: var(--bg-surface);
  padding: 6px;
  border-radius: var(--radius-md);
  box-shadow: var(--clay-shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  opacity: 0;
  max-width: 0;
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease, max-width 0.24s ease;
}

.sidebar:hover .user-info,
.sidebar.hover-expanded .user-info,
.sidebar.pinned-open .user-info {
  opacity: 1;
  max-width: 180px;
  pointer-events: auto;
}

.user-info .user-name {
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-info .user-business {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Main Content Wrapper */
.main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.24s ease, width 0.24s ease;
}

.sidebar.pinned-open ~ .main-wrapper {
  margin-left: var(--sidebar-expanded-width);
  width: calc(100% - var(--sidebar-expanded-width));
}

.main-content {
  padding: 14px 18px;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

/* Top Navigation Bar */
.topbar {
  height: 54px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle-btn {
  background: var(--bg-surface);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  box-shadow: var(--clay-shadow-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.sidebar-toggle-btn:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.page-title-box h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.breadcrumbs {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.workspace-badge {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Claymorphic Cards & Surfaces */
.clay-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--clay-shadow-sm);
  border: var(--border-clay);
  padding: 16px 20px;
  position: relative;
  transition: var(--transition);
}

.clay-card:hover {
  box-shadow: 8px 8px 20px #cbd5e1, -8px -8px 20px #ffffff;
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.card-header-flex h2, .card-header-flex h3 {
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* KPI Summary Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--clay-shadow-sm);
  border: var(--border-clay);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

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

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--clay-shadow-sm);
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Distinct KPI Themes */
.kpi-blue .kpi-icon-wrap { background: #dbeafe; color: #1d4ed8; }
.kpi-green .kpi-icon-wrap { background: #d1fae5; color: #047857; }
.kpi-orange .kpi-icon-wrap { background: #fef3c7; color: #b45309; }
.kpi-red .kpi-icon-wrap { background: #fee2e2; color: #b91c1c; }
.kpi-purple .kpi-icon-wrap { background: #ede9fe; color: #6d28d9; }
.kpi-indigo .kpi-icon-wrap { background: #e0e7ff; color: #4338ca; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 4px 4px 12px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 6px 6px 16px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--clay-shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.8);
}
.btn-secondary:hover {
  background: #f8fafc;
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 4px 4px 12px rgba(16, 185, 129, 0.35);
}
.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 4px 4px 12px rgba(239, 68, 68, 0.35);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 4px 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-outline-danger {
  background: #ffffff;
  color: #ef4444;
  border: 1px solid #fecaca;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.btn-outline-danger:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #f87171;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

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

/* Clay Inset Inputs, Selects & Forms */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-control, .form-select {
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-main);
  background: var(--bg-inset);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--clay-inset);
  transition: var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--clay-inset-focus);
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.table-custom {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  text-align: left;
}

.table-custom thead th {
  background: #f1f5f9;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.table-custom tbody tr {
  transition: var(--transition);
}

.table-custom tbody tr:hover {
  background-color: #f8fafc;
}

.table-custom tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf2f7;
  color: var(--text-main);
  vertical-align: middle;
}

.table-custom td .text-sub,
.table-custom td small {
  font-size: 0.72rem;
  line-height: 1.25;
}

.table-custom .btn-sm {
  padding: 3px 8px;
  font-size: 0.75rem;
}

.table-custom .btn-icon-only {
  width: 26px;
  height: 26px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-success { background: var(--success-soft); color: var(--success-dark); border: 1px solid #a7f3d0; }
.badge-warning { background: var(--warning-soft); color: var(--warning-dark); border: 1px solid #fde68a; }
.badge-danger { background: var(--danger-soft); color: var(--danger-dark); border: 1px solid #fecaca; }
.badge-info { background: var(--info-soft); color: var(--info); border: 1px solid #bae6fd; }
.badge-secondary { background: #f1f5f9; color: var(--text-muted); border: 1px solid #cbd5e1; }

/* Filter Bar */
.filter-bar {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--clay-shadow-sm);
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-bar .form-control,
.filter-bar .form-select {
  padding: 6px 10px;
  font-size: 0.82rem;
  height: 35px;
  border-radius: var(--radius-sm);
}

.filter-bar .form-label {
  font-size: 0.72rem;
  margin-bottom: 2px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: var(--border-clay);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog-large {
  max-width: 1100px;
  height: 90vh;
}

@keyframes modalPop {
  from { transform: scale(0.96) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 20px 28px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  transition: var(--transition);
}
.modal-close-btn:hover {
  background: #f1f5f9;
  color: var(--danger);
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #fafbfd;
}

/* Multi-Step Wizard Styling */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  gap: 32px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  position: relative;
}

.wizard-step-num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: var(--transition);
}

.wizard-step.active {
  color: var(--primary);
}

.wizard-step.active .wizard-step-num {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.wizard-step.completed .wizard-step-num {
  background: var(--success);
  color: #fff;
}

/* Sub-card Repeaters (Loading / Delivery / Advances) */
.repeater-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  box-shadow: var(--clay-shadow-sm);
}

.repeater-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.repeater-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Financial Summary Box */
.summary-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--clay-shadow-sm);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 0.88rem;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row.total {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  padding-top: 12px;
  border-top: 2px solid #cbd5e1;
}

/* Alerts and Flash Notifications */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--clay-shadow-sm);
}

.alert-success { background: var(--success-soft); color: var(--success-dark); border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-soft); color: var(--danger-dark); border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-soft); color: var(--warning-dark); border: 1px solid #fde68a; }
.alert-info { background: var(--info-soft); color: var(--info); border: 1px solid #bae6fd; }

/* ===================================================================
   DATE RANGE PRESET DROPDOWN COMPONENT
   =================================================================== */
.date-preset-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.date-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 0.80rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  box-shadow: var(--clay-shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.date-preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--clay-shadow);
  transform: translateY(-1px);
}

.date-preset-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 270px;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.16), 0 0 1px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
  padding: 8px;
  z-index: 300;
  display: none;
}

.date-preset-menu.active {
  display: block;
  animation: fadeInDown 0.15s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.preset-menu-header {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.06em;
  padding: 6px 10px 4px;
}

.preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #1e293b;
  border-radius: 6px;
  transition: var(--transition);
  text-decoration: none;
  cursor: pointer;
}

.preset-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.preset-item.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.preset-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 6px 0;
}

.preset-custom-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  margin-top: 6px;
}

.preset-custom-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Feature Checkboxes Grid in Admin Modal */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.feature-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: var(--transition);
}

.feature-checkbox-card:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

.feature-checkbox-card input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  cursor: pointer;
}

.feature-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
}

.feature-desc {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
}

/* Quick Expiry Date Preset Buttons */
.expiry-presets-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn-preset-pill {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  cursor: pointer;
  transition: var(--transition);
}

.btn-preset-pill:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .sidebar {
    width: var(--sidebar-expanded-width);
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar .brand-details,
  .sidebar .sidebar-link span,
  .sidebar .user-info {
    opacity: 1 !important;
    max-width: none !important;
    pointer-events: auto !important;
  }
  .sidebar .menu-category {
    display: block !important;
    font-size: 0.68rem !important;
    height: auto !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 10px 14px 4px !important;
  }
  .sidebar .sidebar-divider {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }
  .modal-dialog-large {
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
  }
}

/* ==========================================================================
   Date Range Presets Dropdown & Master Admin Custom Components
   ========================================================================== */
.date-preset-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.date-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.date-preset-btn:hover {
  border-color: var(--primary);
  background: #f8fafc;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.12);
}

.date-preset-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 290px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.04);
  padding: 8px 0;
  z-index: 400;
  display: none;
  overflow: hidden;
}

.date-preset-menu.active {
  display: block;
  animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownPop {
  0% { opacity: 0; transform: translateY(-6px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.preset-menu-header {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  padding: 6px 16px 4px;
}

.preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  font-size: 0.82rem;
  color: #334155;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.preset-item:hover {
  background: #f1f5f9;
  color: var(--primary);
  font-weight: 600;
}

.preset-item.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-weight: 700;
  border-left: 3px solid var(--primary);
}

.preset-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 6px 0;
}

.preset-custom-box {
  padding: 10px 14px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

.preset-custom-title {
  font-size: 0.70rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

/* Feature Checkboxes Grid for Admin Provisioning */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.feature-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.feature-checkbox-card:hover {
  border-color: #93c5fd;
  background: #f8fafc;
  transform: translateY(-1px);
}

.feature-checkbox-card.selected {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.04);
}

.feature-checkbox-card input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

.feature-card-content {
  flex: 1;
}

.feature-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.feature-card-desc {
  font-size: 0.70rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

/* Expiry Presets Pills */
.btn-group-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn-preset-pill {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

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

/* Show User Modal Stats & Details */
.profile-header-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.profile-avatar-circle {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.profile-stat-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-clay-sm);
}

.profile-stat-label {
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 3px;
}

/* Print CSS */
@media print {
  .sidebar, .topbar, .btn, .filter-bar, .modal-footer, .no-print {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .clay-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    padding: 10px !important;
  }
}
