/* =============================================================================
   Panel Modern Theme
   -----------------------------------------------------------------------------
   Hand-written design layer for the TG panel. Loaded AFTER the compiled Vite
   CSS. Tailwind v4 emits its utilities inside @layer, and unlayered author CSS
   outranks every cascade layer, so these rules win without !important.

   Deliberately avoids touching `display`, `visibility` and `opacity` on markup
   that Alpine/Flowbite toggle (dropdowns, modals, mobile menu), so behaviour is
   untouched — this file only changes how things look.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens -- */
:root {
    --p-font-ui: "Figtree", "Comfortaa", ui-sans-serif, system-ui, -apple-system,
        "Segoe UI", Roboto, sans-serif;
    --p-font-display: "Comfortaa", "Figtree", ui-sans-serif, system-ui, sans-serif;

    /* canvas + surfaces */
    --p-canvas: #eef1f7;
    --p-canvas-2: #f7f8fc;
    --p-surface: #ffffff;
    --p-surface-2: #f8fafc;
    --p-surface-3: #f1f5f9;
    --p-surface-hover: #f8fafc;

    /* ink */
    --p-text: #0f172a;
    --p-text-soft: #475569;
    --p-text-muted: #64748b;
    --p-text-faint: #94a3b8;

    /* lines */
    --p-border: #e3e8f0;
    --p-border-soft: #edf1f7;
    --p-border-strong: #d4dbe8;

    /* accent */
    --p-accent: #4f46e5;
    --p-accent-hover: #4338ca;
    --p-accent-active: #3730a3;
    --p-accent-contrast: #ffffff;
    --p-accent-soft: rgba(79, 70, 229, 0.09);
    --p-accent-ring: rgba(79, 70, 229, 0.32);

    /* semantic */
    --p-success: #10b981;
    --p-success-ink: #047857;
    --p-success-soft: rgba(16, 185, 129, 0.12);
    --p-danger: #ef4444;
    --p-danger-ink: #b91c1c;
    --p-danger-soft: rgba(239, 68, 68, 0.12);
    --p-warning: #f59e0b;
    --p-warning-ink: #b45309;
    --p-warning-soft: rgba(245, 158, 11, 0.14);
    --p-info: #0ea5e9;
    --p-info-ink: #0369a1;
    --p-info-soft: rgba(14, 165, 233, 0.12);

    /* geometry */
    --p-r-sm: 8px;
    --p-r-md: 10px;
    --p-r-lg: 14px;
    --p-r-xl: 18px;
    --p-r-pill: 999px;

    /* elevation */
    --p-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --p-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05),
        0 1px 3px rgba(15, 23, 42, 0.06);
    --p-shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04),
        0 6px 16px -4px rgba(15, 23, 42, 0.1);
    --p-shadow-lg: 0 4px 8px rgba(15, 23, 42, 0.04),
        0 16px 36px -8px rgba(15, 23, 42, 0.16);
    --p-shadow-pop: 0 8px 20px -6px rgba(15, 23, 42, 0.18),
        0 24px 48px -12px rgba(15, 23, 42, 0.2);

    --p-speed: 160ms;
    --p-ease: cubic-bezier(0.4, 0, 0.2, 1);

    /* Honeycomb texture — a seamless flat-top hex grid.
       Tile is 60 x 34.64 (R=20): one whole cell plus the two shared top edges
       of the cells below-left and below-right, which is exactly what makes it
       repeat without seams. */
    --p-honeycomb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='34.64'%3E%3Cg fill='none' stroke='%234f46e5' stroke-opacity='.042' stroke-width='1.2'%3E%3Cpath d='M50 17.32 40 34.64 20 34.64 10 17.32 20 0 40 0Z'/%3E%3Cpath d='M0 17.32H10'/%3E%3Cpath d='M50 17.32H60'/%3E%3C/g%3E%3C/svg%3E");
}

html.dark {
    --p-canvas: #0b1120;
    --p-canvas-2: #111a2e;
    --p-surface: #151d31;
    --p-surface-2: #1b2438;
    --p-surface-3: #212c43;
    --p-surface-hover: #1e2941;

    --p-text: #e8eefb;
    --p-text-soft: #c2cce0;
    --p-text-muted: #94a3b8;
    --p-text-faint: #7686a0;

    --p-border: #27324b;
    --p-border-soft: #1f2940;
    --p-border-strong: #35425f;

    --p-accent: #818cf8;
    --p-accent-hover: #6f7cf5;
    --p-accent-active: #5b68ea;
    --p-accent-contrast: #0b1120;
    --p-accent-soft: rgba(129, 140, 248, 0.16);
    --p-accent-ring: rgba(129, 140, 248, 0.38);

    --p-success-ink: #34d399;
    --p-success-soft: rgba(16, 185, 129, 0.16);
    --p-danger-ink: #f87171;
    --p-danger-soft: rgba(239, 68, 68, 0.18);
    --p-warning-ink: #fbbf24;
    --p-warning-soft: rgba(245, 158, 11, 0.18);
    --p-info-ink: #38bdf8;
    --p-info-soft: rgba(14, 165, 233, 0.18);

    --p-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --p-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --p-shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35),
        0 8px 20px -6px rgba(0, 0, 0, 0.45);
    --p-shadow-lg: 0 6px 14px rgba(0, 0, 0, 0.4),
        0 20px 44px -10px rgba(0, 0, 0, 0.55);
    --p-shadow-pop: 0 10px 26px -8px rgba(0, 0, 0, 0.6),
        0 28px 56px -14px rgba(0, 0, 0, 0.65);

    --p-honeycomb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='34.64'%3E%3Cg fill='none' stroke='%23818cf8' stroke-opacity='.07' stroke-width='1.2'%3E%3Cpath d='M50 17.32 40 34.64 20 34.64 10 17.32 20 0 40 0Z'/%3E%3Cpath d='M0 17.32H10'/%3E%3Cpath d='M50 17.32H60'/%3E%3C/g%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ base -- */
/* The canvas gradient lives on <html>, not <body>: a short page (the login
   screen) leaves the body box smaller than the viewport, and a fixed-attachment
   background is clipped to that box — which showed up as a visible seam. */
html {
    -webkit-text-size-adjust: 100%;
    background: var(--p-canvas);
    /* honeycomb on top, then the colour wash underneath */
    background-image: var(--p-honeycomb),
        radial-gradient(
            1200px 600px at 12% -8%,
            rgba(79, 70, 229, 0.1),
            transparent 60%
        ),
        radial-gradient(
            1000px 520px at 92% 0%,
            rgba(14, 165, 233, 0.09),
            transparent 58%
        ),
        linear-gradient(180deg, var(--p-canvas-2) 0%, var(--p-canvas) 42%);
    background-attachment: fixed;
    background-repeat: repeat, no-repeat, no-repeat, no-repeat;
    background-size: 152px 87.8px, auto, auto, auto;
}

html.dark {
    background-image: var(--p-honeycomb),
        radial-gradient(
            1200px 600px at 12% -8%,
            rgba(99, 102, 241, 0.16),
            transparent 60%
        ),
        radial-gradient(
            1000px 520px at 92% 0%,
            rgba(14, 165, 233, 0.12),
            transparent 58%
        ),
        linear-gradient(180deg, var(--p-canvas-2) 0%, var(--p-canvas) 46%);
}

body {
    background: transparent;
    color: var(--p-text);
    font-family: var(--p-font-ui);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.005em;
}

/* let the body gradient show through the Breeze page wrapper */
body > div.min-h-screen {
    background: transparent;
}

::selection {
    background: color-mix(in srgb, var(--p-accent) 30%, transparent);
    color: var(--p-text);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    ::selection {
        background: var(--p-accent-soft);
    }
}

:focus-visible {
    outline: 2px solid var(--p-accent);
    outline-offset: 2px;
    border-radius: var(--p-r-sm);
}

/* scrollbars */
* {
    scrollbar-color: var(--p-border-strong) transparent;
}
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background: var(--p-border-strong);
    border: 2px solid transparent;
    background-clip: content-box;
    border-radius: var(--p-r-pill);
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--p-text-faint);
    background-clip: content-box;
}

/* ------------------------------------------------------------ typography -- */
h1,
h2,
h3,
h4,
h5 {
    font-family: var(--p-font-display);
    color: var(--p-text);
    letter-spacing: -0.01em;
}

a {
    transition: color var(--p-speed) var(--p-ease);
}

u {
    text-decoration-color: var(--p-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* ---------------------------------------------------------------- navbar -- */
body nav[x-data] {
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--p-surface) 82%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--p-border);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02), var(--p-shadow-xs);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
    body nav[x-data] {
        background: var(--p-surface);
    }
}

/* brand mark */
body nav[x-data] svg.fill-current {
    color: var(--p-accent);
    filter: drop-shadow(0 2px 6px var(--p-accent-ring));
    transition: transform var(--p-speed) var(--p-ease);
}
body nav[x-data] a:hover svg.fill-current {
    transform: translateY(-1px) rotate(-6deg);
}

/* top-level nav links (Breeze x-nav-link renders bottom-border links) */
body nav[x-data] a.inline-flex {
    position: relative;
    border-bottom-color: transparent;
    border-radius: var(--p-r-md);
    /* tighter horizontal padding + slightly smaller type: the Russian labels
       are wider than the original English ones and at ~1440px the 7-item row
       overflowed and clipped the last link ("Админ") at the scroll edge.
       Trimming the type is the highest-leverage lever since the row width is
       dominated by the long labels ("Панель управления", "Купить доступ"). */
    padding: 0.5rem 0.45rem;
    font-size: 0.82rem;
    color: var(--p-text-muted);
    font-weight: 500;
    transition:
        color var(--p-speed) var(--p-ease),
        background-color var(--p-speed) var(--p-ease);
}

body nav[x-data] a.inline-flex:hover {
    color: var(--p-text);
    background: var(--p-accent-soft);
    border-bottom-color: transparent;
}

/* active item: Breeze marks it with an indigo bottom border */
body nav[x-data] a.inline-flex.border-indigo-400,
body nav[x-data] a.inline-flex.dark\:border-indigo-600 {
    color: var(--p-accent);
    background: var(--p-accent-soft);
    border-bottom-color: transparent;
}

body nav[x-data] a.inline-flex.border-indigo-400::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    /* kept inside the padding box: the links row is a scroll container on
       narrow laptops, and a negative offset would be clipped away */
    bottom: 2px;
    width: 22px;
    height: 3px;
    border-radius: var(--p-r-pill);
    background: var(--p-accent);
}

/* The original nav lays 7 links out with space-x-8 and never shrinks, so
   between the `sm` breakpoint and a wide desktop it pushed the whole page
   wider than the viewport and produced a horizontal scrollbar. Let the links
   row scroll inside the bar instead, and keep the user menu pinned. */
@media (min-width: 640px) {
    body nav[x-data] > div > div.flex > div.flex:first-child {
        min-width: 0;
    }

    body nav[x-data] div.space-x-8.sm\:flex {
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        align-items: center;
        scrollbar-width: none;
        -ms-overflow-style: none;
        /* trim the Breeze sm:ms-10 (2.5rem) offset so the wider Russian
           labels fit without the row needing to scroll on laptops */
        margin-inline-start: 0.5rem;
    }
    /* space-x-8 (2rem gaps) is also too wide for the Russian labels */
    body nav[x-data] div.space-x-8.sm\:flex > a + a {
        margin-inline-start: 0.5rem;
    }

    body nav[x-data] div.space-x-8.sm\:flex::-webkit-scrollbar {
        display: none;
    }

    body nav[x-data] div.space-x-8.sm\:flex > a {
        flex: none;
        white-space: nowrap;
    }

    /* the theme switch + user menu keep their width */
    body nav[x-data] > div > div.flex > div.sm\:items-center {
        flex: none;
    }
}

/* nav buttons: theme switch + user menu trigger */
body nav[x-data] button.inline-flex {
    border-radius: var(--p-r-md);
    background: transparent;
    color: var(--p-text-muted);
    font-weight: 500;
    transition:
        color var(--p-speed) var(--p-ease),
        background-color var(--p-speed) var(--p-ease);
}
body nav[x-data] button.inline-flex:hover {
    color: var(--p-text);
    background: var(--p-surface-3);
}

body nav[x-data] button.changeTheme:hover {
    color: var(--p-warning-ink);
    background: var(--p-warning-soft);
}

/* mobile menu panel */
body nav[x-data] > div:last-of-type {
    border-top: 1px solid var(--p-border-soft);
    background: var(--p-surface);
}

body nav[x-data] .border-t {
    border-color: var(--p-border-soft);
}

/* responsive nav links */
body nav[x-data] div.space-y-1 a {
    border-radius: var(--p-r-md);
    margin: 2px 8px;
    color: var(--p-text-soft);
}
body nav[x-data] div.space-y-1 a:hover {
    background: var(--p-accent-soft);
    color: var(--p-text);
}

/* ----------------------------------------------------------- page header -- */
body > div.min-h-screen > header {
    background: transparent;
    box-shadow: none;
    border: 0;
    padding-top: 0.5rem;
}

body > div.min-h-screen > header h2 {
    font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);
    font-weight: 700;
    color: var(--p-text);
}

body > div.min-h-screen > header h2 i {
    color: var(--p-accent);
}

/* ----------------------------------------------------------------- card -- */
.card {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-xl);
    box-shadow: var(--p-shadow-sm);
    transition:
        box-shadow 220ms var(--p-ease),
        transform 220ms var(--p-ease),
        border-color 220ms var(--p-ease);
}

.card:hover {
    box-shadow: var(--p-shadow-md);
    border-color: var(--p-border-strong);
}

.card-header {
    background: linear-gradient(
        180deg,
        var(--p-surface-2) 0%,
        var(--p-surface) 100%
    );
    border-bottom: 1px solid var(--p-border-soft);
    font-weight: 600;
    color: var(--p-text);
}

/* headings inside cards */
.card h4 {
    color: var(--p-text);
}

/* --------------------------------------------------------------- buttons -- */
.btn-default,
.btn-danger,
.btn-danger-outline,
.btn-success,
.btn-success-outline,
.btn-info,
.btn-info-outline,
.btn-warning,
.btn-warning-outline,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    border-radius: var(--p-r-md);
    padding: 0.5rem 0.9rem;
    font-family: var(--p-font-ui);
    font-size: 0.83rem;
    font-weight: 600;
    line-height: 1.2rem;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--p-shadow-xs);
    transition:
        background-color var(--p-speed) var(--p-ease),
        border-color var(--p-speed) var(--p-ease),
        color var(--p-speed) var(--p-ease),
        box-shadow var(--p-speed) var(--p-ease),
        transform var(--p-speed) var(--p-ease);
}

.btn-default:hover,
.btn-danger:hover,
.btn-danger-outline:hover,
.btn-success:hover,
.btn-success-outline:hover,
.btn-info:hover,
.btn-info-outline:hover,
.btn-warning:hover,
.btn-warning-outline:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--p-shadow-md);
}

.btn-default:active,
.btn-danger:active,
.btn-danger-outline:active,
.btn-success:active,
.btn-success-outline:active,
.btn-info:active,
.btn-info-outline:active,
.btn-warning:active,
.btn-warning-outline:active,
.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--p-shadow-xs);
}

/* neutral */
.btn-default {
    background: var(--p-surface);
    border-color: var(--p-border-strong);
    color: var(--p-text);
}
.btn-default:hover {
    background: var(--p-surface-hover);
    border-color: var(--p-accent);
    color: var(--p-accent);
}

/* Breeze ships every button component with `uppercase tracking-widest`.
   Looks dated in a modern Russian-text UI; tidy it up globally. Unlayered
   author CSS outranks Tailwind utility layers, so no !important needed. */
button.uppercase.tracking-widest,
a.uppercase.tracking-widest {
    text-transform: none;
    letter-spacing: 0.01em;
}

/* primary (login / main CTA) */
.btn-primary {
    /* the Breeze component ships `uppercase tracking-widest text-xs`; unlayered
       rules outrank those utilities, so normal casing wins back */
    text-transform: none;
    background: linear-gradient(
        180deg,
        var(--p-accent) 0%,
        var(--p-accent-hover) 100%
    );
    color: var(--p-accent-contrast);
    border-color: transparent;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.12),
        0 6px 16px -6px var(--p-accent-ring);
}
.btn-primary:hover {
    background: linear-gradient(
        180deg,
        var(--p-accent-hover) 0%,
        var(--p-accent-active) 100%
    );
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.14),
        0 12px 26px -8px var(--p-accent-ring);
}

/* solid semantic */
.btn-danger {
    background: var(--p-danger);
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
}
.btn-success {
    background: var(--p-success);
    color: #fff;
}
.btn-success:hover {
    background: #059669;
}
.btn-info {
    background: var(--p-info);
    color: #fff;
}
.btn-info:hover {
    background: #0284c7;
}
.btn-warning {
    background: var(--p-warning);
    color: #fff;
}
.btn-warning:hover {
    background: #d97706;
}

/* outline semantic */
.btn-danger-outline {
    background: var(--p-danger-soft);
    border-color: transparent;
    color: var(--p-danger-ink);
}
.btn-danger-outline:hover {
    background: var(--p-danger);
    color: #fff;
}

.btn-success-outline {
    background: var(--p-success-soft);
    border-color: transparent;
    color: var(--p-success-ink);
}
.btn-success-outline:hover {
    background: var(--p-success);
    color: #fff;
}

.btn-info-outline {
    background: var(--p-info-soft);
    border-color: transparent;
    color: var(--p-info-ink);
}
.btn-info-outline:hover {
    background: var(--p-info);
    color: #fff;
}

.btn-warning-outline {
    background: var(--p-warning-soft);
    border-color: transparent;
    color: var(--p-warning-ink);
}
.btn-warning-outline:hover {
    background: var(--p-warning);
    color: #fff;
}

/* icon spacing inside buttons */
.btn-default i,
.btn-danger i,
.btn-danger-outline i,
.btn-success i,
.btn-success-outline i,
.btn-info i,
.btn-info-outline i,
.btn-warning i,
.btn-warning-outline i,
.btn-primary i {
    opacity: 0.9;
}

/* segmented action group (admin users table) */
.inline-flex > a.rounded-s-lg,
.inline-flex > a.rounded-e-lg {
    background: var(--p-surface);
    border-color: var(--p-border);
    color: var(--p-text-soft);
    transition:
        background-color var(--p-speed) var(--p-ease),
        color var(--p-speed) var(--p-ease);
}
.inline-flex > a.rounded-s-lg:hover,
.inline-flex > a.rounded-e-lg:hover {
    background: var(--p-accent-soft);
    color: var(--p-accent);
}

/* ---------------------------------------------------------------- badges -- */
.badge-default,
.badge-dark,
.badge-success,
.badge-danger,
.badge-warning,
.badge-info {
    display: inline-flex;
    align-items: center;
    border-radius: var(--p-r-pill);
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.1rem;
    border: 1px solid transparent;
}

.badge-default {
    background: var(--p-accent-soft);
    color: var(--p-accent);
}
.badge-dark {
    background: var(--p-surface-3);
    color: var(--p-text-soft);
}
.badge-success {
    background: var(--p-success-soft);
    color: var(--p-success-ink);
}
.badge-danger {
    background: var(--p-danger-soft);
    color: var(--p-danger-ink);
}
.badge-warning {
    background: var(--p-warning-soft);
    color: var(--p-warning-ink);
}
.badge-info {
    background: var(--p-info-soft);
    color: var(--p-info-ink);
}

/* inline tinted chips used directly in tables (e.g. admin users status) */
td > span.bg-green-100,
td > span.bg-red-100,
td > span.bg-yellow-100,
td > span.bg-blue-100 {
    display: inline-flex;
    align-items: center;
    border-radius: var(--p-r-pill);
    padding: 0.2rem 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
td > span.bg-green-100 {
    background: var(--p-success-soft);
    color: var(--p-success-ink);
}
td > span.bg-red-100 {
    background: var(--p-danger-soft);
    color: var(--p-danger-ink);
}
td > span.bg-yellow-100 {
    background: var(--p-warning-soft);
    color: var(--p-warning-ink);
}
td > span.bg-blue-100 {
    background: var(--p-accent-soft);
    color: var(--p-accent);
}

/* ----------------------------------------------------------------- forms -- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
select,
textarea {
    background: var(--p-surface);
    border: 1px solid var(--p-border-strong);
    border-radius: var(--p-r-md);
    color: var(--p-text);
    padding: 0.58rem 0.8rem;
    font-family: var(--p-font-ui);
    font-size: 0.9rem;
    box-shadow: var(--p-shadow-xs);
    transition:
        border-color var(--p-speed) var(--p-ease),
        box-shadow var(--p-speed) var(--p-ease),
        background-color var(--p-speed) var(--p-ease);
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
input[type="date"]:hover,
select:hover,
textarea:hover {
    border-color: var(--p-text-faint);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--p-accent);
    box-shadow: 0 0 0 3px var(--p-accent-ring);
    background: var(--p-surface);
}

input::placeholder,
textarea::placeholder {
    color: var(--p-text-faint);
}

label {
    color: var(--p-text-soft);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

input[type="checkbox"],
input[type="radio"] {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 6px;
    border: 1px solid var(--p-border-strong);
    background: var(--p-surface);
    accent-color: var(--p-accent);
    transition:
        border-color var(--p-speed) var(--p-ease),
        box-shadow var(--p-speed) var(--p-ease);
}
input[type="radio"] {
    border-radius: 50%;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: var(--p-accent);
    border-color: var(--p-accent);
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    box-shadow: 0 0 0 3px var(--p-accent-ring);
    outline: none;
}

/* the app's pseudo-input cells inside tables */
.table-fake-input {
    background: var(--p-surface-2);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-md);
    color: var(--p-text-soft);
}

/* sortable "handle" rows */
.handle {
    background: var(--p-surface);
    border-color: var(--p-border);
    color: var(--p-text);
}

/* ------------------------------------------------------------- dropdowns -- */
/* the floating panel Breeze/Alpine renders (ring-1 wrapper) */
/* Dropdown panel. Target the inner content div (every dropdown renders it with
   ring-1 ring-black) — NOT `.rounded-md.shadow-lg > div`, which leaked this
   styling onto any card that happened to combine those two utilities. */
.ring-1.ring-black {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-lg);
    box-shadow: var(--p-shadow-pop);
    --tw-ring-color: transparent;
    overflow: hidden;
}

.dropdown-item {
    color: var(--p-text-soft);
    font-weight: 500;
    border-radius: 0;
    transition:
        background-color var(--p-speed) var(--p-ease),
        color var(--p-speed) var(--p-ease);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--p-accent-soft);
    color: var(--p-accent);
}

/* ---------------------------------------------------------------- tables -- */
table.dataTable,
.card table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-family: var(--p-font-ui);
}

.card table thead th,
table.dataTable thead th {
    background: var(--p-surface-2);
    color: var(--p-text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--p-border);
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    white-space: nowrap;
}

.card table thead th:first-child,
table.dataTable thead th:first-child {
    border-top-left-radius: var(--p-r-lg);
}
.card table thead th:last-child,
table.dataTable thead th:last-child {
    border-top-right-radius: var(--p-r-lg);
}

.card table tbody td,
table.dataTable tbody td {
    border-bottom: 1px solid var(--p-border-soft);
    color: var(--p-text-soft);
    font-size: 0.875rem;
    vertical-align: middle;
}

.card table tbody tr,
table.dataTable tbody tr {
    transition: background-color var(--p-speed) var(--p-ease);
}
/* NB: do NOT re-introduce `background: transparent` on rows here. The per-row
   colour tags apply a Tailwind `bg-*-500/50` utility to the <tr>, and those
   utilities live in @layer utilities in the compiled bundle. An UNLAYERED rule
   in this file beats every cascade layer regardless of specificity (even via
   :where()), so a transparent default would permanently hide the tint. Rows
   are transparent by default, so omitting the declaration is both correct and
   necessary for the colour feature to render. */

/* replace the harsh inset box-shadow hover with a soft tint */
.dataTable tbody > tr:hover > *,
html.dark .dataTable tbody > tr:hover > * {
    box-shadow: none;
}

.card table tbody tr:hover,
table.dataTable tbody tr:hover {
    background: var(--p-accent-soft);
}

.card table tbody tr:last-child td,
table.dataTable tbody tr:last-child td {
    border-bottom: 0;
}

/* column-resize grips — see public/assets/theme/col-resize.js */
.col-resize-grip {
    position: absolute;
    top: 0;
    right: -4px;
    width: 9px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
    user-select: none;
    z-index: 3;
}
.col-resize-grip::after {
    content: "";
    position: absolute;
    top: 25%;
    right: 4px;
    width: 2px;
    height: 50%;
    border-radius: 1px;
    background: var(--p-border-strong);
    opacity: 0;
    transition: opacity var(--p-speed) var(--p-ease);
}
table.dataTable thead th:hover > .col-resize-grip::after,
.col-resize-grip:hover::after {
    opacity: 0.7;
}
body.col-resizing,
body.col-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

/* DataTables chrome */
.dt-container .dt-search input,
.dt-container .dt-length select {
    background: var(--p-surface);
    border: 1px solid var(--p-border-strong);
    border-radius: var(--p-r-md);
    color: var(--p-text);
}

.dt-container .dt-info {
    color: var(--p-text-muted);
    font-size: 0.82rem;
}

.dt-container .dt-paging button {
    border-radius: var(--p-r-md);
    border: 1px solid var(--p-border);
    background: var(--p-surface);
    color: var(--p-text-soft);
    margin: 0 2px;
    padding: 0.35rem 0.7rem;
    font-weight: 600;
    transition:
        background-color var(--p-speed) var(--p-ease),
        color var(--p-speed) var(--p-ease),
        border-color var(--p-speed) var(--p-ease);
}

.dt-container .dt-paging button:hover:not(.disabled) {
    background: var(--p-accent-soft);
    border-color: var(--p-accent);
    color: var(--p-accent);
}

.dt-container .dt-paging button.current {
    background: var(--p-accent);
    border-color: var(--p-accent);
    color: var(--p-accent-contrast);
}

.dt-empty {
    color: var(--p-text-faint);
    font-style: italic;
}

/* DataTables sticks the "Кликните по записи…" selection hint right after the
   "Записи с X до Y из Z записей" string with NO separator. One pseudo-space
   fixes it (and keeps working across any dtRussian.mjs text change). */
.dt-info .select-info::before {
    content: " ";
    white-space: pre;
}

/* An empty drop-list in the profile columns picker rendered as 0×0 with no
   hint. Show a dashed placeholder with the data-empty text while it holds no
   <li>. Use :not(:has(li)) rather than :empty — Blade leaves a whitespace
   text node inside the <ul>, which defeats :empty but not :has. */
.handle-list.dropzone:not(:has(li)) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 5rem;
    border: 1px dashed var(--p-border-strong);
    border-radius: var(--p-r-md);
    background: var(--p-surface-2);
    color: var(--p-text-faint);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.75rem;
}
.handle-list.dropzone:not(:has(li))::before {
    content: attr(data-empty);
}

/* row selection colour used by datatables-select */
table.dataTable tbody tr.selected > * {
    box-shadow: inset 0 0 0 9999px var(--p-accent-soft);
    color: var(--p-text);
}

/* ---------------------------------------------------------------- modals -- */
/* Flowbite modal shell: style the inner panel only, never its display */
[id$="-modal"] > div > div {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-xl);
    box-shadow: var(--p-shadow-pop);
}

[id$="-modal"] h3 {
    color: var(--p-text);
    font-weight: 700;
}

[id$="-modal"] .border-b {
    border-color: var(--p-border-soft);
}

/* ---------------------------------------------------------------- footer -- */
body > div.min-h-screen > footer {
    margin-top: 2rem;
    border-top: 1px solid var(--p-border-soft);
}

body > div.min-h-screen > footer div {
    color: var(--p-text-faint);
    font-size: 0.82rem;
}

/* ------------------------------------------------ guest / auth (login) --- */
body.font-sans:not(.antialiased) > div.min-h-screen,
body > div.min-h-screen.flex.flex-col {
    background: transparent;
}

/* the login card */
body > div.min-h-screen.flex > div.sm\:max-w-md {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-xl);
    box-shadow: var(--p-shadow-lg);
    padding: 1.75rem 1.75rem 1.5rem;
    margin-top: 1.5rem;
}

/* logo above the card */
body > div.min-h-screen.flex > div:first-child svg {
    color: var(--p-accent);
    filter: drop-shadow(0 8px 20px var(--p-accent-ring));
}

.auth-title {
    font-family: var(--p-font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--p-text);
    text-align: center;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: var(--p-text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 1.25rem;
}

/* ------------------------------------------------- new: stat/quick cards -- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

/* one or two compact cards centred above a wide table, rather than a single
   card stretched across the whole container */
.stat-grid.is-compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
    gap: 0.5rem;
    justify-content: center;
}

/* ----- compact modifier (listing pages — just a counter above the table) ---
   The default stat-card is sized like a dashboard tile: 46px icon, 1.65rem
   value, 1.15rem/1.25rem padding. On a listing page the single counter in
   that size steals screen height from the actual table. is-compact halves it
   while keeping the same visual language. */
.stat-card.is-compact,
.stat-grid.is-compact .stat-card {
    padding: 0.55rem 0.9rem;
    gap: 0.65rem;
    border-radius: var(--p-r-lg);
}
.stat-card.is-compact::before,
.stat-grid.is-compact .stat-card::before {
    height: 2px;
    opacity: 0.6;
}
.stat-card.is-compact .stat-icon,
.stat-grid.is-compact .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    border-radius: var(--p-r-md);
}
.stat-card.is-compact .stat-value,
.stat-grid.is-compact .stat-value {
    font-size: 1.05rem;
    line-height: 1.1;
}
.stat-card.is-compact .stat-label,
.stat-grid.is-compact .stat-label {
    font-size: 0.72rem;
    margin-top: 0.1rem;
}
.stat-card.is-compact:hover,
.stat-grid.is-compact .stat-card:hover {
    transform: none;              /* no bounce on micro-cards */
    box-shadow: var(--p-shadow-sm);
}

.stat-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-xl);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--p-shadow-sm);
    transition:
        box-shadow 220ms var(--p-ease),
        transform 220ms var(--p-ease),
        border-color 220ms var(--p-ease);
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--p-accent),
        var(--p-info)
    );
    opacity: 0.85;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--p-shadow-md);
    border-color: var(--p-border-strong);
}

.stat-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: var(--p-r-lg);
    background: var(--p-accent-soft);
    color: var(--p-accent);
    font-size: 1.15rem;
}

.stat-body {
    min-width: 0;
}

.stat-value {
    font-family: var(--p-font-display);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--p-text);
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--p-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.15rem;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.quick-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-xl);
    padding: 1.05rem 1.15rem;
    text-decoration: none;
    box-shadow: var(--p-shadow-xs);
    transition:
        box-shadow 220ms var(--p-ease),
        transform 220ms var(--p-ease),
        border-color 220ms var(--p-ease),
        background-color 220ms var(--p-ease);
}

.quick-card:hover {
    transform: translateY(-2px);
    border-color: var(--p-accent);
    box-shadow: var(--p-shadow-md);
    background: var(--p-surface-hover);
}

.quick-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--p-r-lg);
    background: var(--p-accent-soft);
    color: var(--p-accent);
    font-size: 1.05rem;
    transition: background-color 220ms var(--p-ease), color 220ms var(--p-ease);
}

.quick-card:hover .quick-icon {
    background: var(--p-accent);
    color: var(--p-accent-contrast);
}

.quick-title {
    font-weight: 700;
    color: var(--p-text);
    font-size: 0.98rem;
}

.quick-desc {
    color: var(--p-text-muted);
    font-size: 0.8rem;
    margin-top: 0.1rem;
}

.quick-arrow {
    margin-inline-start: auto;
    color: var(--p-text-faint);
    transition: transform 220ms var(--p-ease), color 220ms var(--p-ease);
}

.quick-card:hover .quick-arrow {
    color: var(--p-accent);
    transform: translateX(3px);
}

/* Ink helpers — replace Tailwind color utilities that were purged from the
   compiled bundle (text-indigo-500 / text-yellow-700 / text-red-700 and their
   dark: variants render nothing). These adapt via the theme variables. */
.ink-accent {
    color: var(--p-accent) !important;
}
.ink-warning {
    color: var(--p-warning-ink) !important;
}
.ink-danger {
    color: var(--p-danger-ink) !important;
}
.ink-success {
    color: var(--p-success-ink) !important;
}
.ink-muted {
    color: var(--p-text-muted) !important;
}

/* section heading helper */
.section-title {
    font-family: var(--p-font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--p-text-faint);
    margin-bottom: 0.75rem;
}

/* spacing between stacked sections, without relying on a Tailwind utility
   that may not exist in the pre-built bundle */
.section-title.is-spaced {
    margin-top: 1.75rem;
}

/* ------------------------------------------------------------ sweetalert -- */
.swal2-popup {
    background: var(--p-surface);
    color: var(--p-text);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-xl);
    box-shadow: var(--p-shadow-pop);
    font-family: var(--p-font-ui);
}

.swal2-title {
    color: var(--p-text);
    font-family: var(--p-font-display);
}

.swal2-html-container {
    color: var(--p-text-soft);
}

.swal2-confirm.swal2-styled {
    background: var(--p-accent);
    border-radius: var(--p-r-md);
    box-shadow: none;
}

.swal2-cancel.swal2-styled {
    background: var(--p-surface-3);
    color: var(--p-text);
    border-radius: var(--p-r-md);
}

/* ------------------------------------------------- alerts & field errors -- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    border-radius: var(--p-r-lg);
    padding: 0.7rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3rem;
    border: 1px solid transparent;
}

/* no icon pseudo-element here on purpose: it would depend on the exact
   Font Awesome family name and render as tofu if that ever changes */
.alert-success {
    background: var(--p-success-soft);
    color: var(--p-success-ink);
    border-inline-start: 3px solid var(--p-success);
}

.alert-error {
    background: var(--p-danger-soft);
    color: var(--p-danger-ink);
    border-inline-start: 3px solid var(--p-danger);
}

.field-error {
    color: var(--p-danger-ink);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.1rem;
}

/* ---------------------------------------------------------- empty state -- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.6rem 1.5rem;
    border: 1px dashed var(--p-border-strong);
    border-radius: var(--p-r-lg);
    background-color: var(--p-surface-2);
    background-image: var(--p-honeycomb);
    background-size: 104px 60px;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: var(--p-r-lg);
    background: var(--p-accent-soft);
    color: var(--p-accent);
    font-size: 1.35rem;
    margin-bottom: 0.9rem;
}

.empty-title {
    font-family: var(--p-font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--p-text);
}

.empty-text {
    color: var(--p-text-muted);
    font-size: 0.85rem;
    margin-top: 0.3rem;
    max-width: 42ch;
}

.empty-state > a,
.empty-state > button {
    margin-top: 1.1rem;
}

/* DataTables' own "no rows" cell gets the same treatment */
.dt-empty {
    padding: 2.25rem 1rem !important;
    color: var(--p-text-faint);
    font-style: normal;
    font-weight: 500;
    background-image: var(--p-honeycomb);
    background-size: 104px 60px;
}

/* ------------------------------------------------- stat card: expired --- */
.stat-card.is-danger::before {
    background: linear-gradient(90deg, var(--p-danger), var(--p-warning));
}

.stat-card.is-danger .stat-icon {
    background: var(--p-danger-soft);
    color: var(--p-danger-ink);
}

/* ------------------------------------------------------- FAQ accordion -- */
.faq-item + .faq-item {
    margin-top: 0.6rem;
}

.faq-item {
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-lg);
    background: var(--p-surface-2);
    overflow: hidden;
    transition: border-color var(--p-speed) var(--p-ease);
}

.faq-item:hover {
    border-color: var(--p-border-strong);
}

.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.1rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: start;
    font-family: var(--p-font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--p-text);
}

.faq-q:hover {
    color: var(--p-accent);
}

.faq-chevron {
    flex: none;
    color: var(--p-text-faint);
    transition: transform 220ms var(--p-ease), color 220ms var(--p-ease);
}

.faq-chevron.is-open {
    transform: rotate(180deg);
    color: var(--p-accent);
}

.faq-a {
    padding: 0 1.1rem 1.05rem;
    color: var(--p-text-soft);
    font-size: 0.88rem;
    line-height: 1.5rem;
}

.faq-note {
    margin-top: 1.1rem;
    text-align: center;
    color: var(--p-text-faint);
    font-size: 0.82rem;
}

/* ------------------------------------------- honeycomb halo: sign-in --- */
body > div.min-h-screen.flex {
    position: relative;
}

body > div.min-h-screen.flex::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--p-honeycomb);
    background-size: 186px 107px;
    -webkit-mask-image: radial-gradient(
        540px 430px at 50% 40%,
        #000 0%,
        transparent 72%
    );
    mask-image: radial-gradient(
        540px 430px at 50% 40%,
        #000 0%,
        transparent 72%
    );
}

/* keep the logo and the card above the halo */
body > div.min-h-screen.flex > * {
    position: relative;
    z-index: 1;
}

/* -------------------------------------------------------- small screens -- */
@media (max-width: 640px) {
    .card {
        border-radius: var(--p-r-lg);
    }

    .stat-card,
    .quick-card {
        padding: 0.95rem 1rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-icon,
    .quick-icon {
        width: 40px;
        height: 40px;
    }

    /* let wide tables scroll instead of squashing the columns */
    .card .relative.rounded-lg {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* descendant, not direct child: DataTables re-parents the <table> under a
       .dt-container wrapper, so a `>` combinator here never matched and wide
       tables squished to the viewport instead of scrolling. */
    .card .relative.rounded-lg table {
        min-width: 620px;
    }

    /* full-width action buttons read better on a phone */
    .btn-default,
    .btn-danger-outline,
    .btn-success-outline,
    .btn-info-outline,
    .btn-warning-outline {
        width: 100%;
    }
}

/* --------------------------------------------------------- misc polish --- */
hr {
    border-color: var(--p-border-soft);
}

code,
pre {
    background: var(--p-surface-3);
    border-radius: var(--p-r-sm);
    color: var(--p-text);
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
