:root {
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;

  --ink: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --panel: #f8fafc;
  --card: #ffffff;

  --sidebar-bg: #0b1220;
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #ffffff;
  --sidebar-active-bg: rgba(59,130,246,.16);
  --sidebar-active-text: #eaf2ff;

  --anx-bg: var(--panel);
  --anx-card: var(--card);
  --anx-border: var(--border);
  --anx-ink: var(--ink);
  --anx-muted: var(--muted);
  --anx-primary: var(--primary-600);
  --anx-primary-600: var(--primary-600);
  --anx-primary-700: var(--primary-700);
  --anx-accent: #10b981;
  --anx-danger: #ef4444;
  --anx-warning: #f59e0b;

  --ring: 0 0 0 1px rgba(17,24,39,.06), 0 1px 2px rgba(17,24,39,.06);
  --shadow-lg: 0 12px 28px rgba(15,23,42,.18);
}

html, body { height: 100%; }

body {
  background: var(--panel);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.soft-card, .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--ring);
}

.card { padding: 1rem 1.25rem; }

.dropdown-panel {
  max-height: 70vh;
  overflow: auto;
}

.chip {
  border-radius: 999px;
  padding: .35rem .75rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  font-size: .8rem;
  border: 1px solid rgba(0, 0, 0, .07);
}

.chip i { font-size: .8rem; }

.chip-orange { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.chip-green  { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.chip-rose   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.enhanced-card { position: relative; overflow: hidden; }
.enhanced-card:before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    radial-gradient(540px 160px at 20% -50%, rgba(59, 130, 246, .12), transparent),
    radial-gradient(560px 180px at 120% 120%, rgba(59, 130, 246, .10), transparent);
}
.enhanced-card .inner { position: relative; }

/* -------- Shared list + badge system (fixes your Booking Pipeline layout) -------- */

.list-row { position: relative; }

.list-row > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  padding: .25rem .25rem;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
}

.list-row > a:hover {
  background: rgba(248,250,252,.9);
}

.list-name {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .85rem;
  letter-spacing: .02em;
  background: rgba(243,244,246,.95);
  color: #111827;
  border: 1px solid rgba(229,231,235,.95);
  box-shadow: 0 10px 20px rgba(15,23,42,.06);
  flex: 0 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .26rem .65rem;
  border-radius: 999px;
  font-weight: 900;
  font-size: .75rem;
  border: 1px solid rgba(229,231,235,.95);
  background: rgba(243,244,246,.92);
  color: #374151;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: .55;
}

.badge-gray {
  background-color: #f3f4f6;
  color: #374155;
  border: 1px solid #e5e7eb;
}

.badge-red {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-green {
  background: #ecfdf5;
  color: #065f46;
  border-color: #bbf7d0;
}

.badge-amber {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.badge-blue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.badge-purple {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.stat-pill {
  border-radius: 16px;
  border: 1px solid rgba(229,231,235,.92);
  background: rgba(255,255,255,.70);
  padding: .65rem .75rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.metric-tile {
  display: flex;
  align-items: center;
  gap: .75rem;
  border-radius: 16px;
  border: 1px solid rgba(229,231,235,.92);
  background: rgba(255,255,255,.72);
  padding: .75rem .85rem;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

.metric-tile:hover {
  background: rgba(255,255,255,.92);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15,23,42,.08);
}

/* ------------------------------------------------------------------------------ */

.sidebar {
  background: radial-gradient(900px 500px at 10% 0%, rgba(59,130,246,.18), transparent 55%),
              radial-gradient(700px 460px at 120% 20%, rgba(16,185,129,.10), transparent 60%),
              var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 8px 0 22px rgba(2,6,23,.28);
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 40;
  width: 256px;
}

.sidebar-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255,255,255,.02);
  transition: padding .28s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  user-select: none;
  transition: .28s;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  position: relative;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  letter-spacing: .02em;
  font-size: .8rem;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  box-shadow: 0 10px 22px rgba(59, 130, 246, 0.28);
}

.brand-mark:before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.brand-wordmark {
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
  font-size: 1.08rem;
}

.brand-wordmark .tripi { color: #ffffff; }
.brand-wordmark .sort  { color: #93c5fd; }

.brand-sub {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: rgba(148,163,184,.92);
  letter-spacing: .02em;
  margin-top: -2px;
}

.nav-section-title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: rgba(148,163,184,.70);
  font-weight: 800;
  margin-bottom: .55rem;
  padding-left: 1rem;
  margin-top: 1.25rem;
  transition: all .28s ease;
}

.nav-section-title:first-child { margin-top: 0.5rem; }

.side-link {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .72rem 1rem;
  border-radius: 12px;
  color: var(--sidebar-text);
  transition: all 0.18s ease;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  margin: 0.12rem 0.65rem;
  border: 1px solid rgba(255,255,255,0);
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text-hover);
  border-color: rgba(255,255,255,.06);
}

.side-link-icon {
  width: 20px;
  text-align: center;
  transition: transform 0.18s ease, color 0.18s ease;
  flex-shrink: 0;
  font-size: 1rem;
  color: rgba(148,163,184,.92);
}

.side-link:hover .side-link-icon {
  color: #ffffff;
  transform: scale(1.08);
}

.active-nav {
  background: linear-gradient(135deg, rgba(59,130,246,.20), rgba(59,130,246,.10));
  color: var(--sidebar-active-text);
  font-weight: 700;
  border-color: rgba(59,130,246,.28);
  box-shadow: 0 10px 22px rgba(2,6,23,.25);
}

.active-nav .side-link-icon {
  color: #dbeafe;
  transform: scale(1.05);
}

.sidebar-toggle {
  position: absolute;
  top: 1rem;
  right: -12px;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: rgba(15,23,42,.95);
  border: 1px solid rgba(148,163,184,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(2,6,23,.32);
  transition: all 0.22s ease;
  z-index: 10;
}

.sidebar-toggle:hover {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  border-color: rgba(255,255,255,.10);
  transform: scale(1.06);
}

.sidebar-toggle i {
  font-size: .72rem;
  color: rgba(226,232,240,.92);
  transition: transform .28s ease;
}

.sidebar.minimized .sidebar-toggle i { transform: rotate(180deg); }

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem;
  transition: all .28s ease;
}

.sidebar-footer .text-xs { color: rgba(148,163,184,.75); }

.sidebar.minimized { width: 72px; }

.sidebar.minimized .brand-wordmark,
.sidebar.minimized .brand-sub,
.sidebar.minimized .side-link span,
.sidebar.minimized .nav-section-title,
.sidebar.minimized .sidebar-toggle-text {
  opacity: 0;
  visibility: hidden;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sidebar.minimized .brand { justify-content: center; padding: 0; }
.sidebar.minimized .brand-mark { margin: 0; }
.sidebar.minimized .side-link { justify-content: center; padding: 0.75rem; }
.sidebar.minimized .side-link-icon { margin: 0; }
.sidebar.minimized .sidebar-footer { padding: 1rem 0.5rem; }
.sidebar.minimized .sidebar-header { padding-left: .5rem; padding-right: .5rem; }

aside .overflow-y-auto { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.35) transparent; }
aside .overflow-y-auto::-webkit-scrollbar { width: 8px; }
aside .overflow-y-auto::-webkit-scrollbar-track { background: transparent; }
aside .overflow-y-auto::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,.28);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
aside .overflow-y-auto::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.42); }

.app-header {
  background: rgba(255,255,255,.86);
  border-bottom: 1px solid rgba(229,231,235,.9);
  backdrop-filter: blur(10px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(229,231,235,.9);
  color: var(--muted);
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  position: relative;
  cursor: pointer;
  box-shadow: var(--ring);
}

.header-action-btn:hover {
  background: #fff;
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15,23,42,.10);
}

.header-action-btn:active {
  transform: translateY(0);
  box-shadow: var(--ring);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: 2px solid #fff;
}

.brand-switcher, .user-menu {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .85rem .55rem .55rem;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(229,231,235,.9);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  cursor: pointer;
  box-shadow: var(--ring);
}

.brand-switcher { min-width: 220px; padding: .58rem .85rem; }
.user-menu { min-width: 200px; }

.brand-switcher:hover, .user-menu:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15,23,42,.10);
}

.brand-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: .8rem;
  box-shadow: 0 10px 18px rgba(37,99,235,.20);
  flex-shrink: 0;
}

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

.brand-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-status {
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b1220, #111827);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  box-shadow: 0 10px 18px rgba(2,6,23,.18);
  flex-shrink: 0;
}

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

.user-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.lang-form { display: inline-flex; align-items: center; }
.lang-select {
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(229,231,235,.9);
  background: rgba(255,255,255,.92);
  color: var(--ink);
  padding: 0 .85rem;
  font-weight: 700;
  box-shadow: var(--ring);
}

.lang-select:focus {
  outline: none;
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

.main-content {
  margin-left: 256px;
  transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
}
.sidebar.minimized ~ .main-content { margin-left: 72px; }
@media (max-width: 1023px) {
  .main-content { margin-left: 0 !important; }
}

.content-wrapper { flex: 1; padding: 0; }

.page-content {
  padding: 1.5rem;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 640px) { .page-content { padding: 1.75rem 2.5rem; } }
@media (min-width: 1280px) { .page-content { padding: 2rem 3rem; } }

.page-header-compact {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.page-title-compact {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.page-head h1 {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.page-head .actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.btn, a.btn, button.btn, input.btn[type=submit] {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: .875rem;
  padding: .52rem .95rem;
  border-radius: .75rem;
  border: 1px solid rgba(229,231,235,.9);
  background: #fff;
  color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: var(--ring);
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(15,23,42,.08); background: #fff; }
.btn:active { transform: translateY(0); box-shadow: var(--ring); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #fff;
  border-color: rgba(29,78,216,.65);
  box-shadow: 0 12px 24px rgba(37,99,235,.22);
}

.btn-primary:hover { filter: brightness(1.02); }

.btn-secondary { background: rgba(248,250,252,.9); color: var(--ink); }
.btn-secondary:hover { background: #fff; }

.btn-danger { background: var(--anx-danger); color: #fff; border-color: transparent; }

.btn-outline {
  background: #fff;
  color: var(--primary-700);
  border-color: rgba(29,78,216,.35);
}

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink); box-shadow: none; }

.btn-icon { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }

.actions a:not(.btn) {
  border: 1px solid rgba(229,231,235,.9);
  border-radius: .75rem;
  padding: .5rem .85rem;
  color: var(--ink);
  background: rgba(255,255,255,.92);
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: var(--ring);
}

.actions a:not(.btn):hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(15,23,42,.08); background: #fff; }

.form-group { margin-bottom: 1rem; }

label, .form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.375rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="search"],
input[type="password"],
select,
textarea {
  display: block;
  width: 100%;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 0.75rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  color: var(--ink);
  box-shadow: var(--ring);
  transition: box-shadow .18s, border-color .18s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.7rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 2.4rem;
}

textarea { min-height: 120px; resize: vertical; }

.form-helper-text {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.375rem;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.875rem;
}

thead th {
  background: #f9fafb;
  font-size: .75rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  text-align: start;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(229,231,235,.7);
  vertical-align: middle;
  color: #374151;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f9fafb; }
tbody tr { transition: background .1s ease; }

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(229,231,235,.9);
  background: #fff;
}

.sticky-head thead th { position: sticky; top: 0; z-index: 1; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.toolbar .left, .toolbar .right {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.toolbar .search-wrap {
  position: relative;
  min-width: 240px;
  max-width: 360px;
  width: 100%;
}

.toolbar .search-wrap input[type="search"] { padding-left: 2.25rem; }
.toolbar .search-wrap .ico {
  position: absolute;
  left: .65rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: .55;
  font-size: .9rem;
}

nav.pagination, .pagination nav {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  margin-top: 1rem;
}

nav.pagination a, .pagination a, .pagination span {
  border: 1px solid rgba(229,231,235,.9);
  padding: .42rem .78rem;
  border-radius: .75rem;
  font-size: .85rem;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  box-shadow: var(--ring);
}

nav.pagination .active, .pagination .active {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #fff;
  border-color: rgba(29,78,216,.55);
}

/* ---------- Equal-height grid system for dashboard cards ---------- */
.grid-eq { align-items: stretch; }
.card-eq { display: flex; flex-direction: column; }
.card-body-eq { flex: 1; min-height: 0; }

/* ---------- Section headings ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 16px;
}
.section-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Stat counters for dashboard pipeline ---------- */
.stat-pill {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fafafa;
  padding: .6rem .75rem;
  text-align: center;
}

/* ---------- Metric tiles (services breakdown) ---------- */
.metric-tile {
  display: flex;
  align-items: center;
  gap: .75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fafafa;
  padding: .75rem .85rem;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.metric-tile:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
}

.metric-ico {
  width: 36px;
  height: 36px;
  font-size: .9rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- Empty state ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
}
.empty-state i { font-size: 2rem; margin-bottom: .75rem; opacity: .4; }
.empty-state p { font-size: .875rem; }

/* ---------- Status dots ---------- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ---------- Table within cards (borderless) ---------- */
.table-wrap table { border: none; border-radius: 0; }

/* ---------- Scrollbar for content areas ---------- */
.page-content ::-webkit-scrollbar { width: 6px; height: 6px; }
.page-content ::-webkit-scrollbar-track { background: transparent; }
.page-content ::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,.25);
  border-radius: 9999px;
}
.page-content ::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.4); }

/* ---------------------------------------------------------------- */

.calculator-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(15,23,42,.25);
  z-index: 1000;
  display: none;
  width: 320px;
  max-width: calc(100vw - 24px);
  overflow: hidden;
  border: 1px solid rgba(229,231,235,.9);
}

.calculator-popup.active {
  display: block;
  animation: calculatorSlideIn 0.16s ease-out;
}

@keyframes calculatorSlideIn {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.calculator-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(229,231,235,.9);
  background: linear-gradient(135deg, rgba(248,250,252,.9), rgba(241,245,249,.95));
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calculator-header h3 {
  font-weight: 800;
  font-size: 1rem;
  color: var(--ink);
  margin: 0;
}

.calculator-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 10px;
  transition: all 0.12s ease;
}

.calculator-close:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }

.calculator-display {
  padding: 1.1rem 1.25rem;
  background: rgba(248,250,252,.9);
  border-bottom: 1px solid rgba(229,231,235,.9);
}

.calculator-display input {
  width: 100%;
  border: none;
  background: none;
  font-size: 1.55rem;
  font-weight: 700;
  text-align: right;
  color: var(--ink);
  outline: none;
  box-shadow: none;
}

.calculator-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(229,231,235,.9);
  padding: 1px;
}

.calculator-btn {
  border: none;
  background: #fff;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
  outline: none;
}

.calculator-btn:hover { background: rgba(248,250,252,.95); }
.calculator-btn:active { background: rgba(241,245,249,.95); }

.calculator-btn.operator {
  background: rgba(241,245,249,.95);
  color: var(--primary-600);
  font-weight: 800;
}

.calculator-btn.operator:hover { background: rgba(226,232,240,.95); }

.calculator-btn.equals {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: white;
  font-weight: 800;
}

.calculator-btn.equals:hover { filter: brightness(1.03); }

.calculator-btn.clear {
  background: rgba(254,242,242,.95);
  color: #dc2626;
  font-weight: 800;
}

.calculator-btn.clear:hover { background: rgba(254,226,226,.95); }

.calculator-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2,6,23, 0.62);
  z-index: 999;
  display: none;
}

.calculator-overlay.active { display: block; animation: fadeIn 0.14s ease-out; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.notifications-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: .55rem;
  width: 420px;
  max-width: 92vw;
  background: #fff;
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15,23,42,.18);
  z-index: 100;
  display: none;
  overflow: hidden;
}

.notifications-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(229,231,235,.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notifications-header h3 { font-weight: 900; font-size: 1rem; color: var(--ink); }

.notifications-list { max-height: 420px; overflow-y: auto; }

.notification-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(229,231,235,.85);
  transition: background 0.12s ease;
  cursor: pointer;
  display: block;
  position: relative;
  text-decoration: none;
}

.notification-item:hover { background: rgba(248,250,252,.9); }

.notification-item.unread {
  background: rgba(239,246,255,.75);
  border-left: 3px solid rgba(59,130,246,.85);
}

.notification-item.unread:before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(59,130,246,.95);
}

.notification-title { font-weight: 800; font-size: .92rem; color: var(--ink); margin-bottom: .25rem; }
.notification-message { font-size: .85rem; color: var(--muted); line-height: 1.4; margin-bottom: .5rem; }
.notification-time { font-size: .75rem; color: #9ca3af; }

.notifications-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid rgba(229,231,235,.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notifications-footer a { color: var(--primary-600); }

.anx-chat-launch {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 60;
  width: 60px;
  height: 60px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #fff;
  border: none;
  box-shadow: 0 22px 60px rgba(37,99,235, 0.30);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

.anx-chat-launch:hover { transform: scale(1.04); box-shadow: 0 28px 80px rgba(37,99,235, 0.36); }

.anx-unread {
  position: absolute;
  right: -2px;
  top: -2px;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: #22c55e;
  box-shadow: 0 0 0 2px #fff;
}

.anx-chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.25rem;
  z-index: 60;
  width: 380px;
  max-width: 92vw;
  height: 520px;
  display: none;
  background: #fff;
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: anxIn .18s ease-out both;
}

@keyframes anxIn { from { transform: translateY(12px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes anxOut { from { transform: translateY(0); opacity: 1 } to { transform: translateY(12px); opacity: 0 } }

.anx-chat-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid rgba(229,231,235,.9);
  background: rgba(248,250,252,.9);
}

.anx-chat-body { height: 100%; overflow: auto; padding: 1rem; background: #fff; }

.anx-bubble {
  max-width: 80%;
  padding: .55rem .75rem;
  border-radius: 14px;
  font-size: .92rem;
  line-height: 1.35;
}

.anx-in { background: rgba(243,244,246,.95); color: #111827; border: 1px solid rgba(229,231,235,.95); }
.anx-out { background: #0b1220; color: #fff; }

.anx-meta { font-size: .7rem; color: #6b7280; margin-top: .25rem; }

.anx-input { border-top: 1px solid rgba(229,231,235,.9); padding: .6rem; }

.anx-quick {
  border-radius: 9999px;
  padding: .35rem .65rem;
  font-size: .8rem;
  border: 1px solid rgba(229,231,235,.9);
  background: rgba(248,250,252,.95);
  color: var(--muted);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}

.anx-quick:hover { background: rgba(241,245,249,.95); color: var(--ink); }

.chat-tab {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  border-radius: 10px 10px 0 0;
  background: transparent;
  border: none;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
  transition: background .12s ease, color .12s ease;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.chat-tab:hover { color: var(--ink); background: rgba(248,250,252,.9); }

.chat-tab.active {
  color: var(--primary-600);
  border-bottom-color: var(--primary-600);
  background: #fff;
}

.chat-content { display: none; flex-direction: column; height: calc(100% - 120px); }
.chat-content.active { display: flex; }

@media (max-width: 640px) {
  .anx-chat-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    height: 72vh;
    border-radius: 18px 18px 0 0;
  }
}

#tsToastStack {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ts-toast {
  width: 380px;
  max-width: 92vw;
  background: #fff;
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15,23,42,.18);
  display: flex;
  gap: .85rem;
  padding: 1rem;
  animation: tsToastIn .18s cubic-bezier(0.4, 0, 0.2, 1) both;
  position: relative;
  overflow: hidden;
}

.ts-toast:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.ts-toast.success:before  { background: linear-gradient(90deg, #10b981, #059669); }
.ts-toast.warning:before  { background: linear-gradient(90deg, #f59e0b, #d97706); }
.ts-toast.error:before    { background: linear-gradient(90deg, #ef4444, #dc2626); }
.ts-toast.reminder:before { background: linear-gradient(90deg, #3b82f6, #1d4ed8); }

@keyframes tsToastIn { from { transform: translateX(100px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
@keyframes tsToastOut { from { transform: translateX(0); opacity: 1 } to { transform: translateX(100px); opacity: 0 } }

.ts-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(243,244,246,.95);
  color: #111827;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.ts-toast.success .ts-ico  { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #14532d; }
.ts-toast.warning .ts-ico  { background: linear-gradient(135deg, #fff7ed, #fed7aa); color: #b45309; }
.ts-toast.error .ts-ico    { background: linear-gradient(135deg, #fef2f2, #fecaca); color: #b91c1c; }
.ts-toast.reminder .ts-ico { background: linear-gradient(135deg, #eef2ff, #c7d2fe); color: #1d4ed8; }

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

.ts-content h4 {
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: .25rem;
  color: #111827;
}

.ts-content p { font-size: .9rem; color: #4b5563; line-height: 1.4; }

.ts-actions { display: flex; gap: .6rem; margin-top: .75rem; }

.ts-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .85rem;
  border-radius: .85rem;
  border: 1px solid rgba(229,231,235,.9);
  background: #fff;
  font-weight: 800;
  font-size: .85rem;
  transition: transform .12s ease, box-shadow .12s ease;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
}

.ts-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(15,23,42,.08); }

.ts-btn.primary { background: #0b1220; color: #fff; border-color: #0b1220; }

.ts-close {
  border: none;
  background: transparent;
  color: #6b7280;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, color .12s ease;
  flex-shrink: 0;
  align-self: flex-start;
}

.ts-close:hover { background: rgba(243,244,246,.95); color: #374151; }

@media (prefers-reduced-motion: reduce) {
  .anx-chat-panel, .ts-toast { animation: none !important; }
}

#exchangePopup { width: 380px; }

#exchangePopup .form-input,
#exchangePopup .form-select {
  background: #fff;
  border: 1px solid rgba(229,231,235,.9);
  border-radius: .85rem;
  padding: .55rem .85rem;
  outline: none;
  width: 100%;
  box-shadow: var(--ring);
  transition: box-shadow .18s, border-color .18s;
}

#exchangePopup .form-input:focus,
#exchangePopup .form-select:focus {
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

#exchangePopup .form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.7rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 2.4rem;
}

#exchangeResult { color: #7c4b11; word-wrap: break-word; line-height: 1.2; }

@media (max-width: 1023px) {
  .app-shell { display: block; }

  #sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 18rem;
    max-width: 86vw;
    transform: translateX(-110%);
    transition: transform 180ms ease;
    z-index: 60;
    display: flex !important;
  }

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

  #sidebarOverlay {
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 50;
  }

  body.sidebar-open #sidebarOverlay {
    opacity: 1;
    pointer-events: auto;
  }

  #mobileTopbar {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(10px);
  }

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

  .header-actions {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 64px;
    z-index: 55;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(229,231,235,.9);
    box-shadow: 0 24px 70px rgba(15,23,42,.18);
    display: none;
    flex-wrap: wrap;
    gap: 10px;
  }

  body.mobile-actions-open .header-actions { display: flex; }

  .brand-switcher, .user-menu { min-width: auto; flex: 1; }
}

@media (min-width: 1024px) {
  .header-actions { position: static; display: flex; }
}
