/* DailyPrices design tokens and components.
   Editorial near-black + red-accent palette, B2B SaaS aesthetic. */

:root {
    /* Stone neutrals */
    --stone-50: #fafaf9;
    --stone-100: #f5f5f4;
    --stone-200: #e7e5e4;
    --stone-300: #d6d3d1;
    --stone-400: #a8a29e;
    --stone-500: #78716c;
    --stone-600: #57534e;
    --stone-700: #44403c;
    --stone-900: #1c1917;
    --stone-950: #0c0a09;

    /* Red accent: used sparingly. Reserved for primary CTAs, the wordmark,
       active nav, and urgent statuses (overdue / expired / errors). */
    --red-50: #fef2f2;
    --red-600: #dc2626;
    --red-700: #b91c1c;

    /* Warning amber: kept for warning contexts only, never for CTAs. */
    --amber-100: #fef3c7;
    --amber-600: #d97706;
    --amber-700: #b45309;

    --accent: var(--red-600);
    --accent-hover: var(--red-700);
    --accent-subtle: var(--red-50);

    --success: #16a34a;
    --error: var(--red-600);
    --warning: var(--amber-600);
    --info: #1e40af;

    --primary: var(--stone-950);
    --primary-hover: var(--stone-900);
    --primary-subtle: var(--stone-50);

    --bg: #ffffff;
    --bg-alt: var(--stone-50);
    --surface: #ffffff;
    --border: var(--stone-200);
    --border-strong: var(--stone-300);
    --text: var(--stone-950);
    --text-secondary: var(--stone-600);
    --text-muted: var(--stone-400);

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;

    --radius: 8px;
    --radius-sm: 6px;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-h1: 30px;
    --font-h2: 24px;
    --font-h3: 18px;
    --font-body: 14px;
    --font-small: 12px;

    --sidebar-width: 240px;
    --topbar-height: 56px;

    --shadow-dropdown: 0 1px 2px rgba(0, 0, 0, 0.04);
    --transition: 150ms ease;
}

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

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

body {
    font-family: var(--font-family);
    font-size: var(--font-body);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

/* Tabular numbers: applied globally so columns of digits align at the
 * decimal point. Covers explicit utility class, currency/number display
 * helpers, and every <input type="number">. Specific high-traffic
 * components (tables, stat values, price inputs) reinforce this below. */
.tabular,
.tnum, .price, .stat-value, td.num, .num,
.price-display, .number-display, .currency-display,
input[type="number"] {
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
}

input[type="number"] {
    text-align: right;
}

/* Numeric table cells: right-align so digits stack at the same x and
 * decimals line up. Author opts in by adding class="num" to the th/td. */
th.num, td.num,
th.currency-display, td.currency-display,
th.number-display, td.number-display {
    text-align: right;
    white-space: nowrap;
}

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

img, svg { max-width: 100%; }

h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 600; line-height: 1.25; }
h1 { font-size: var(--font-h1); }
h2 { font-size: var(--font-h2); }
h3 { font-size: var(--font-h3); }

input[type="hidden"] { display: none !important; }

/* -- Buttons ------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 36px;
    padding: 0 var(--space-4);
    font-family: inherit;
    font-size: var(--font-body);
    font-weight: 500;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

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

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

.btn-secondary, .btn-outline {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-secondary:hover, .btn-outline:hover {
    background: var(--stone-50);
    border-color: var(--stone-400);
    color: var(--text);
}

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

.btn-danger {
    background: var(--error);
    color: #ffffff;
    border-color: var(--error);
}
.btn-danger:hover { background: #991b1b; border-color: #991b1b; color: #ffffff; }

.btn-success {
    background: var(--success);
    color: #ffffff;
    border-color: var(--success);
}
.btn-success:hover { background: #166534; border-color: #166534; color: #ffffff; }

.btn-warning {
    background: var(--warning);
    color: #ffffff;
    border-color: var(--warning);
}
.btn-warning:hover { background: #854d0e; border-color: #854d0e; color: #ffffff; }

.btn-error { background: var(--error); color: #ffffff; border-color: var(--error); }
.btn-error:hover { background: #991b1b; border-color: #991b1b; color: #ffffff; }

.btn-sm { height: 30px; padding: 0 var(--space-3); font-size: var(--font-small); }
.btn-lg { height: 44px; padding: 0 var(--space-6); font-size: 16px; }
.btn-block { display: flex; width: 100%; }

.btn .icon { width: 16px; height: 16px; stroke-width: 2; }

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

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

.form-control,
.form-input,
.form-select,
.form-textarea,
input[type="text"].form-control,
input[type="email"].form-control,
input[type="password"].form-control,
input[type="number"].form-control,
input[type="search"].form-control {
    width: 100%;
    height: 36px;
    padding: var(--space-2) var(--space-3);
    font-family: inherit;
    font-size: var(--font-body);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-textarea {
    height: auto;
    min-height: 96px;
    padding: var(--space-3);
    resize: vertical;
}

.form-select {
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%2357534e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-color: var(--primary);
}

.form-control::placeholder,
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-error {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--font-small);
    color: var(--error);
}

.form-help {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--font-small);
    color: var(--text-secondary);
}

/* -- Cards / surfaces ---------------------------------------- */
.card,
.surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Opt-in modifier for cards that host hover tooltips (or other
 * descendants that need to paint outside the card's bounding box).
 * The default .card clips for clean rounded corners on full-bleed
 * tables; this variant lets popovers escape. */
.card-overflow-visible,
.card-overflow-visible .card-body {
    overflow: visible;
}

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

.card-title { font-size: var(--font-h3); font-weight: 600; color: var(--text); }
.card-subtitle { font-size: var(--font-small); color: var(--text-secondary); margin-top: var(--space-1); }

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

.card-footer {
    padding: var(--space-3) var(--space-6);
    border-top: 1px solid var(--border);
    background: var(--stone-50);
}

/* -- Stat cards ---------------------------------------------- */
.stats-grid,
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    align-items: stretch;
}

@media (max-width: 960px) {
    .stats-grid, .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .stats-grid, .dashboard-grid { grid-template-columns: 1fr; }
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    min-height: 120px;
}

.stat-label,
.stat-card-title {
    font-size: var(--font-small);
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-3);
}

.stat-value,
.stat-card-value {
    font-size: var(--font-h1);
    font-weight: 600;
    color: var(--text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-card-change { margin-top: var(--space-2); font-size: var(--font-small); color: var(--text-secondary); }

/* -- Tables -------------------------------------------------- */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-body);
    font-variant-numeric: tabular-nums;
}

.table th {
    background: var(--stone-50);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--font-small);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--stone-50); }

.table-empty,
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* -- Badges -------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px 8px;
    font-size: var(--font-small);
    font-weight: 500;
    border-radius: var(--radius-sm);
    background: var(--stone-100);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.badge-success { background: #dcfce7; color: var(--success); border-color: #bbf7d0; }
.badge-danger,
.badge-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.badge-warning { background: #fef3c7; color: #854d0e; border-color: #fde68a; }
.badge-info { background: #dbeafe; color: var(--info); border-color: #bfdbfe; }

/* -- Flash / alerts ----------------------------------------- */
.flash-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.flash,
.alert {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-body);
    background: var(--surface);
    color: var(--text);
}

.flash-success, .alert-success { background: #dcfce7; color: var(--success); border-color: #bbf7d0; }
.flash-danger, .flash-error, .alert-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.flash-warning, .alert-warning { background: #fef3c7; color: #854d0e; border-color: #fde68a; }
.flash-info { background: #dbeafe; color: var(--info); border-color: #bfdbfe; }

/* -- App layout (authenticated) ------------------------------ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    height: var(--topbar-height);
    padding: 0 var(--space-6);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-family);
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.sidebar-brand:hover { color: var(--text); }


.sidebar-nav {
    flex: 1;
    padding: var(--space-3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--font-body);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.nav-link:hover { background: var(--stone-100); color: var(--text); }
.nav-link.active { background: var(--accent-subtle); color: var(--accent); }
.nav-link.active [data-lucide],
.nav-link.active .nav-icon { color: var(--accent); }

.nav-link .icon,
.nav-link [data-lucide] { width: 16px; height: 16px; flex-shrink: 0; }

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: currentColor;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Flex children default to min-width: auto, which lets intrinsic
     * content force horizontal overflow. Set to 0 so wide grids
     * (e.g. 5-column daily prices) shrink instead of clipping. */
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    position: sticky;
    top: 0;
    z-index: 40;
}

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

.page-title { font-size: var(--font-h3); font-weight: 600; color: var(--text); margin: 0; line-height: 1.2; }
.page-subtitle { font-size: var(--font-small); color: var(--text-secondary); margin-top: 2px; }

.welcome-text { font-size: var(--font-small); color: var(--text-secondary); }

.sidebar-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.5);
    z-index: 45;
}
.sidebar-overlay.show { display: block; }

.content-area { padding: var(--space-6); flex: 1; }

.mt-24 { margin-top: var(--space-6); }

.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* -- Auth pages ---------------------------------------------- */
.auth-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.auth-card-brand {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.auth-card-brand:hover { color: var(--text); }


.auth-card h1 {
    font-size: var(--font-h2);
    font-weight: 600;
    color: var(--text);
}

.auth-card .auth-subtitle {
    margin-top: var(--space-1);
    color: var(--text-secondary);
    font-size: var(--font-body);
}

.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }

.auth-footer-text {
    margin-top: var(--space-2);
    font-size: var(--font-body);
    color: var(--text-secondary);
    text-align: center;
}

/* -- Landing page ------------------------------------------- */
.landing { background: var(--bg); color: var(--text); }

.landing .container { max-width: 1140px; margin: 0 auto; padding: 0 var(--space-6); }

.landing-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-3) 0;
}

.landing-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-brand {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
    display: inline-block;
    line-height: 1;
    padding-left: 1px;
    white-space: nowrap;
}

.landing-brand:hover { color: var(--text); }

.landing-nav-links { display: flex; align-items: center; gap: var(--space-6); }
.landing-nav-links a { font-size: var(--font-body); font-weight: 500; color: var(--text-secondary); }
.landing-nav-links a:hover { color: var(--text); }

.landing-hero {
    background: var(--primary);
    color: var(--stone-50);
    padding: 96px 0 80px;
    text-align: center;
}

.landing-hero h1 {
    font-size: 44px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--stone-50);
    max-width: 760px;
    margin: 0 auto var(--space-4);
    letter-spacing: -0.02em;
}

.landing-hero h1 span { color: var(--primary-subtle); }

.landing-hero p {
    font-size: 18px;
    color: rgba(250, 250, 249, 0.78);
    max-width: 560px;
    margin: 0 auto var(--space-8);
}

.landing-hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.landing-hero .btn-secondary {
    background: transparent;
    color: var(--stone-50);
    border-color: rgba(250, 250, 249, 0.3);
}
.landing-hero .btn-secondary:hover {
    background: rgba(250, 250, 249, 0.08);
    border-color: rgba(250, 250, 249, 0.5);
    color: var(--stone-50);
}

.landing-section { padding: 80px 0; }
.landing-section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.landing-section.muted { background: var(--stone-100); }

.landing-section .section-label {
    font-size: var(--font-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}

.landing-section .section-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
}

.landing-section .section-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
}

.landing-section.center { text-align: center; }
.landing-section.center .section-desc { margin-left: auto; margin-right: auto; }

.landing-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    margin-top: var(--space-8);
    text-align: left;
}

.landing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-6);
}

.landing-card h3 { font-size: var(--font-h3); margin-bottom: var(--space-2); }
.landing-card p { font-size: var(--font-body); color: var(--text-secondary); }

.landing-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.landing-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    max-width: 1000px;
    margin: var(--space-8) auto 0;
    text-align: left;
}

.price-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-8);
}

.price-card.featured { border: 2px solid var(--accent); padding: calc(var(--space-8) - 1px); }

.price-card h3 { font-size: var(--font-h3); margin-bottom: var(--space-1); }
.price-card .price { font-size: 36px; font-weight: 700; color: var(--text); margin: var(--space-3) 0; font-variant-numeric: tabular-nums; }
.price-card .price span { font-size: 14px; font-weight: 400; color: var(--text-secondary); }

.price-card ul { list-style: none; margin: var(--space-4) 0; }
.price-card ul li {
    padding: var(--space-2) 0;
    font-size: var(--font-body);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.price-card ul li:last-child { border-bottom: none; }
.price-card .btn-primary, .price-card .btn { width: 100%; margin-top: var(--space-3); }

.landing-cta {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 80px 0;
    text-align: center;
}
.landing-cta h2 { font-size: 28px; margin-bottom: var(--space-3); }
.landing-cta p { color: var(--text-secondary); margin-bottom: var(--space-6); }

.landing-footer {
    background: var(--stone-100);
    border-top: 1px solid var(--border);
    padding: var(--space-8) 0;
    font-size: var(--font-small);
    color: var(--text-secondary);
}
.landing-footer .container { display: flex; justify-content: center; }
.landing-footer-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-3);
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}
.landing-footer a { color: var(--text-secondary); text-decoration: none; }
.landing-footer a:hover { color: var(--text); text-decoration: underline; }
.landing-footer .footer-sep { color: var(--text-muted); }

/* -- Misc utilities ----------------------------------------- */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.w-full { width: 100%; }

/* -- Responsive --------------------------------------------- */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); transition: transform var(--transition); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: inline-flex; }
}

@media (max-width: 768px) {
    .content-area { padding: var(--space-4); }
    .topbar { padding: 0 var(--space-4); }
    .landing-hero { padding: 56px 0; }
    .landing-hero h1 { font-size: 32px; }
    .landing-grid-3, .landing-pricing-grid { grid-template-columns: 1fr; }
    .landing-section { padding: 56px 0; }
    .landing-footer-line .footer-sep { display: none; }
}

/* ===== Admin panel ===== */
body.admin .sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    height: auto;
    padding: var(--space-4) var(--space-6);
    line-height: 1.2;
}

body.admin .admin-brand-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

body.admin .sidebar-platform-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.admin .sidebar-nav {
    padding: var(--space-3);
    gap: 2px;
}

body.admin .nav-link {
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-body);
}

body.admin .nav-link [data-lucide],
body.admin .nav-link .nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

body.admin .nav-link:hover { background: var(--bg); color: var(--text); }
body.admin .nav-link.active { background: var(--accent-subtle); color: var(--accent); }
body.admin .nav-link.active [data-lucide],
body.admin .nav-link.active .nav-icon { color: var(--accent); }

.sidebar-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.admin .topbar {
    height: auto;
    padding: var(--space-6) var(--space-8);
    align-items: center;
}

body.admin .page-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
}

body.admin .page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

body.admin .topbar-right { gap: var(--space-3); }

.admin-user-email {
    font-size: 14px;
    color: var(--text-secondary);
}

.admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
}

body.admin .content-area {
    padding: var(--space-8);
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    align-items: stretch;
}

.admin-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    height: 100%;
    min-height: 140px;
}

.admin-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--primary-subtle);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-stat-icon [data-lucide] { width: 18px; height: 18px; }

.admin-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-stat-value {
    font-size: 30px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.admin-stat-change {
    font-size: 12px;
    color: var(--text-secondary);
    min-height: 16px;
}

.form-section { margin-top: var(--space-6); }
.form-section:first-child { margin-top: 0; }

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-2);
    margin-bottom: var(--space-4);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.admin-toolbar-left { flex: 1; min-width: 220px; max-width: 400px; }
.admin-toolbar-right { display: flex; gap: var(--space-2); align-items: center; }

.input-with-icon {
    position: relative;
    display: block;
    width: 100%;
}

.input-with-icon [data-lucide] {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon .form-control { padding-left: 32px; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-body);
}

.admin-table th {
    background: var(--bg);
    padding: var(--space-3);
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: var(--space-4);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--bg); }
.admin-table .actions-cell { text-align: right; white-space: nowrap; }

.cell-name-primary { font-weight: 500; color: var(--text); }
.cell-name-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-variant-numeric: tabular-nums; }

.badge-plan {
    display: inline-block;
    padding: 4px 8px;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn [data-lucide] { width: 16px; height: 16px; }

.row-menu { display: inline-block; text-align: left; }

.row-menu-content {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    min-width: 180px;
    max-width: calc(100vw - 16px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-dropdown);
    z-index: 1000;
    padding: 4px;
}

.row-menu.open .row-menu-content { display: block; }

.row-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-body);
    font-family: inherit;
    color: var(--text);
    text-decoration: none;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
}

.row-menu-item:hover { background: var(--bg); color: var(--text); }
.row-menu-item [data-lucide] { width: 14px; height: 14px; }
.row-menu-item.destructive { color: var(--error); }
.row-menu-item.destructive:hover { background: #fee2e2; color: var(--error); }
.row-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

.empty-state {
    padding: var(--space-12) var(--space-6);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 360px;
    margin: 0;
}

.empty-state .btn { margin-top: var(--space-2); }

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--primary-subtle);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon [data-lucide] { width: 16px; height: 16px; }

.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: var(--font-body); font-weight: 500; color: var(--text); }
.activity-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 768px) {
    .admin-stats-grid { grid-template-columns: 1fr; }
    body.admin .topbar { padding: var(--space-4); }
    body.admin .content-area { padding: var(--space-4); }
    .admin-user-email { display: none; }
}

/* Two-column admin form layout */
.admin-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 720px) minmax(0, 1fr);
    gap: var(--space-12);
    max-width: 1280px;
    width: 100%;
    align-items: start;
}

.admin-form-layout .admin-form-card {
    max-width: 720px;
    margin: 0;
    width: 100%;
}

.admin-form-card .card-body { padding: var(--space-8); }

.admin-form-guide {
    position: sticky;
    top: var(--space-6);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.admin-form-guide-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.admin-form-guide-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.admin-form-guide-icon [data-lucide] { width: 20px; height: 20px; }

.admin-form-guide-heading {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.admin-form-guide-text {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.admin-form-guide-text code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 4px;
}

.admin-form-guide-stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
    font-size: 13px;
}

.admin-form-guide-stat-label { color: var(--text-secondary); }
.admin-form-guide-stat-value {
    color: var(--text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1024px) {
    .admin-form-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-6);
    }
    .admin-form-guide {
        position: static;
        padding: 0;
    }
}

/* Single-tier pricing card */
.landing-hero-note {
    margin-top: var(--space-3);
    font-size: 13px;
    color: rgba(250, 250, 249, 0.7);
}

.single-price-wrapper {
    display: flex;
    justify-content: center;
    margin-top: var(--space-6);
}

.single-price-card {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-12);
    text-align: left;
}

.single-price-amount {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    color: var(--text);
}

.single-price-figure {
    font-size: 48px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.single-price-period {
    font-size: 16px;
    color: var(--text-secondary);
}

.single-price-billing {
    margin-top: var(--space-2);
    font-size: 14px;
    color: var(--text-secondary);
}

.single-price-divider {
    margin: var(--space-6) 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.single-price-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.single-price-features li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 14px;
    color: var(--text);
    border: none;
    padding: 0;
}

.single-price-features [data-lucide] {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.single-price-cta {
    display: flex;
    width: 100%;
    margin-top: var(--space-6);
    padding: 14px var(--space-4);
    height: auto;
}

.single-price-fineprint {
    margin-top: var(--space-3);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.landing-footer-credit {
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .single-price-card { padding: var(--space-8); }
    .single-price-figure { font-size: 40px; }
}

/* Density treatment for admin forms (Section 3) */
.admin-form-layout-dense {
    grid-template-columns: minmax(0, 720px) 320px;
    gap: var(--space-8);
}

.admin-form-layout-dense .form-control,
.admin-form-layout-dense .form-input,
.admin-form-layout-dense .form-select {
    height: 32px;
    padding: 6px 10px;
}

.admin-form-layout-dense .form-textarea-compact {
    min-height: 64px;
    height: auto;
    padding: 8px 10px;
    line-height: 1.4;
}

.admin-form-layout-dense .form-label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text);
}

.admin-form-layout-dense .form-help {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-section-dense {
    margin-top: var(--space-6);
}

.form-section-dense:first-of-type { margin-top: 0; }

.form-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--space-2) 0;
}

.form-section-body {
    border-left: 2px solid var(--primary-subtle);
    padding-left: var(--space-4);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.form-grid-2 .form-group { margin-bottom: 0; }

.form-grid-2 .span-2 { grid-column: span 2; }

.admin-form-guide-dense {
    padding: var(--space-6);
    gap: 20px;
}

.admin-form-guide-dense .admin-form-guide-icon,
.admin-form-guide-dense .admin-form-guide-icon [data-lucide] {
    width: 18px;
    height: 18px;
}

.admin-form-guide-dense .admin-form-guide-heading {
    font-size: 13px;
}

.admin-form-guide-dense .admin-form-guide-text {
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .admin-form-layout-dense {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .form-grid-2 .span-2 { grid-column: span 1; }
}

/* Payment required page */
.payment-required-card {
    text-align: center;
    align-items: center;
    gap: var(--space-3);
}

.payment-required-icon {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.payment-required-icon [data-lucide] { width: 32px; height: 32px; }

.payment-required-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.payment-required-contact {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: var(--space-2);
}

.payment-required-logout { margin-top: var(--space-2); }

/* ===== Invoicing ===== */
.subscription-block { display: flex; flex-direction: column; gap: var(--space-3); }

.subscription-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.subscription-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.subscription-detail {
    font-size: 13px;
    color: var(--text-secondary);
}

.subscription-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.subscription-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* Status badges (subscription + invoice) */
.badge-status-trial,
.subscription-status.badge-status-trial { background: #fef3c7; color: var(--amber-700); }
.badge-status-active,
.subscription-status.badge-status-active { background: #dcfce7; color: var(--success); }
.badge-status-expired,
.subscription-status.badge-status-expired { background: #fee2e2; color: var(--error); }
.badge-status-cancelled,
.subscription-status.badge-status-cancelled { background: var(--stone-100); color: var(--text-secondary); }
.badge-status-draft { background: var(--stone-100); color: var(--text-secondary); }
.badge-status-sent { background: #dbeafe; color: var(--info); }
.badge-status-paid { background: #dcfce7; color: var(--success); }
.badge-status-overdue { background: #fee2e2; color: var(--error); }

/* Invoice detail meta list */
.invoice-detail-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.invoice-meta {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: var(--space-2) var(--space-4);
    margin: 0;
}
.invoice-meta dt {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 500;
}
.invoice-meta dd { margin: 0; font-size: 14px; color: var(--text); }

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
    align-items: center;
    justify-content: center;
}
.modal.open { display: flex; }
/* Modal: fixed full-screen overlay that centers a 12px-radius dialog.
 * Templates set inline display:flex on the overlay to open it; the
 * align/justify rules below position the card. */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.45);
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    z-index: 1000;
}
.modal-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-shadow: var(--shadow-dropdown);
    display: flex;
    flex-direction: column;
}
.modal-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 18px; font-weight: 600; margin: 0; color: var(--text); }
.modal-close {
    background: none;
    border: 0;
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal-title { font-size: 18px; font-weight: 600; color: var(--text); }
.modal-body { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.modal-help { font-size: 13px; color: var(--text-secondary); margin: 0; }
.modal-footer,
.modal-actions {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Label + input pair used inside .modal-body for compact forms (e.g.
 * the per-county tax rate editor). Label sits left at fixed width, input
 * stretches to fill, both 40px tall so they line up. */
.modal-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.modal-form-row + .modal-form-row { margin-top: 12px; }
.modal-form-row label {
    width: 140px;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
}
.modal-form-row input,
.modal-form-row select {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: right;
    font-variant-numeric: tabular-nums;
    background: var(--surface);
    color: var(--text);
}
.modal-form-row input.is-invalid {
    border-color: var(--error, #dc2626);
}

/* Roomier dialog used by data-entry forms with several rows (e.g. the
 * per-county Edit-all-rates modal). Wider card, bigger padding, taller
 * inputs, and a 24px gap above the footer buttons. */
.modal-card-lg {
    max-width: 560px;
}
.modal-card-lg .modal-header {
    padding: var(--space-6) var(--space-8);
}
.modal-card-lg .modal-header h3 {
    font-size: 20px;
}
.modal-card-lg .modal-body {
    padding: var(--space-8);
}
.modal-card-lg .modal-footer,
.modal-card-lg .modal-actions {
    padding: var(--space-6) var(--space-8);
}
.modal-card-lg .modal-form-row + .modal-form-row {
    margin-top: 16px;
}
.modal-card-lg .modal-form-row {
    gap: 16px;
}
.modal-card-lg .modal-form-row input,
.modal-card-lg .modal-form-row select {
    height: 44px;
    flex: 1;
}

.text-right { text-align: right; }
.text-left  { text-align: left; }

@media (max-width: 1024px) {
    .invoice-meta { grid-template-columns: 1fr; }
}

/* Two-tone wordmark */
.wordmark { font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
.wordmark-daily { color: var(--text-muted); }
.wordmark-prices { color: var(--accent); }
.wordmark-dark .wordmark-daily { color: var(--stone-400); }
.wordmark-dark .wordmark-prices { color: #ffffff; }

.modal-card-wide { max-width: 520px; }
.quick-company-filter { margin-top: var(--space-2); }

/* Email Settings preview block */
.email-preview {
    background: var(--stone-50);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin-top: var(--space-4);
}

.email-preview-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.email-preview-body {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.email-preview-key { color: var(--text-muted); margin-right: 4px; }

/* ===== Daily Prices ===== */
/* Opt-in full-width content area for power-user pages. */
body.fullwidth-page .content-area {
    padding: var(--space-8);
    max-width: 100%;
    /* Belt-and-suspenders: even if a descendant misbehaves, the page
     * never scrolls horizontally. */
    overflow-x: hidden;
}

.daily-prices-form { width: 100%; }

.daily-prices-card-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-4);
    width: 100%;
    align-items: stretch;
}

@media (max-width: 1024px) {
    .price-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
    .price-grid { grid-template-columns: 1fr; }
}

.price-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    height: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.price-cell-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--stone-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.price-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0 12px 0 28px;
    transition: border-color var(--transition);
    min-width: 0;
}

.price-input-wrapper:focus-within {
    border: 2px solid var(--primary);
    padding: 0 11px 0 27px;
}

/* Invalid state: red border + matching message below the wrapper. */
.price-input-wrapper.price-input-invalid {
    border: 1px solid var(--error, #dc2626);
}
.price-input-wrapper.price-input-invalid:focus-within {
    border: 2px solid var(--error, #dc2626);
    padding: 0 11px 0 27px;
}
.price-input-error-msg {
    display: block;
    min-height: 14px;
    font-size: 12px;
    color: var(--error, #dc2626);
    font-weight: 500;
}

.price-input-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--stone-500);
    pointer-events: none;
}

.price-input {
    flex: 1;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}
.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.price-delta {
    margin-left: var(--space-2);
    font-size: 12px;
    font-weight: 600;
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.price-delta-up { color: var(--success); }
.price-delta-down { color: var(--error); }
.price-delta-zero { color: var(--stone-400); }

.price-cell-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
    font-size: 12px;
    color: var(--stone-500);
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
}

.price-cell-yesterday { color: var(--stone-500); }

.daily-prices-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-4);
    flex-wrap: wrap;
}

.daily-prices-actions-left { display: flex; gap: var(--space-2); }

.daily-prices-actions-right {
    display: flex;
    align-items: baseline;
    gap: var(--space-4);
    font-size: 12px;
    color: var(--stone-500);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.daily-prices-actions-meta { font-weight: 500; color: var(--stone-700); }
.daily-prices-actions-tip { color: var(--stone-500); }

/* Send Today's Quotes card */
.send-quotes-card {
    margin-top: var(--space-6);
    padding: var(--space-6);
    width: 100%;
}

.send-quotes-header h2 { margin: 0; }

.send-quotes-subtitle {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: var(--stone-500);
}

.send-quotes-stats {
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--stone-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--stone-700);
}
.send-quotes-stats .num {
    font-weight: 600;
    color: var(--text);
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
    margin-right: 4px;
}

.send-quotes-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
    flex-wrap: wrap;
}

.send-quotes-form { display: inline-flex; }

.send-quotes-help {
    margin-top: var(--space-3);
    font-size: 12px;
    color: var(--stone-500);
}

.send-quotes-card.send-quotes-disabled .btn[aria-disabled="true"],
.send-quotes-card.send-quotes-disabled .btn-disabled,
.btn:disabled, .btn[aria-disabled="true"], .btn.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Sidebar group labels */
.sidebar-group-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--stone-500);
    padding: var(--space-2) var(--space-3);
}
.sidebar-nav .sidebar-group-label + .nav-link { margin-top: 0; }
.sidebar-nav .sidebar-group-label:not(:first-child) { margin-top: var(--space-4); }

@media (max-width: 768px) {
    body.fullwidth-page .content-area { padding: var(--space-4); }
}

/* ===== Demo request page ===== */
.demo-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-12) var(--space-8);
}

.demo-page-grid {
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 64px;
    align-items: start;
}

/* Left column: marketing */
.demo-marketing {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.demo-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: var(--space-3);
}

.demo-headline {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0;
}

.demo-subhead {
    margin-top: var(--space-3);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.demo-section-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 var(--space-4) 0;
}

.demo-step-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.demo-step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.demo-step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-subtle);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.demo-step-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.demo-step-body {
    margin: 2px 0 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.demo-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    border-top: 1px solid var(--border);
    padding-top: var(--space-6);
}

.demo-fact { text-align: center; }

.demo-fact-figure {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
}

.demo-fact-label {
    margin-top: var(--space-1);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Right column: form */
.demo-form-wrap { position: sticky; top: var(--space-8); }

.demo-form-card { padding: var(--space-8); }

.demo-form-header { margin-bottom: var(--space-6); }
.demo-form-title { font-size: 18px; font-weight: 600; margin: 0; color: var(--text); }
.demo-form-sub { margin: var(--space-1) 0 0 0; font-size: 12px; color: var(--text-muted); }

.demo-form { display: flex; flex-direction: column; gap: var(--space-4); }

.demo-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.demo-form-group { display: flex; flex-direction: column; }

.demo-label {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.demo-label .demo-req,
.demo-label .demo-opt {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.demo-form .form-control {
    height: 36px;
    padding: 0 var(--space-3);
    font-size: var(--font-body);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-sm);
    transition: outline-color var(--transition);
}

.demo-form .form-textarea-compact {
    height: auto;
    min-height: 64px;
    padding: var(--space-2) var(--space-3);
    line-height: 1.4;
}

.demo-form .form-control:focus,
.demo-form .form-textarea-compact:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--border);
}

.demo-help {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.demo-submit {
    margin-top: var(--space-2);
    padding: 12px var(--space-4);
    height: auto;
    font-size: var(--font-body);
}

.demo-fineprint {
    margin: var(--space-2) 0 0 0;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .demo-page { padding: var(--space-8) var(--space-4); }
    .demo-page-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    /* Form first, marketing below: it's the action. */
    .demo-form-wrap { order: -1; position: static; top: auto; }
    .demo-form-card { padding: var(--space-6); }
    .demo-headline { font-size: 28px; }
}

@media (max-width: 640px) {
    .demo-form-row { grid-template-columns: 1fr; }
    .demo-facts { grid-template-columns: 1fr; }
}

/* ===== Legal pages (Terms, Privacy) and the contact page shell ===== */
.legal-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 32px;
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 32px;
    align-items: start;
}

.legal-article {
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface);
    width: 100%;
}

.legal-header { display: block; }
.legal-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: var(--space-3);
}
.legal-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text);
}
.legal-subtitle {
    margin-top: var(--space-2);
    font-size: 14px;
    color: var(--text-muted);
}
.legal-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: var(--space-6) 0 var(--space-8);
}

.legal-body section { scroll-margin-top: 88px; }
.legal-body h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 12px 0;
    color: var(--text);
    letter-spacing: -0.01em;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 8px 0;
    color: var(--text);
}
.legal-body p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 16px;
}
.legal-body ul,
.legal-body ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}
.legal-body li { margin-bottom: 8px; }
.legal-body strong { color: var(--text); font-weight: 600; }
.legal-body a { color: var(--accent); text-decoration: underline; }
.legal-body a:hover { color: var(--accent-hover); }

/* Table of contents sidebar */
.legal-toc {
    position: sticky;
    top: 32px;
    align-self: start;
    width: 240px;
    font-size: 13px;
    line-height: 1.5;
}
.legal-toc-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}
.legal-toc ul { list-style: none; padding: 0; margin: 0; }
.legal-toc li { margin-bottom: 6px; }
.legal-toc a {
    display: block;
    padding: 4px 0 4px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}
.legal-toc a:hover { color: var(--text); }
.legal-toc a.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

@media (max-width: 1024px) {
    .legal-shell { grid-template-columns: 1fr; padding: 48px 24px; }
    .legal-toc { display: none; }
}

/* ===== Contact page ===== */
.contact-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 32px;
}

.contact-header { margin-bottom: var(--space-8); }
.contact-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: var(--space-3);
}
.contact-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text);
}
.contact-subtitle {
    margin-top: var(--space-2);
    font-size: 14px;
    color: var(--text-secondary);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.contact-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--accent);
}
.contact-card-icon [data-lucide] { width: 24px; height: 24px; }
.contact-card-title { font-size: 16px; font-weight: 600; margin: 0; color: var(--text); }
.contact-card-body { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.contact-card-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}
.contact-card-link {
    font-size: 14px;
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
    align-self: flex-start;
}
.contact-card-link:hover { text-decoration: underline; }

.contact-form-wrap { position: sticky; top: 32px; }
.contact-form-card { padding: var(--space-8); }
.contact-form-header { margin-bottom: var(--space-6); }
.contact-form-title { font-size: 18px; font-weight: 600; margin: 0; color: var(--text); }
.contact-form-sub { margin: var(--space-1) 0 0 0; font-size: 12px; color: var(--text-muted); }

.contact-form { display: flex; flex-direction: column; gap: var(--space-4); }
.contact-form-group { display: flex; flex-direction: column; }
.contact-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.contact-form .form-control,
.contact-form .form-select,
.contact-form .form-textarea {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.contact-form .form-control:focus,
.contact-form .form-select:focus,
.contact-form .form-textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--border);
}
.contact-form .form-textarea { min-height: 120px; }
.contact-submit {
    margin-top: var(--space-2);
    padding: 12px var(--space-4);
    height: auto;
    font-size: var(--font-body);
}

@media (max-width: 1024px) {
    .contact-page { padding: 48px 24px; }
    .contact-grid { grid-template-columns: 1fr; gap: var(--space-6); }
    .contact-form-wrap { position: static; top: auto; }
}

/* =============================================================
 * Mobile responsive overrides
 *
 * Public-facing pages (landing, demo, legal, contact, auth) need
 * consistent tap-target sizes, no iOS input zoom, and the hero/
 * pricing/footer/legal/contact shells need to stack and shrink at
 * sub-tablet widths. Desktop styles above are the source of truth;
 * these blocks only override at <= the named breakpoint.
 * ============================================================= */

/* Tablet portrait and below */
@media (max-width: 1024px) {
    .demo-page-grid { grid-template-columns: 1fr; gap: var(--space-6); }
    .demo-form-wrap { order: -1; position: static; top: auto; }
    .demo-form-card { padding: var(--space-6); }
}

@media (max-width: 768px) {
    /* Container padding tightens to 16px on each side. */
    .landing .container { padding: 0 var(--space-4); }

    /* Headings: drop to mobile sizes everywhere on the public site
     * and the auth card. Body app pages have their own page titles. */
    body.landing h1,
    body.landing .demo-headline,
    body.landing .legal-title,
    body.landing .contact-title,
    .auth-card h1 {
        font-size: 28px;
        line-height: 1.2;
    }
    body.landing h2,
    .auth-card h2 {
        font-size: 22px;
        line-height: 1.3;
    }
    body.landing h3,
    .auth-card h3 {
        font-size: 18px;
    }

    /* Inputs: 16px font defeats iOS Safari focus zoom; 44px min
     * height meets the Apple HIG tap target. */
    body.landing input[type="text"],
    body.landing input[type="email"],
    body.landing input[type="password"],
    body.landing input[type="number"],
    body.landing input[type="tel"],
    body.landing input[type="url"],
    body.landing input[type="search"],
    body.landing select,
    body.landing textarea,
    .auth-card input[type="text"],
    .auth-card input[type="email"],
    .auth-card input[type="password"],
    .auth-card input[type="number"],
    .auth-card input[type="tel"],
    .auth-card select,
    .auth-card textarea {
        min-height: 44px;
        font-size: 16px;
        padding: 12px;
    }
    body.landing textarea,
    .auth-card textarea {
        min-height: 96px;
    }

    /* Buttons: 44px tap target on landing/legal/contact/demo/auth.
     * Override the fixed .btn height so min-height takes effect. */
    body.landing .btn,
    body.landing button[type="submit"],
    .auth-card .btn,
    .auth-card button[type="submit"] {
        height: auto;
        min-height: 44px;
        padding: 12px 20px;
        font-size: 15px;
    }

    /* Long URLs/emails should not punch out the layout. */
    body.landing a,
    body.landing p,
    .auth-card a,
    .auth-card p {
        word-break: break-word;
    }

    /* ---- Landing nav ---- */
    .landing-nav { padding: var(--space-2) 0; }
    .landing-nav .container { padding: 0 var(--space-4); }
    /* Hide #features/#pricing in-page anchors at mobile and keep the
     * Sign in CTA so the header stays a brand + action. */
    .landing-nav-links a:not(.btn) { display: none; }
    .landing-nav-links { gap: var(--space-3); }

    /* ---- Landing hero ---- */
    .landing-hero { padding: 32px 0; text-align: center; }
    .landing-hero .container { padding: 0 var(--space-4); }
    .landing-hero h1 { font-size: 28px; line-height: 1.2; }
    .landing-hero p { font-size: 16px; line-height: 1.5; }
    .landing-hero-actions { flex-direction: column; align-items: stretch; gap: var(--space-3); }
    .landing-hero-actions .btn { width: 100%; min-height: 48px; }

    /* ---- Pricing card ---- */
    .single-price-wrapper { padding: 0 var(--space-4); }
    .single-price-card {
        width: 100%;
        padding: var(--space-6);
        border-radius: 12px;
    }
    .single-price-figure { font-size: 48px; }
    .single-price-cta { width: 100%; min-height: 48px; }

    /* ---- Landing footer: every line on its own row, centered. ---- */
    .landing-footer { padding: var(--space-6) 0; font-size: 12px; }
    .landing-footer-line {
        flex-direction: column;
        gap: var(--space-3);
    }
    .landing-footer-line .footer-sep { display: none; }
    .landing-footer-credit { text-align: center; }

    /* ---- Demo page ---- */
    .demo-page { padding: var(--space-6) var(--space-4); }
    .demo-form-card { padding: var(--space-6); }
    .demo-form .form-control,
    .demo-form .form-textarea-compact {
        height: auto;
        min-height: 48px;
        font-size: 16px;
        padding: 12px;
    }
    .demo-form .form-textarea-compact { min-height: 96px; }
    .demo-label { font-size: 14px; }
    .demo-headline { font-size: 28px; }
    .demo-form-row { grid-template-columns: 1fr; }
    .demo-facts { grid-template-columns: 1fr; gap: var(--space-3); }
    .demo-fact { display: flex; flex-direction: column; align-items: center; gap: 4px; }
    .demo-submit { width: 100%; min-height: 48px; }

    /* ---- Legal pages (terms, privacy) ---- */
    .legal-shell {
        grid-template-columns: 1fr;
        padding: var(--space-6) var(--space-4);
        gap: var(--space-6);
    }
    .legal-toc { display: none; }
    .legal-article { max-width: 100%; }
    .legal-article h1 { font-size: 28px; line-height: 1.2; }
    .legal-article h2 { font-size: 20px; }
    .legal-article p,
    .legal-article li {
        font-size: 14px;
        line-height: 1.6;
    }
    .legal-article section { padding: var(--space-3) 0; }
    .legal-meta,
    .legal-updated { font-size: 12px; }

    /* ---- Contact page ---- */
    .contact-page { padding: var(--space-6) var(--space-4); }
    .contact-grid { grid-template-columns: 1fr; gap: var(--space-6); }
    .contact-card { padding: var(--space-6); }
    .contact-form-wrap { position: static; top: auto; }
    .contact-form-card { padding: var(--space-6); }
    .contact-form .form-control,
    .contact-form .form-select,
    .contact-form .form-textarea {
        height: auto;
        min-height: 48px;
        font-size: 16px;
        padding: 12px;
    }
    .contact-form .form-textarea { min-height: 120px; }
    .contact-submit { width: 100%; min-height: 48px; }

    /* ---- Auth (login) card ---- */
    .auth-layout { padding: var(--space-4); align-items: flex-start; }
    .auth-card {
        width: 100%;
        max-width: 100%;
        padding: var(--space-6);
        margin-top: var(--space-6);
    }
    .auth-card .form-control {
        height: 48px;
        font-size: 16px;
        padding: 12px;
    }
    .auth-card .btn-block,
    .auth-card button[type="submit"] {
        width: 100%;
        min-height: 48px;
    }

    /* ---- Tables that may overflow ---- */
    .legal-article table,
    .landing table { display: block; overflow-x: auto; }
}

/* Phone-narrow */
@media (max-width: 420px) {
    .landing-hero { padding: 24px 0; }
    .single-price-card { padding: var(--space-4); }
    .demo-page { padding: var(--space-4) var(--space-3); }
    .legal-shell { padding: var(--space-4) var(--space-3); }
}

/* =============================================================
 * Pure-CSS hover tooltips (no JS deps).
 *
 * Used by the customer directory to surface the full email list and
 * the customer's enrolled products without leaving the table. The
 * trigger (.dp-tip-trigger) is a positioning context; .dp-tip lives
 * inside it and only paints on hover/focus.
 * ============================================================= */
.dp-tip-trigger {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

/* The "+N more" email badge inherits the trigger; this just colors it. */
.email-cc-badge {
    background: var(--stone-100);
    color: var(--stone-700);
    font-size: 11px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 9999px;
    margin-left: 6px;
    vertical-align: middle;
    transition: background 100ms;
}
.email-cc-badge:hover { background: var(--stone-200); }
.products-trigger {
    transition: color 100ms;
}
.dp-tip-trigger:hover .products-trigger,
.products-trigger:hover { color: var(--text); }

.dp-tip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
    min-width: 240px;
    max-width: 280px;
    width: max-content;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 150ms, visibility 150ms, transform 150ms;
    text-align: left;
    white-space: normal;
    cursor: default;
}
.dp-tip-trigger:hover .dp-tip,
.dp-tip-trigger:focus-within .dp-tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.dp-tip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}
.dp-tip-heading {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 8px;
}
.dp-tip-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.dp-pill {
    display: inline-block;
    background: var(--stone-100);
    color: var(--stone-700);
    font-size: 12px;
    line-height: 1.3;
    padding: 4px 10px;
    border-radius: 9999px;
    word-break: break-all;
}
.dp-pill-primary {
    background: #fee2e2;
    color: #b91c1c;
}
