/* ========================================
   ZeaCargo — Components Library
   Premium Dark Theme · Glassmorphism
   ======================================== */

/* =====================
   BUTTONS
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 22px;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
  border-radius: inherit;
}

.btn:hover::before {
  background: rgba(255,255,255,0.06);
}

.btn:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-primary), inset 0 1px 0 rgba(255,255,255,0.12);
}

.btn-primary:hover {
  box-shadow: 0 6px 32px rgba(108, 99, 255, 0.55), inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #C53030 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  background: var(--primary-glow);
}

.btn-sm {
  padding: 7px 16px;
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: 14px 32px;
  font-size: var(--text-md);
  border-radius: var(--radius-xl);
  letter-spacing: 0.01em;
}

.btn-icon {
  padding: 9px;
  border-radius: var(--radius-md);
  width: 38px;
  height: 38px;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* =====================
   CARDS
   ===================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(108,99,255,0.04);
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

/* =====================
   STAT CARDS
   ===================== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--stat-accent, var(--primary)), transparent);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  opacity: 0.8;
}

.stat-card:hover {
  border-color: var(--border-default);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 30px rgba(0,0,0,0.15);
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  background: var(--stat-accent-bg, rgba(108, 99, 255, 0.12));
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
  letter-spacing: -0.04em;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--space-2);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.stat-trend.up {
  color: var(--success-light);
  background: var(--success-bg);
}

.stat-trend.down {
  color: var(--danger-light);
  background: var(--danger-bg);
}

/* =====================
   BADGES / STATUS
   ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-primary { background: rgba(108, 99, 255, 0.15); color: var(--primary-light); }
.badge-success { background: var(--success-bg); color: var(--success-light); }
.badge-warning { background: var(--warning-bg); color: var(--warning-light); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-light); }
.badge-info    { background: var(--info-bg);    color: var(--info-light); }
.badge-neutral { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary); }
.badge-purple  { background: rgba(167, 139, 250, 0.15); color: #A78BFA; }
.badge-orange  { background: rgba(251, 146, 60, 0.15); color: #FB923C; }
.badge-teal    { background: rgba(20, 184, 166, 0.15); color: #14B8A6; }

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition-base);
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(0,0,0,0.2);
}

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

.sidebar-logo {
  padding: var(--space-5) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  min-height: var(--header-height);
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}

.sidebar-logo-text {
  flex: 1;
  overflow: hidden;
}

.sidebar-logo-title {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.sidebar-logo-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4) 0;
}

.sidebar-section {
  margin-bottom: var(--space-4);
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-disabled);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 var(--space-5);
  margin-bottom: var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .sidebar-section-label {
  opacity: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-5);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: 500;
  margin: 1px 0;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-link.active {
  color: var(--primary-light);
  background: linear-gradient(90deg, rgba(108, 99, 255, 0.14), rgba(108, 99, 255, 0.04));
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  box-shadow: 0 0 10px rgba(108,99,255,0.4);
}

.sidebar-link-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-link-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--transition-base), width var(--transition-base);
}

.sidebar.collapsed .sidebar-link-text {
  opacity: 0;
  width: 0;
}

.sidebar-link-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .sidebar-link-badge {
  opacity: 0;
}

.sidebar-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
}

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

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

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  overflow: hidden;
  transition: opacity var(--transition-base);
}

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

.sidebar-user-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-user-info {
  opacity: 0;
  width: 0;
}

/* =====================
   HEADER / TOPBAR
   ===================== */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  height: var(--header-height);
  background: rgba(12, 12, 30, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  z-index: 90;
  transition: left var(--transition-base);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.topbar.sidebar-collapsed {
  left: var(--sidebar-collapsed);
}

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

.topbar-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.topbar-breadcrumb span { color: var(--text-primary); font-weight: 600; }

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

.topbar-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
  font-size: 18px;
}

.topbar-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-default);
}

.topbar-notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

.topbar-collapse-btn {
  width: 34px;
  height: 34px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  font-size: 18px;
}

.topbar-collapse-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

@media (min-width: 1025px) {
  .topbar-collapse-btn {
    display: none !important;
  }
}

/* =====================
   TABLES
   ===================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

thead {
  background: rgba(23, 23, 53, 0.8);
}

thead th {
  padding: 14px var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-subtle);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background var(--transition-fast);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(108, 99, 255, 0.03);
}

tbody td {
  padding: 14px var(--space-4);
  color: var(--text-primary);
  vertical-align: middle;
  font-size: 13px;
}

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

.table-empty {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-muted);
}

.table-empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  display: block;
}

/* Checkbox */
.table-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* =====================
   FORMS
   ===================== */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 11px 16px;
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  outline: none;
  line-height: 1.5;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 0 1px var(--primary);
  background: rgba(14, 14, 34, 0.9);
}

.form-control::placeholder {
  color: var(--text-disabled);
}

.form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: var(--space-1);
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .form-control {
  padding-left: 40px;
}

.input-group-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.input-group-icon-right {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.input-group-icon-right:hover {
  color: var(--text-primary);
}

/* Toggle Switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.toggle {
  width: 44px;
  height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: all var(--transition-base);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition-base);
}

.toggle.active {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle.active::after {
  left: calc(100% - 19px);
  background: #fff;
}

.toggle-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

/* =====================
   SEARCH BAR
   ===================== */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar .form-control {
  padding-left: 42px;
  padding-right: 14px;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

/* =====================
   MODALS
   ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  padding: var(--space-4);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(30px) scale(0.94);
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(108,99,255,0.06);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-lg {
  max-width: 780px;
}

.modal-sm {
  max-width: 400px;
}

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

.modal-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  font-size: 18px;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

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

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

/* =====================
   TOAST NOTIFICATIONS
   ===================== */
.toast-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  background: rgba(23, 23, 53, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 320px;
  max-width: 480px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.1);
  pointer-events: all;
  transform: translateX(120%);
  transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-msg {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.toast-close {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.toast-close:hover { color: var(--text-primary); }

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }

/* =====================
   TABS
   ===================== */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  flex: 1;
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.tabs-line {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.tabs-line .tab-btn {
  background: transparent;
  border-radius: 0;
  padding: 12px 20px;
  flex: unset;
  position: relative;
}

.tabs-line .tab-btn.active {
  color: var(--primary-light);
  box-shadow: none;
  background: transparent;
}

.tabs-line .tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
}

.tab-content {
  display: none;
}

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

/* =====================
   DROPDOWN MENU
   ===================== */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dropdown-item.danger {
  color: var(--danger-light);
}

.dropdown-item.danger:hover {
  background: var(--danger-bg);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0;
}

/* =====================
   AVATAR
   ===================== */
.avatar {
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-md { width: 40px; height: 40px; font-size: var(--text-sm); }
.avatar-lg { width: 52px; height: 52px; font-size: var(--text-md); }
.avatar-xl { width: 72px; height: 72px; font-size: var(--text-2xl); }

/* =====================
   PAGINATION
   ===================== */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-btn:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* =====================
   TIMELINE
   ===================== */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: var(--space-4);
  position: relative;
  padding-bottom: var(--space-6);
}

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

.timeline-item:last-child .timeline-line {
  display: none;
}

.timeline-indicator {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 28px;
}

.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  z-index: 1;
}

.timeline-dot.done {
  background: var(--success-bg);
  color: var(--success);
  border: 2px solid var(--success);
}

.timeline-dot.current {
  background: var(--primary-glow);
  color: var(--primary-light);
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  animation: pulse-ring 2s infinite;
}

.timeline-dot.pending {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 2px solid var(--border-default);
}

.timeline-line {
  flex: 1;
  width: 2px;
  background: var(--border-subtle);
  margin-top: 4px;
  min-height: 32px;
}

.timeline-line.done {
  background: linear-gradient(to bottom, var(--success), var(--border-subtle));
}

.timeline-content {
  flex: 1;
  padding-top: 4px;
  padding-bottom: var(--space-2);
}

.timeline-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* =====================
   FILTER BAR
   ===================== */
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: rgba(17, 17, 40, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-5);
}

.filter-bar .form-control {
  min-width: 180px;
  width: auto;
  flex: 1;
}

/* =====================
   EMPTY STATE
   ===================== */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 56px;
  margin-bottom: var(--space-5);
  display: block;
  opacity: 0.5;
}

.empty-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.empty-desc {
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

/* =====================
   PAGE HEADER
   ===================== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-header-left {}

.page-header h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1.15;
}

.page-header p {
  color: var(--text-muted);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* =====================
   FILE UPLOAD
   ===================== */
.file-upload {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg-input);
}

.file-upload:hover,
.file-upload.dragover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.file-upload-icon {
  font-size: 36px;
  margin-bottom: var(--space-3);
  display: block;
}

.file-upload-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.file-upload-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* =====================
   ACCORDION
   ===================== */
.accordion-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  background: var(--bg-card);
  transition: background var(--transition-fast);
  font-weight: 600;
  color: var(--text-primary);
}

.accordion-header:hover {
  background: var(--bg-elevated);
}

.accordion-icon {
  font-size: 20px;
  transition: transform var(--transition-base);
  color: var(--text-muted);
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.accordion-item.open .accordion-body {
  max-height: 1000px;
}

.accordion-content {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}

/* =====================
   PROGRESS / STEP BAR
   ===================== */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--space-8);
}

.step-item {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  border: 2px solid var(--border-default);
  color: var(--text-muted);
  background: var(--bg-elevated);
  transition: all var(--transition-base);
}

.step-item.done .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-item.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.step-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.step-item.active .step-label {
  color: var(--primary-light);
}

.step-connector {
  height: 2px;
  width: 80px;
  background: var(--border-subtle);
  margin-top: -var(--space-5);
  position: relative;
  top: -var(--space-4);
}

.step-connector.done {
  background: var(--success);
}

/* =====================
   SKELETON LOADER
   ===================== */
.skeleton {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  animation: skeleton-pulse 1.5s ease infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* =====================
   CHIPS / FILTER TAGS
   ===================== */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.chip.active {
  background: rgba(108, 99, 255, 0.15);
  border-color: var(--primary);
  color: var(--primary-light);
}

/* =====================
   MOBILE BOTTOM NAV
   ===================== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--space-2) var(--space-3);
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  min-width: 56px;
}

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

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

.bottom-nav-item.active .bottom-nav-icon-wrap {
  background: rgba(108, 99, 255, 0.15);
}

.bottom-nav-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background var(--transition-fast);
}

.bottom-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: block;
  }
}
