/* ==========================================================================
   ALIcryptoNforex69 Signal Server — Premium B2B SaaS UI
   Vanilla CSS design system for FastAPI/Jinja templates and JS-rendered markup
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-2: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f3f4f6;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --faint: #cbd5e1;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-darker: #1e3a8a;
  --accent-soft: #eff6ff;
  --accent-tint: #dbeafe;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --amber: #f59e0b;
  --sidebar: #08111f;
  --sidebar-2: #0f172a;
  --sidebar-line: rgba(148, 163, 184, 0.16);
  --sidebar-hover: rgba(148, 163, 184, 0.12);
  --sidebar-active: rgba(37, 99, 235, 0.18);
  --sidebar-muted: #94a3b8;
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:
    0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:
    0 12px 30px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.14);
  --focus: 0 0 0 4px rgba(37, 99, 235, 0.18);
  --sidebar-w: 280px;
  --content-max: 1480px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(
      900px 500px at 18% -20%,
      rgba(37, 99, 235, 0.1),
      transparent 62%
    ),
    radial-gradient(
      800px 520px at 100% 0%,
      rgba(14, 165, 233, 0.08),
      transparent 58%
    ),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}
h1,
h2,
h3,
h4 {
  color: var(--ink);
  letter-spacing: -0.035em;
  line-height: 1.12;
}
a {
  color: inherit;
  text-decoration: none;
}
code,
pre,
kbd {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-feature-settings: "liga" 0;
}
button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
}
button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}
label {
  display: block;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  padding: 0 13px;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}
input:hover,
select:hover,
textarea:hover {
  border-color: #aab7c8;
}
input:focus,
select:focus,
textarea:focus,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--focus), var(--shadow-xs);
}
select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
::selection {
  background: var(--accent-tint);
  color: var(--accent-darker);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border: 3px solid transparent;
  border-radius: var(--r-pill);
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
  background-clip: padding-box;
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.muted {
  color: var(--muted);
}
.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.icon-sm {
  width: 15px;
  height: 15px;
}
.icon-lg {
  width: 22px;
  height: 22px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Brand */
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 55%, #1e3a8a 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.28);
}

/* Auth */
.auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(
      900px 540px at 0% 0%,
      rgba(37, 99, 235, 0.16),
      transparent 58%
    ),
    radial-gradient(
      720px 520px at 100% 20%,
      rgba(14, 165, 233, 0.12),
      transparent 56%
    ),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.auth-shell {
  width: min(448px, 100%);
}
.auth-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}
.auth-card-visual {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute;
  display: block;
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.6;
}
.orb-one {
  width: 160px;
  height: 160px;
  right: -80px;
  top: -80px;
  background: rgba(37, 99, 235, 0.15);
}
.orb-two {
  width: 130px;
  height: 130px;
  left: -78px;
  bottom: -78px;
  background: rgba(14, 165, 233, 0.12);
}
.auth-brand,
.auth-heading,
.login-form,
.auth-footer {
  position: relative;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 30px 32px 12px;
}
.auth-brand strong {
  display: block;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.035em;
}
.auth-brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.auth-heading {
  padding: 10px 32px 0;
}
.auth-heading h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 850;
}
.auth-heading p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.login-form {
  display: grid;
  gap: 17px;
  padding: 25px 32px 32px;
}
.field-label {
  display: grid;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 750;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.field-icon {
  position: absolute;
  left: 14px;
  color: var(--muted-2);
  pointer-events: none;
}
.input-wrap input {
  padding-left: 42px;
}
.auth-submit {
  width: 100%;
  margin-top: 3px;
  min-height: 46px;
}
.auth-footer {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.78);
  padding: 17px 32px;
  color: var(--muted);
  font-size: 12px;
}
.auth-footer strong {
  color: var(--ink-2);
  font-size: 12px;
}
.form-error {
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: var(--r-md);
  background: var(--danger-soft);
  color: var(--danger);
  padding: 11px 13px;
  font-size: 12.5px;
  font-weight: 700;
}
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* App shell */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100dvh;
  min-height: 100vh;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(
      600px 280px at 50% -10%,
      rgba(37, 99, 235, 0.22),
      transparent 62%
    ),
    linear-gradient(180deg, #0b1220 0%, #08111f 100%);
  color: #e2e8f0;
  padding: 22px 16px 18px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border-radius: var(--r-lg);
  padding: 4px 8px;
  color: #fff;
  transition: background 180ms ease;
}
.sidebar-brand:hover {
  background: rgba(255, 255, 255, 0.04);
}
.sidebar-brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.sidebar-brand-text strong {
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.02em;
}
.sidebar-brand-text small {
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 600;
}
.sidebar-nav {
  display: grid;
  gap: 5px;
}
.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border-radius: 13px;
  color: #bfcbda;
  font-size: 13px;
  font-weight: 700;
  padding: 0 13px;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}
.sidebar-nav a .icon {
  color: #8293aa;
  transition: color 180ms ease;
}
.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sidebar-nav a:hover .icon {
  color: #dbeafe;
}
.sidebar-nav a.active {
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.26),
    rgba(59, 130, 246, 0.12)
  );
  color: #fff;
  box-shadow:
    inset 1px 0 0 rgba(147, 197, 253, 0.9),
    0 10px 26px rgba(15, 23, 42, 0.22);
}
.sidebar-nav a.active .icon {
  color: #93c5fd;
}
.sidebar-session {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: auto;
  border: 1px solid var(--sidebar-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}
.sidebar-user-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.sidebar-user-text strong,
.sidebar-session strong {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-text small,
.sidebar-session small {
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 600;
}
.sidebar-signout,
.sidebar-session .secondary-button {
  grid-column: 1 / -1;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: #cbd5e1;
  box-shadow: none;
}
.sidebar-signout:hover:not(:disabled),
.sidebar-session .secondary-button:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.26);
  background: rgba(220, 38, 38, 0.14);
  color: #fecaca;
}

.dashboard-main {
  min-width: 0;
  width: min(var(--content-max), 100%);
  margin: 0 auto;
  padding: 28px 34px 58px;
}
.dashboard-header,
.page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin: -28px -34px 28px;
  padding: 28px 34px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(18px);
}
.page-title-block {
  min-width: 0;
}
.dashboard-header h1,
.page-header h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 850;
}
.page-subtitle {
  max-width: 68ch;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.header-actions,
.page-actions,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.page-content {
  display: grid;
  gap: 18px;
}

/* Buttons */
.primary-button,
.secondary-button,
.danger-button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--r-md);
  padding: 0 15px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}
.primary-button,
.btn-primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow:
    0 1px 2px rgba(37, 99, 235, 0.25),
    0 8px 18px rgba(37, 99, 235, 0.18);
}
.primary-button:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.26);
  transform: translateY(-1px);
}
.secondary-button,
.btn-secondary {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
}
.secondary-button:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.38);
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: var(--shadow-sm);
}
.danger-button,
.btn-danger {
  border: 1px solid rgba(220, 38, 38, 0.24);
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: var(--shadow-xs);
}
.danger-button:hover:not(:disabled),
.btn-danger:hover:not(:disabled) {
  background: #fee2e2;
  box-shadow: var(--shadow-sm);
}
.btn-ghost {
  color: var(--muted);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--ink);
}
.btn-sm {
  min-height: 32px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  font-size: 12px;
}
.btn-icon {
  width: 40px;
  padding: 0;
}
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border-radius: var(--r-sm);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 750;
  padding: 0 9px;
  transition:
    background 180ms ease,
    color 180ms ease;
}
.text-btn:hover {
  background: var(--accent-soft);
}

/* Status */
.live-state,
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 14px;
  box-shadow: var(--shadow-xs);
}
.live-state span,
.live-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
  transition:
    background 200ms ease,
    box-shadow 200ms ease;
}
.live-state.online,
.live-pill.online {
  border-color: rgba(5, 150, 105, 0.25);
  background: var(--success-soft);
  color: var(--success);
}
.live-state.online span,
.live-pill.online .dot {
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}
.status-metric strong[data-socket-state] {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 20px;
  letter-spacing: -0.025em;
}
.status-metric strong[data-socket-state] span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted-2);
}
.status-metric strong[data-socket-state].online {
  color: var(--success);
}
.status-metric strong[data-socket-state].online span {
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(5, 150, 105, 0);
  }
}

/* Cards, metrics, sections */
.card,
.workspace-section,
.summary-tile,
.kpi-card {
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}
.workspace-section {
  overflow: hidden;
  padding: 22px;
  margin: 0;
}
.card-pad {
  padding: 22px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.card-title h2,
.section-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 850;
}
.card-title p,
.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.card-body {
  padding: 22px;
}
.card-body.flush {
  padding: 0;
}
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-heading.compact {
  margin-bottom: 14px;
}

.metric-strip,
.kpi-grid,
.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.metric-item,
.kpi-card,
.summary-tile {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 128px;
  overflow: hidden;
  padding: 20px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}
.metric-item::after,
.kpi-card::after,
.summary-tile::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #38bdf8, transparent);
  opacity: 0.8;
}
.metric-item:hover,
.kpi-card:hover,
.summary-tile:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.metric-item span,
.kpi-label,
.summary-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.metric-item strong,
.kpi-value,
.summary-tile strong {
  color: var(--ink);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.metric-item small,
.kpi-meta {
  color: var(--muted);
  font-size: 12px;
}
.summary-tile.featured {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(135deg, #eff6ff, #fff);
}

.lower-grid,
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.dash-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}
.dash-grid.reverse {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
}
.stack {
  display: grid;
  gap: 18px;
}

/* Toolbars */
.search-field {
  position: relative;
  flex: 1;
  min-width: 230px;
  max-width: 380px;
}
.search-field .field-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}
.search-field input {
  padding-left: 16px;
}
.filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  padding: 4px;
}
.filter-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
  padding: 0 12px;
  transition:
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}
.filter-tabs button:hover {
  color: var(--ink);
  background: #fff;
}
.filter-tabs button.active {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: var(--shadow-xs);
}
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  padding: 0 9px;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.workspace-section > .table-wrap:only-child {
  margin: -1px;
  width: calc(100% + 2px);
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: middle;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 46px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table tbody td {
  border-bottom: 1px solid var(--border);
  color: var(--ink-2);
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table tbody tr {
  transition: background 140ms ease;
}
.data-table tbody tr:hover td {
  background: #fbfdff;
}
.data-table strong {
  color: var(--ink);
  font-weight: 800;
}
.data-table code,
.token-preview,
.token-cell {
  color: #334155;
  font-size: 12px;
}
.users-table,
.connections-table,
.stats-table {
  min-width: 780px;
}
.stats-table th,
.stats-table td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.stats-table th:first-child,
.stats-table td:first-child {
  text-align: left;
}
.stats-totals td,
.totals-row td {
  border-top: 2px solid var(--border-strong);
  background: var(--surface-2);
  font-weight: 850;
  color: var(--ink) !important;
}
.compact-table .data-table th,
.compact-table .data-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}
.table-input {
  min-height: 36px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.row-actions .secondary-button,
.row-actions .danger-button,
.row-actions .save-user,
.row-actions .rotate-token,
.row-actions .delete-user,
.row-actions .copy-user-token {
  min-height: 32px;
  border-radius: var(--r-sm);
  padding: 0 10px;
  font-size: 12px;
}

/* Badges */
.badge,
.activity-tone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 24px;
  border-radius: var(--r-pill);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.8;
}
.badge-active,
.badge-success,
.badge-live {
  background: var(--success-soft);
  color: var(--success);
}
.badge-inactive,
.badge-muted {
  background: var(--surface-3);
  color: var(--muted);
}
.badge-expired,
.badge-error,
.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge-info,
.badge-accent {
  background: var(--info-soft);
  color: var(--info);
}
.badge-live::before {
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
.remaining-ok {
  color: var(--success);
  font-weight: 800;
}
.remaining-warning {
  color: var(--warning);
  font-weight: 800;
}
.remaining-expired,
.remaining-time.expired {
  color: var(--danger);
  font-weight: 800;
}
.remaining-time {
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Forms and token reveal */
.create-user-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.7fr) auto;
  align-items: end;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #f8fafc, #fff);
  padding: 16px;
  margin-bottom: 18px;
}
.create-user-bar label {
  display: grid;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
}
.token-reveal {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 2fr) auto;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.token-reveal > div,
.token-reveal-info {
  display: grid;
  gap: 3px;
}
.token-reveal strong {
  color: var(--accent-darker);
  font-size: 13px;
  font-weight: 850;
}
.token-reveal span {
  color: var(--muted);
  font-size: 12px;
}
.token-reveal code,
.token-reveal-code {
  overflow: auto hidden;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--accent-darker);
  padding: 11px 13px;
  font-size: 12.5px;
  white-space: nowrap;
}
.copy-reveal-token {
  justify-self: end;
}

/* Switches */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  cursor: pointer;
}
.switch input,
.switch .user-active {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}
.switch-track,
.switch-slider {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 40px;
  border-radius: var(--r-pill);
  background: #cbd5e1;
  transition:
    background 180ms ease,
    box-shadow 180ms ease;
}
.switch-track::after,
.switch-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 180ms ease;
}
.switch input:checked + .switch-track,
.switch input:checked + .switch-slider {
  background: var(--success);
}
.switch input:checked + .switch-track::after,
.switch input:checked + .switch-slider::after {
  transform: translateX(18px);
}
.switch input:focus-visible + .switch-track,
.switch input:focus-visible + .switch-slider {
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.18);
}
.switch-label-text,
.switch-label {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
}

/* Empty states */
.empty-state {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 44px 22px !important;
  text-align: center;
  color: var(--muted);
}
.empty-state .empty-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.empty-state strong {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 850;
}
.empty-state p,
.empty-state span {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* Connected users */
.connected-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.connected-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 16px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}
.connected-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.connected-card > div,
.connected-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.connected-card strong,
.connected-info strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.connected-card small,
.connected-info small {
  color: var(--muted);
  font-size: 11.5px;
}
.connected-card .badge {
  margin-left: auto;
}

/* Activity and webhook streams */
.webhook-list,
.activity-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.workspace-section > .webhook-list {
  border-radius: var(--r-lg);
}
.activity-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.activity-row:last-child {
  border-bottom: 0;
}
.activity-tone {
  min-width: 86px;
  text-transform: uppercase;
}
.activity-tone-success {
  background: var(--success-soft);
  color: var(--success);
}
.activity-tone-warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.activity-tone-accent,
.activity-tone-info {
  background: var(--info-soft);
  color: var(--info);
}
.activity-tone-error {
  background: var(--danger-soft);
  color: var(--danger);
}
.activity-symbol {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.target-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: var(--r-pill);
  background: var(--warning-soft);
  color: #92400e;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.activity-time {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.webhook-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 140ms ease;
}
.webhook-row:last-child {
  border-bottom: 0;
}
.webhook-row:hover {
  background: #fbfdff;
}
.webhook-row-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}
.webhook-row-header strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.webhook-row summary,
.payload-details summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border-radius: var(--r-sm);
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  padding: 0 8px;
  transition: background 180ms ease;
}
.webhook-row summary:hover,
.payload-details summary:hover {
  background: var(--accent-soft);
}
.webhook-row summary::-webkit-details-marker,
.payload-details summary::-webkit-details-marker {
  display: none;
}
.webhook-row pre,
.payload-details pre {
  max-height: 260px;
  overflow: auto;
  margin: 10px 0 0;
  border: 1px solid #1e293b;
  border-radius: var(--r-md);
  background: #08111f;
  color: #dbeafe;
  padding: 14px;
  font-size: 11.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(5px);
  padding: 20px;
  animation: fade-in 160ms ease;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal {
  position: relative;
  width: min(470px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: pop-in 210ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 22px;
  transition:
    background 180ms ease,
    color 180ms ease;
}
.modal-close:hover {
  background: var(--surface-3);
  color: var(--ink);
}
.modal > h2,
.modal-header {
  padding: 24px 26px 0;
}
.modal > h2,
.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 850;
}
.modal > form,
.modal-body {
  display: grid;
  gap: 16px;
  padding: 20px 26px 26px;
}
.modal > form label,
.modal-body .field-label {
  display: grid;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
}
.modal > form .primary-button {
  justify-self: end;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 26px 26px;
}
.modal-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.token-actions {
  display: flex;
  gap: 8px;
}

/* Toast */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(390px, calc(100vw - 48px));
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: #0f172a;
  box-shadow: var(--shadow-lg);
  color: #fff;
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 700;
  animation: toast-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: #93c5fd;
}
.toast-error {
  background: #7f1d1d;
}
.toast-error::before {
  background: #fca5a5;
}
.toast-info::before {
  background: #93c5fd;
}
.toast-success::before {
  background: #86efac;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-3) 25%,
    #fff 37%,
    var(--surface-3) 63%
  );
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* Responsive */
@media (max-width: 1180px) {
  .metric-strip,
  .kpi-grid,
  .stats-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lower-grid,
  .dash-grid,
  .dash-grid.reverse {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 78px;
  }
  .sidebar {
    padding: 18px 10px;
  }
  .sidebar-brand {
    justify-content: center;
    padding-inline: 0;
  }
  .sidebar-brand-text,
  .sidebar-nav a span,
  .sidebar-user-text,
  .sidebar-session small,
  .sidebar-session strong {
    display: none;
  }
  .sidebar-nav a {
    justify-content: center;
    padding: 0;
  }
  .sidebar-session {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 10px;
  }
  .sidebar-session .secondary-button {
    width: 42px;
    min-height: 42px;
    padding: 0;
  }
  .sidebar-session .secondary-button {
    font-size: 0;
  }
  .sidebar-session .secondary-button .icon {
    width: 18px;
    height: 18px;
  }
  .dashboard-main {
    padding: 24px 20px 48px;
  }
  .dashboard-header,
  .page-header {
    margin: -24px -20px 24px;
    padding: 24px 20px 18px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }
  .app-layout {
    display: block;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 12px;
  }
  .sidebar-brand {
    flex: 0 0 auto;
  }
  .sidebar-nav {
    display: flex;
    gap: 6px;
    min-width: max-content;
  }
  .sidebar-nav a {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
  .sidebar-session {
    margin: 0 0 0 auto;
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    padding: 0;
  }
  .sidebar-session .avatar {
    display: none;
  }
  .sidebar-session .secondary-button {
    width: 44px;
    height: 44px;
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.07);
  }
  .dashboard-main {
    padding: 20px 14px 40px;
  }
  .dashboard-header,
  .page-header {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    margin: 0 0 20px;
    padding: 0 0 18px;
    background: transparent;
    backdrop-filter: none;
  }
  .header-actions,
  .toolbar,
  .page-actions,
  .section-heading {
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
  }
  .header-actions > *,
  .toolbar > *,
  .page-actions > * {
    width: 100%;
  }
  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 44px;
  }
  .metric-strip,
  .kpi-grid,
  .stats-summary,
  .lower-grid {
    grid-template-columns: 1fr;
  }
  .workspace-section {
    padding: 16px;
    border-radius: 18px;
  }
  .create-user-bar,
  .token-reveal {
    grid-template-columns: 1fr;
  }
  .copy-reveal-token {
    justify-self: stretch;
  }
  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .filter-tabs button {
    flex: 1 0 auto;
    min-height: 36px;
  }
  .search-field {
    min-width: 100%;
    max-width: none;
  }
  .auth-page {
    padding: 16px;
  }
  .auth-brand,
  .auth-heading,
  .login-form,
  .auth-footer {
    padding-left: 22px;
    padding-right: 22px;
  }
  .auth-heading h1 {
    font-size: 27px;
  }
  .toast {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }
}

@media (max-width: 420px) {
  .metric-item,
  .kpi-card,
  .summary-tile {
    min-height: 112px;
    padding: 17px;
  }
  .data-table th,
  .data-table td {
    padding: 12px;
  }
  .modal-overlay {
    padding: 12px;
  }
  .modal > h2,
  .modal-header {
    padding-left: 20px;
    padding-right: 54px;
  }
  .modal > form,
  .modal-body,
  .modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Inline date editor — click-to-edit expiration with quick-preset buttons
   ========================================================================== */

.date-editable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 5px 9px;
  margin: -5px -9px;
  border-radius: var(--r-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
  position: relative;
}
.date-editable:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.14);
}
.date-editable::after {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  opacity: 0;
  background: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  transition: opacity 160ms ease;
  color: var(--accent);
}
.date-editable:hover::after {
  opacity: 0.7;
}
.date-editable.editing {
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22);
}

/* Popover shell — fixed positioning avoids parent overflow clipping */
.date-popover {
  position: fixed;
  z-index: 45;
  min-width: 260px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow:
    0 20px 50px rgba(15, 23, 42, 0.18),
    0 6px 16px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(15, 23, 42, 0.04);
  padding: 16px;
  animation: date-pop-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
  display: grid;
  gap: 14px;
}
@keyframes date-pop-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Date input inside popover */
.date-popover input[type="date"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}
.date-popover input[type="date"]:focus {
  border-color: var(--accent);
  box-shadow: var(--focus), var(--shadow-xs);
}
.date-popover input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 140ms ease;
}
.date-popover input[type="date"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* Preset row */
.date-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.date-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}
.date-preset:hover {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.28);
  color: var(--accent-dark);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}
.date-preset:active {
  transform: translateY(0);
  background: var(--accent-tint);
}
.date-preset.preset-primary {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--accent-darker);
  font-weight: 800;
}
.date-preset.preset-primary:hover {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.16);
}

/* Date cell wrapper — relative for popover positioning */
.date-cell {
  position: relative;
}

/* Saved flash */
@keyframes date-saved-flash {
  0% { background: rgba(5, 150, 105, 0.18); }
  100% { background: transparent; }
}
.date-editable.saved {
  animation: date-saved-flash 700ms ease;
}
