:root {
    --bg: #0a0e17;
    --bg-card: #111827;
    --bg-input: #0f172a;
    --border: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --neon: #00d4ff;
    --neon-dim: #0099cc;
    --neon-glow: rgba(0, 212, 255, 0.25);
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 10px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --shell-head-height: 4.5rem;
    --main-padding-x: 2rem;
}

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

html { font-size: 16px; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--neon); text-decoration: none; }
a:hover { color: #66e5ff; }

/* Branded scrollbar — visible only when overflow: auto/scroll and content overflows */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--neon-dim) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 153, 204, 0.9), rgba(0, 212, 255, 0.75));
    border-radius: 999px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--neon);
}

*::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

.container { width: 100%; max-width: none; margin: 0; }

.main { padding: 0; }
.main--center { display: flex; align-items: center; min-height: 100vh; padding: 1rem; }

.auth-wrap { width: min(400px, 100%); margin: 0 auto; }

/* App shell + sidebar */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 200;
    transition: width 0.2s ease;
}

.sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: var(--shell-head-height);
    padding: 0 0.75rem 0 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar__collapse {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}

.sidebar__collapse:hover {
    color: var(--neon);
    border-color: color-mix(in srgb, var(--neon) 45%, var(--border));
    background: rgba(0, 212, 255, 0.08);
}

.sidebar__collapse-icon {
    width: 0.55rem;
    height: 0.55rem;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.sidebar.is-collapsed .sidebar__collapse-icon {
    transform: rotate(-135deg);
}

.sidebar__nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar__section {
    margin: 0.75rem 0.5rem 0.35rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: 0.2s;
    white-space: nowrap;
}

.sidebar__link:hover,
.sidebar__link.is-active {
    color: var(--neon);
    background: rgba(0, 212, 255, 0.08);
    box-shadow: inset 3px 0 0 var(--neon);
}

.sidebar__icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--neon);
    flex-shrink: 0;
}

.sidebar__label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo__short {
    display: none;
}

.sidebar.is-collapsed {
    width: 4.75rem;
}

.sidebar.is-collapsed .sidebar__head {
    padding: 0 0.55rem;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.sidebar.is-collapsed .logo__full {
    display: none;
}

.sidebar.is-collapsed .logo__short {
    display: inline;
    color: var(--neon);
    text-shadow: 0 0 12px var(--neon-glow);
    font-size: 1.15rem;
}

.sidebar.is-collapsed .sidebar__label,
.sidebar.is-collapsed .sidebar__user-role,
.sidebar.is-collapsed .sidebar__section {
    display: none;
}

.sidebar.is-collapsed .sidebar__link {
    justify-content: center;
    padding: 0.7rem 0.45rem;
    gap: 0;
}

.sidebar.is-collapsed .sidebar__link.is-active,
.sidebar.is-collapsed .sidebar__link:hover {
    box-shadow: none;
}

.sidebar.is-collapsed .sidebar__user {
    text-align: center;
}

.sidebar.is-collapsed .sidebar__user-name {
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar.is-collapsed .sidebar__logout {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    justify-content: center;
    gap: 0;
}

.sidebar.is-collapsed .sidebar__logout-icon {
    display: inline;
}

.sidebar__logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar__logout-icon {
    display: none;
    font-size: 1rem;
    line-height: 1;
}

/* Sidebar server health widget */
.sidebar-server {
    margin-top: 0.75rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.55);
}

.sidebar-server.is-loading {
    opacity: 0.75;
}

.sidebar-server__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.sidebar-server__title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.sidebar-server__refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s;
}

.sidebar-server__refresh:hover:not(:disabled) {
    color: var(--neon);
    border-color: rgba(0, 212, 255, 0.35);
}

.sidebar-server__refresh:disabled {
    opacity: 0.5;
    cursor: default;
}

.sidebar-server__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.sidebar-server__path {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.sidebar-server__time {
    white-space: nowrap;
}

.sidebar-server__section + .sidebar-server__section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.sidebar-server__section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
}

.sidebar-server__hint {
    font-size: 0.62rem;
    font-weight: 400;
    color: var(--text-muted);
    text-align: right;
}

.sidebar-server__bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.9);
    overflow: hidden;
    margin-bottom: 0.55rem;
}

.sidebar-server__bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #16a34a, var(--success));
    transition: width 0.35s ease;
}

.sidebar-server__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

.sidebar-server__stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.35rem 0.25rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
}

.sidebar-server__stat-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.sidebar-server__stat-value {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
}

.sidebar-server__stat-value.is-ok {
    color: var(--success);
}

.sidebar-server__loads {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

.sidebar-server__load {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.45rem 0.25rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.sidebar-server__load-dot {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.sidebar-server__load-dot.is-ok { background: var(--success); }
.sidebar-server__load-dot.is-warn { background: #eab308; }
.sidebar-server__load-dot.is-danger { background: var(--danger); }
.sidebar-server__load-dot.is-unknown { background: var(--text-muted); }

.sidebar-server__load-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.sidebar-server__load-label {
    font-size: 0.58rem;
    color: var(--text-muted);
}

.sidebar-server__note {
    margin: 0.45rem 0 0;
    font-size: 0.6rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.sidebar-server__error {
    margin: 0.5rem 0 0;
    font-size: 0.68rem;
    color: var(--danger);
}

/* Server health page */
.server-health {
    width: 100%;
}

.server-health.is-loading {
    opacity: 0.75;
}

.server-health__grid,
.server-health__logs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.server-health__grid .server-health__card,
.server-health__logs-grid .server-health__card {
    margin-bottom: 0;
    min-width: 0;
}

.server-health__grid .server-health__card {
    height: 100%;
}

.server-health__grid--resources {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.server-health__card--apache {
    grid-column: 1 / -1;
}

.server-health__card--apache .server-health__metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.server-health__card--apache .server-health__card-head {
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}

.server-health__card--apache .server-health__card-hint {
    max-width: 100%;
    line-height: 1.35;
    text-align: right;
}

.server-health__metric {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 0;
}

.server-health__metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.server-health__card--apache .server-health__metric-label {
    font-size: 0.65rem;
}

.server-health__metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.server-health__card--apache .server-health__metric-value {
    font-size: 1rem;
}

.server-health__metric-value.is-ok {
    color: var(--success);
}

.server-health__diagnostics {
    margin-bottom: 1rem;
}

.server-health__warnings {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.server-health__warnings li {
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: rgba(234, 179, 8, 0.08);
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.4;
}

.server-health__warnings li.is-ok {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
}

.server-health__warnings-empty {
    color: var(--text-muted);
    background: transparent !important;
    border: none !important;
    padding-left: 0 !important;
}

.server-health__bar-fill.is-warn {
    background: linear-gradient(90deg, #eab308, #facc15);
}

.server-health__bar-fill.is-danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.server-health__logs-grid .server-health__card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.server-health__logs-grid .server-health__card-hint {
    line-height: 1.35;
}

.server-health__logs-grid .server-health__table {
    font-size: 0.8rem;
}

.server-health__logs-grid .server-health__table th,
.server-health__logs-grid .server-health__table td {
    padding: 0.6rem 0.55rem;
}

.server-health__logs-grid .server-health__table th {
    font-size: 0.72rem;
    white-space: normal;
    line-height: 1.25;
    vertical-align: bottom;
}

.server-health__logs-grid .server-health__table code {
    font-size: 0.75rem;
}

.server-health__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.server-health__poll-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.server-health__card {
    margin-bottom: 1rem;
}

.server-health__card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.server-health__card-title {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
}

.server-health__card-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.server-health__bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.9);
    overflow: hidden;
    margin-bottom: 1rem;
}

.server-health__bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #16a34a, var(--success));
    transition: width 0.35s ease;
}

.server-health__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.server-health__loads {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.server-health__load {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.server-health__load-dot {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.server-health__load-dot.is-ok { background: var(--success); }
.server-health__load-dot.is-warn { background: #eab308; }
.server-health__load-dot.is-danger { background: var(--danger); }
.server-health__load-dot.is-unknown { background: var(--text-muted); }

.server-health__load-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.server-health__load-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.server-health__note {
    margin: 0.85rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.server-health__history {
    margin-bottom: 1rem;
}

.server-health__periods {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.server-health__period {
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
}

.server-health__period:hover,
.server-health__period.is-active {
    border-color: var(--neon);
    color: var(--neon);
}

.server-health__history-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.server-health__history-summary strong {
    color: var(--text);
    font-weight: 600;
}

.server-health__charts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.server-health__chart {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.15);
}

.server-health__chart-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.server-health__chart canvas {
    display: block;
    width: 100%;
    height: 120px;
}

.server-health__error {
    margin: 0;
    font-size: 0.85rem;
    color: var(--danger);
}

.server-health__table {
    table-layout: fixed;
    width: 100%;
}

.server-health__table col.server-health__col-endpoint {
    width: 38%;
}

.server-health__table col.server-health__col-count {
    width: 11%;
}

.server-health__table col.server-health__col-metric {
    width: 17%;
}

.server-health__table th:nth-child(n + 2),
.server-health__table td:nth-child(n + 2) {
    text-align: right;
}

.server-health__table th:first-child,
.server-health__table td:first-child {
    white-space: normal;
    word-break: break-word;
}

.server-health__table code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    color: var(--text);
}

@media (max-width: 1200px) {
    .server-health__logs-grid {
        grid-template-columns: 1fr;
    }

    .server-health__grid--resources {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .server-health__charts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .server-health__grid,
    .server-health__grid--resources {
        grid-template-columns: 1fr;
    }

    .server-health__charts {
        grid-template-columns: 1fr;
    }

    .server-health__card--apache .server-health__metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.sidebar__foot {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.sidebar__user { margin-bottom: 0.75rem; }

.sidebar__user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.sidebar__user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.topbar {
    display: none;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 150;
}

.topbar__title {
    font-weight: 600;
    font-size: 1rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 190;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    white-space: nowrap;
    display: inline-block;
}

.logo span { color: var(--neon); text-shadow: 0 0 12px var(--neon-glow); }

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-shrink: 0;
}

.burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--neon);
}

.app-main .main {
    padding: 0;
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.page-head {
    display: flex;
    align-items: flex-start;
    min-height: var(--shell-head-height);
    padding: 1rem var(--main-padding-x);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg);
}

.main__body {
    flex: 1;
    padding: 1.5rem var(--main-padding-x) 2.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    text-decoration: none;
}

.btn--primary {
    background: var(--neon);
    color: #041018;
    box-shadow: 0 0 16px var(--neon-glow);
}

.btn--primary:hover { background: #33ddff; color: #041018; }

.btn--success {
    color: #052e16;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border-color: rgba(134, 239, 172, 0.7);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.24);
}

.btn--success:hover {
    color: #052e16;
    background: linear-gradient(135deg, #86efac, #4ade80);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.34);
}

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

.btn--ghost:hover { border-color: var(--neon); color: var(--neon); }

.btn--danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

.btn--danger-solid {
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #f87171;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.24);
}

.btn--danger-solid:hover {
    color: #fff;
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.34);
}

.btn--sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.btn--block { width: 100%; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card__title {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--neon);
}

.form-card { display: flex; flex-direction: column; gap: 1rem; align-items: stretch; }

.form-card__actions {
    align-self: flex-start;
}

.form-card__actions--end {
    align-self: flex-end;
}

/* Forms */
.form { display: flex; flex-direction: column; gap: 1rem; }

.form__group { display: flex; flex-direction: column; gap: 0.35rem; }

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

.ticket-basics {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) minmax(17rem, 0.42fr);
    align-items: end;
    gap: 1rem;
}

.ticket-type-switch {
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 0;
}

.ticket-type-switch .form__label {
    display: block;
    margin-bottom: 0.35rem;
}

.ticket-type-switch__options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.ticket-type-switch__option {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.ticket-type-switch__option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ticket-type-switch__control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.65rem;
    padding: 0.55rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 650;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.ticket-type-switch__dot {
    width: 0.5rem;
    height: 0.5rem;
    flex-shrink: 0;
    background: currentColor;
    border-radius: 999px;
    box-shadow: 0 0 0 3px currentColor;
}

.ticket-type-switch__option--bug {
    color: #fb7185;
}

.ticket-type-switch__option--development {
    color: #60a5fa;
}

.ticket-type-switch__option:hover .ticket-type-switch__control {
    color: inherit;
    border-color: currentColor;
}

.ticket-type-switch__option input:checked + .ticket-type-switch__control {
    color: inherit;
    background: color-mix(in srgb, currentColor 11%, var(--bg-input));
    border-color: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

.ticket-type-switch__option input:focus-visible + .ticket-type-switch__control {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.ticket-type-switch__option input:invalid:not(:focus) + .ticket-type-switch__control {
    border-color: var(--border);
}

.form__label { font-size: 0.85rem; color: var(--text-muted); }

.form__input, .form__textarea, select.form__input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    font-family: inherit;
    width: 100%;
}

.form__input:focus, .form__textarea:focus, select.form__input:focus {
    outline: none;
    border-color: var(--neon);
    box-shadow: 0 0 0 3px var(--neon-glow);
}

.form__input--color { height: 44px; padding: 0.25rem; cursor: pointer; }

.form__input--date,
.form__input[type="date"] {
    cursor: pointer;
    position: relative;
    min-height: 42px;
}

.form__input--date::-webkit-calendar-picker-indicator,
.form__input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    background: transparent;
}

.form__textarea { min-height: 120px; resize: vertical; }

.form__checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* Auth */
.auth-card {
    width: min(400px, 100%);
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 0 40px var(--neon-glow);
}

.auth-card__title {
    margin: 0;
    text-align: center;
    font-size: 1.75rem;
}

.auth-card__title + .auth-card__subtitle { margin-top: 0.25rem; }

.auth-card__subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Page */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    width: 100%;
}

.page-header h1,
.page-header__title {
    margin: 0;
    font-size: clamp(1.15rem, 1.6vw, 1.5rem);
    line-height: 1.35;
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
}

.page-header__lead {
    flex: 1 1 auto;
    min-width: 0;
}

.page-header__number {
    color: var(--neon);
    font-weight: 700;
    white-space: nowrap;
}

.page-header__sep {
    margin: 0 0.35em;
    color: var(--text-muted);
}

.page-header__text {
    word-break: break-word;
}

.page-header--ticket {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem 1.5rem;
}

.page-header__main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    width: 100%;
}

.ticket-crumb {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: min(42rem, 100%);
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.35;
    text-decoration: none;
}

.ticket-crumb:hover {
    color: var(--neon);
}

.ticket-crumb:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 3px;
    border-radius: 6px;
}

.ticket-crumb svg {
    width: 0.85rem;
    height: 0.85rem;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.ticket-crumb__num {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--neon);
}

.ticket-crumb__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-header__actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    max-width: none;
    padding-top: 0.15rem;
}

.page-header__actions form {
    display: inline-flex;
    margin: 0;
}

.page-header__actions .ticket-action-btn {
    --action-rgb: 34, 211, 238;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-height: 2.25rem;
    white-space: nowrap;
    color: rgb(var(--action-rgb));
    font-weight: 650;
    letter-spacing: 0;
    background:
        linear-gradient(180deg, rgba(var(--action-rgb), 0.08), rgba(var(--action-rgb), 0.025)),
        rgba(7, 12, 24, 0.9);
    border: 1px solid rgba(var(--action-rgb), 0.52);
    border-radius: 9px;
    box-shadow:
        0 5px 14px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(var(--action-rgb), 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    text-shadow: none;
    backdrop-filter: blur(8px);
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.page-header__actions .ticket-action-btn svg {
    width: 0.9rem;
    height: 0.9rem;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.page-header__actions .ticket-action-btn:hover {
    color: color-mix(in srgb, rgb(var(--action-rgb)) 82%, white);
    background:
        linear-gradient(180deg, rgba(var(--action-rgb), 0.15), rgba(var(--action-rgb), 0.06)),
        rgba(7, 12, 24, 0.94);
    border-color: rgba(var(--action-rgb), 0.85);
    box-shadow:
        0 7px 18px rgba(0, 0, 0, 0.34),
        0 0 14px rgba(var(--action-rgb), 0.23),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
    filter: none;
    transform: translateY(-1px);
}

.page-header__actions .ticket-action-btn:active {
    box-shadow:
        0 3px 9px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(var(--action-rgb), 0.16);
    transform: translateY(0);
}

.page-header__actions .ticket-action-btn:focus-visible {
    outline: 2px solid rgba(var(--action-rgb), 0.8);
    outline-offset: 3px;
}

.page-header__actions .ticket-action-btn.btn--danger-solid {
    --action-rgb: 248, 113, 113;
}

.page-header__actions .ticket-action-btn.btn--success {
    --action-rgb: 74, 222, 128;
}

@media (min-width: 901px) {
    .page-head .btn {
        padding: 0.45rem 1rem;
        font-size: 0.85rem;
    }
}

.meta, .muted { color: var(--text-muted); font-size: 0.85rem; }

.page-meta { margin: 0 0 1.25rem; }

/* Widgets */
.widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.widgets--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0;
}

.dashboard-form {
    margin-bottom: 1.5rem;
}

.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dashboard-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.dashboard-dates {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.75rem;
    width: fit-content;
    justify-self: end;
    align-self: start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.dashboard-dates .form__group {
    width: auto;
}

.dashboard-dates .form__input--date {
    width: calc(10ch + 1.7rem);
    max-width: calc(10ch + 1.7rem);
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

.widget {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.widget--active {
    border-color: var(--neon);
    box-shadow: 0 0 20px var(--neon-glow);
}

.widget--active:hover {
    box-shadow: 0 0 28px var(--neon-glow);
    transform: translateY(-1px);
}

.widget--muted { opacity: 0.85; }

.widget--clickable {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.widget--clickable:hover {
    border-color: rgba(0, 212, 255, 0.45);
    transform: translateY(-1px);
}

.widget--selected {
    border-color: var(--neon);
    box-shadow: 0 0 20px var(--neon-glow);
}

.widget--status {
    border-color: var(--widget-color, var(--border));
}

.widget--status .widget__value {
    color: var(--widget-color, var(--neon));
    text-shadow: 0 0 12px color-mix(in srgb, var(--widget-color, var(--neon)) 45%, transparent);
}

.widget--status:hover {
    border-color: var(--widget-color, var(--neon));
    box-shadow: 0 0 18px color-mix(in srgb, var(--widget-color, var(--neon)) 35%, transparent);
}

.widget--status.widget--selected {
    border-color: var(--widget-color, var(--neon));
    box-shadow: 0 0 22px color-mix(in srgb, var(--widget-color, var(--neon)) 45%, transparent);
}

.widget--selected:hover {
    box-shadow: 0 0 28px var(--neon-glow);
}

.widget__value {
    font-size: 4rem;
    font-weight: 700;
    color: var(--neon);
    text-shadow: 0 0 10px var(--neon-glow);
    line-height: 1;
}

.widget__label { font-size: 1.36rem; color: var(--text-muted); margin-top: 0.35rem; line-height: 1.2; }

.widgets--compact .widget {
    padding: 1rem 0.75rem;
    min-height: 7.5rem;
}

.widgets--compact .widget__value {
    font-size: 3.2rem;
}

.widgets--compact .widget__label {
    font-size: 1.248rem;
}

.widget__split {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    width: 100%;
    max-width: 10.5rem;
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border);
}

.widget__split-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
}

.widget__split-row--front {
    color: #34d399;
}

.widget__split-row--back {
    color: #fbbf24;
}

.widget__split-row--other {
    color: var(--text-muted);
    font-weight: 600;
}

.analytics-widgets .widget--hours {
    min-height: 9.75rem;
    padding-bottom: 0.9rem;
}

/* Filters */
.filters {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0;
}

.filters__row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.filters__search {
    flex: 1.4 1 9rem;
    min-width: 0;
}

.filters__row > .form__group:not(.filters__search):not(.filters__date) {
    flex: 1 1 7.5rem;
    min-width: 0;
}

.filters__date {
    flex: 0 0 calc(10ch + 1.5rem);
    min-width: 0;
}

.filters__date .form__label {
    font-size: 0.72rem;
    letter-spacing: 0.01em;
}

.filters__date .form__input--date {
    width: 100%;
    min-width: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.filters__actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

.filters__actions .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Analytics */
.analytics-form {
    margin-bottom: 1.5rem;
}

.analytics-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: stretch;
}

.analytics-widgets {
    margin-bottom: 0;
}

.analytics-dates {
    grid-template-columns: repeat(2, auto);
    grid-template-rows: auto 1fr;
    align-self: stretch;
    align-content: stretch;
}

.analytics-dates__actions {
    grid-column: span 2;
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    align-self: end;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1rem;
    align-items: start;
}

.analytics-count {
    color: var(--neon);
}

.analytics-hours {
    color: #86efac;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.24);
}

.analytics-number-cell {
    text-align: center !important;
}

.analytics-bar {
    position: relative;
    height: 1.5rem;
    background: rgba(0, 212, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    min-width: 6rem;
}

.analytics-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.35), var(--neon));
    border-radius: 999px;
    box-shadow: 0 0 12px var(--neon-glow);
}

.analytics-bar__label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
}

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--bg-card);
}

.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table th {
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
}

.table tr:hover td { background: rgba(0, 212, 255, 0.03); }

.table__empty { text-align: center; color: var(--text-muted); white-space: normal; }

.table__title .link { font-weight: 500; }

/* Tickets list — long titles truncate before date column */
.table--tickets {
    table-layout: fixed;
}

.table--tickets th,
.table--tickets td {
    padding: 0.85rem 1.25rem;
    vertical-align: middle;
}

.table--tickets th {
    text-align: center;
    white-space: normal;
    line-height: 1.35;
}

.table--tickets th:nth-child(2) {
    text-align: left;
}

.table--tickets td:not(.table__title) {
    text-align: center;
}

.table--tickets th:first-child,
.table--tickets td:first-child { width: 4rem; }

.table--tickets th:nth-child(2),
.table--tickets td.table__col-title {
    width: 24%;
    min-width: 12rem;
}

.table--tickets th:nth-child(3),
.table--tickets td:nth-child(3) { width: 7.5rem; }

.table--tickets th:nth-child(4),
.table--tickets td:nth-child(4) { width: 7.5rem; }

.table--tickets th:nth-child(5),
.table--tickets td:nth-child(5) { width: 8.5rem; }

.table--tickets th:nth-child(6),
.table--tickets td:nth-child(6) { width: 6.5rem; }

.table--tickets th:nth-child(7),
.table--tickets td:nth-child(7) { width: 8.5rem; }

.table--tickets th:nth-child(8),
.table--tickets td:nth-child(8) { width: 9rem; }

.table--tickets th:nth-child(9),
.table--tickets td:nth-child(9) { width: 10rem; }

.table__comments-unread {
    color: var(--neon);
    font-weight: 600;
}

.table--tickets .table__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.table--tickets .table__col-date {
    display: none !important;
}

.ticket-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 5.4rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid currentColor;
    border-radius: 999px;
}

.ticket-type-badge::before {
    content: "";
    display: block;
    width: 0.38rem;
    height: 0.38rem;
    flex: none;
    font-size: 0;
    line-height: 0;
    background: currentColor;
    border-radius: 50%;
}

.ticket-type-badge--bug {
    color: #fb7185;
    background: rgba(251, 113, 133, 0.09);
}

.ticket-type-badge--development {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.09);
}

.ticket-type-badge--front {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

.ticket-type-badge--back {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    min-width: 7.4rem;
}

.page-header__parent {
    margin: 0.4rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.ticket-subtasks-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.85rem;
}

.ticket-card__section--subtasks .ticket-card__title {
    margin: 0;
}

.ticket-subtasks-note {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ticket-subtask-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 0.75rem;
}

.ticket-subtask-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 7.25rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(7, 12, 24, 0.55);
    color: inherit;
    text-decoration: none;
}

.ticket-subtask-card--back {
    border-color: rgba(251, 191, 36, 0.32);
}

.ticket-subtask-card--front {
    border-color: rgba(52, 211, 153, 0.32);
}

.ticket-subtask-card--filled:hover {
    border-color: var(--neon);
    box-shadow: 0 0 0 3px var(--neon-glow);
}

.ticket-subtask-card__top,
.ticket-subtask-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ticket-subtask-card__people {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.ticket-subtask-card__person {
    font-weight: 600;
}

.ticket-subtask-card__co,
.ticket-subtask-card__num,
.ticket-subtask-card__idle {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.ticket-subtask-card__go {
    color: var(--neon);
    font-size: 0.8rem;
    font-weight: 600;
}

.ticket-subtask-card--add {
    justify-content: flex-start;
}

.ticket-subtask-card--add.is-open {
    justify-content: flex-start;
}

.ticket-subtask-card--add.is-open .ticket-subtask-card__cta {
    display: none;
}

.ticket-subtask-card__cta {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.ticket-subtask-card__plus {
    position: relative;
    display: inline-block;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px dashed currentColor;
    color: var(--neon);
}

.ticket-subtask-card__plus::before,
.ticket-subtask-card__plus::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: currentColor;
    border-radius: 1px;
    transform: translate(-50%, -50%);
}

.ticket-subtask-card__plus::before {
    width: 0.7rem;
    height: 2px;
}

.ticket-subtask-card__plus::after {
    width: 2px;
    height: 0.7rem;
}

.ticket-subtask-card__cta-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.ticket-subtask-card__cta-text strong {
    font-size: 0.95rem;
}

.ticket-subtask-card__cta-text span {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.ticket-subtask-card__form {
    display: grid;
    gap: 0.75rem;
}

.ticket-subtask-card__form[hidden] {
    display: none !important;
}

.ticket-subtask-card__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.ticket-subtask-card--idle {
    justify-content: center;
    gap: 0.45rem;
    opacity: 0.7;
}

.table__title-inner {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.table__title-inner .link {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.table__subtask-toggle {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
}

.table__subtask-toggle::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.4rem;
    height: 0.4rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: translate(-70%, -60%) rotate(-45deg);
}

.table__subtask-toggle[aria-expanded="true"]::before {
    transform: translate(-50%, -70%) rotate(45deg);
}

.table--tickets .table__row--child td {
    background: rgba(255, 255, 255, 0.025);
}

.table--tickets .table__row--child .table__title-inner {
    margin-left: 1.15rem;
    padding-left: 0.7rem;
    border-left: 2px solid rgba(0, 212, 255, 0.28);
}

@media (max-width: 720px) {
    .ticket-subtask-grid {
        grid-template-columns: 1fr;
    }
}

.table-user-estimates {
    display: inline-flex;
    align-items: center;
    flex-direction: column;
    gap: 0.35rem;
}

.table-user-estimate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    max-width: 100%;
}

.table-user-estimate__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-user-estimate__hours {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 2.7rem;
    padding: 0.16rem 0.42rem;
    color: #67e8f9;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    background: rgba(0, 212, 255, 0.09);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 999px;
}

.table-user-estimate__hours.is-empty {
    min-width: 2.5rem;
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.05);
    border-color: rgba(148, 163, 184, 0.13);
}

.table__actions { display: flex; gap: 0.35rem; white-space: nowrap; }

.link,
button.link {
    color: var(--neon);
    font-weight: 500;
}

button.link:hover {
    color: #66e5ff;
}

.badge--sm {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--badge-color, var(--neon)) 20%, transparent);
    color: var(--badge-color, var(--neon));
    border: 1px solid color-mix(in srgb, var(--badge-color, var(--neon)) 40%, transparent);
}

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert ul { margin: 0; padding-left: 1.2rem; }

.alert--success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert--error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid var(--danger);
    color: #fca5a5;
}

/* Ticket layout */
.ticket-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1rem;
    align-items: start;
}

.ticket-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ticket-update-form {
    margin: 0;
}

.ticket-card {
    padding: 0;
    margin-bottom: 0;
    overflow: visible;
}

.ticket-card > .ticket-update-form,
.ticket-card > .ticket-view {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.ticket-view__body {
    line-height: 1.6;
}

.ticket-view__body.rich-content a {
    color: var(--neon);
}

.ticket-card__section {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.ticket-card__section:last-child {
    border-bottom: none;
}

.ticket-card__title {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--neon);
}

.ticket-main .card.ticket-comments {
    margin-bottom: 0;
}

.ticket-save {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 0.25rem 0 0.5rem;
}

.ticket-side { position: sticky; top: 5rem; }

.ticket-status-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ticket-status-form__btn {
    align-self: flex-start;
}

.info-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
    font-size: 0.875rem;
}

.info-list dt { color: var(--text-muted); margin: 0; }
.info-list dd { margin: 0; }

.history {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.history__item {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.history__time { color: var(--text-muted); font-size: 0.75rem; }
.history__user { color: var(--neon); font-weight: 500; }
.history__text { margin-top: 0.15rem; }

.attachment, .link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.link-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.link-form .ui-dropdown,
.link-form .ui-dropdown--search { flex: 1; min-width: 0; }

.inline-form { display: inline; }

/* Pagination */
.pagination-wrap { margin-top: 1rem; }

.list-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

.list-pager__label {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.list-pager__options {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.list-pager__opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.15rem;
    padding: 0 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(7, 12, 24, 0.55);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
    line-height: 1;
}

.list-pager__opt:hover {
    color: var(--neon);
    border-color: color-mix(in srgb, var(--neon) 55%, var(--border));
}

.list-pager__opt.is-active {
    color: #041018;
    background: var(--neon);
    border-color: var(--neon);
}

.list-pager__meta {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.list-pager__nav .pagination {
    margin: 0;
}

.list-pager__nav .pagination-wrap {
    margin: 0;
}

.pagination { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pagination__item.is-active {
    background: var(--neon);
    color: #041018;
    border-color: var(--neon);
}

.pagination__item.is-disabled { opacity: 0.4; pointer-events: none; }

/* TinyMCE dark override */
.tox-tinymce { border-color: var(--border) !important; border-radius: var(--radius) !important; }
.tox .tox-edit-area__iframe { background: var(--bg-input) !important; }

/* Responsive */
@media (max-width: 900px) {
    .ticket-grid { grid-template-columns: 1fr; }
    .ticket-side { position: static; }
    .main__body { padding: 1rem 1.25rem 2rem; }
    .page-head { padding: 1rem 1.25rem; }
    .page-header__main {
        flex-wrap: wrap;
    }
    .page-header--ticket .page-header__actions {
        width: 100%;
        max-width: none;
        justify-content: flex-start;
        padding-top: 0;
    }
}

@media (max-width: 1280px) {
    .table--tickets .table__col-creator,
    .table--tickets .table__col-date {
        display: none !important;
    }

    .table--tickets th:nth-child(2),
    .table--tickets td.table__col-title,
    .table--tickets .table__col-title {
        display: table-cell;
        width: 34%;
        min-width: 12rem;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        word-break: break-word;
    }
}

@media (max-width: 768px) {
    .topbar { display: flex; }
    .burger { display: flex; }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 260px !important;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    }

    .sidebar.is-collapsed {
        width: 260px !important;
    }

    .sidebar.is-collapsed .logo__full,
    .sidebar.is-collapsed .sidebar__label,
    .sidebar.is-collapsed .sidebar__user-role,
    .sidebar.is-collapsed .sidebar__section {
        display: initial;
    }

    .sidebar.is-collapsed .sidebar__section {
        display: block;
    }

    .sidebar.is-collapsed .logo__short,
    .sidebar.is-collapsed .sidebar__logout-icon {
        display: none;
    }

    .sidebar.is-collapsed .sidebar__link {
        justify-content: flex-start;
        padding: 0.7rem 0.85rem;
        gap: 0.75rem;
    }

    .sidebar.is-collapsed .sidebar__link.is-active,
    .sidebar.is-collapsed .sidebar__link:hover {
        box-shadow: inset 3px 0 0 var(--neon);
    }

    .sidebar.is-collapsed .sidebar__head {
        justify-content: space-between;
        padding: 0 0.75rem 0 1.25rem;
        flex-wrap: nowrap;
    }

    .sidebar.is-collapsed .sidebar__collapse {
        display: none;
    }

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

    .sidebar-overlay.is-visible { display: block; }

    .table th, .table td { padding: 0.5rem 0.65rem; font-size: 0.8rem; }

    .table--tickets .table__col-creator,
    .table--tickets .table__col-date {
        display: none;
    }

    .table--tickets .table__col-title,
    .table--tickets th.table__col-title,
    .table--tickets td.table__col-title {
        display: table-cell;
        width: 32%;
        min-width: 10rem;
        max-width: none;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        word-break: break-word;
    }

    .ticket-basics { grid-template-columns: 1fr; align-items: stretch; }
    .page-header:not(.page-header--ticket) { flex-direction: column; align-items: stretch; }
    .page-header--ticket .page-header__actions { width: 100%; max-width: none; justify-content: flex-start; }
    .dashboard-head { grid-template-columns: 1fr; }
    .dashboard-dates {
        width: 100%;
        justify-self: stretch;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-dates .form__input--date {
        width: 100%;
        max-width: none;
    }
    .widgets--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analytics-head { grid-template-columns: 1fr; }
    .analytics-grid { grid-template-columns: 1fr; }
    .filters__row { flex-wrap: wrap; }
    .filters__search { flex: 1 1 100%; }
    .filters__row > .form__group { flex: 1 1 calc(50% - 0.375rem); }
    .filters__actions {
        flex: 1 1 100%;
        margin-left: 0;
        justify-content: flex-end;
    }
    .list-pager {
        align-items: flex-start;
    }
    .list-pager__nav {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .widgets--compact { grid-template-columns: 1fr; }
    .dashboard-widgets { grid-template-columns: 1fr; }
    .dashboard-dates { grid-template-columns: 1fr; }
    .filters__row > .form__group { flex: 1 1 100%; }
    .filters__actions { justify-content: stretch; }
    .filters__actions .btn { flex: 1; }
}
