/* ══════════════════════════════════════════════
   Admin Sidebar — shell, backdrop, layout
   Formulářové prvky → viz components.css 
   ══════════════════════════════════════════════ */

/* ── Backdrop ── */
.admin-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: color-mix(in srgb, var(--t-footer-bg) 80%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.admin-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Sidebar Shell ── */
.admin-sidebar {
    position: fixed;
    inset: 0;
    z-index: 201;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

@media (min-width: 768px) {
    .admin-sidebar {
        left: auto;
        width: 100%;
        max-width: 42rem;
    }
}

.admin-sidebar.active {
    transform: translateX(0);
}

/* ── Sidebar Inner ── */
.admin-sidebar__inner {
    height: 100%;
    background: var(--t-sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    overscroll-behavior: none;
    position: relative;
}

.admin-sidebar__inner::-webkit-scrollbar {
    display: none;
}

@media (min-width: 768px) {
    .admin-sidebar__inner {
        border-left: 1px solid var(--t-header-border);
    }
}

/* ── Sidebar Header ── */
.sidebar-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .sidebar-header {
        padding: 0.75rem 1.25rem;
    }
}

.sidebar-header__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.sidebar-header__icon {
    color: var(--t-accent);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.sidebar-header__title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--t-text-strong);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Sidebar Content ── */
.sidebar-content {
    flex: 1;
    padding: 1rem;
    overflow-x: hidden;
    container-type: inline-size;
    container-name: sidebar;
}

@media (min-width: 768px) {
    .sidebar-content {
        padding: 1.25rem;
    }
}

/* ── Section title ── */
.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--t-footer-text);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.75rem;
}

/* ── Sidebar Stats (hidden) ── */
.admin-stats {
    display: none;
}

/* ── Param Grid ── */
.param-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* Disabled param — per-model capabilities */
.param-disabled {
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
}

/* ── Sidebar Top Sections — Responsive Grid ── */
.sidebar-top-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    transition: grid-template-columns 0.3s ease;
}

.sidebar-top-sections>section {
    min-width: 0;
}

/* 2 columns: Generator | LLM Settings, Usage Stats full-width below */
@container sidebar (min-width: 500px) {
    .sidebar-top-sections {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar-top-sections>#usage-section {
        grid-column: 1 / -1;
    }
}

/* 3 columns: Generator | LLM Settings | Usage Stats */
@container sidebar (min-width: 800px) {
    .sidebar-top-sections {
        grid-template-columns: repeat(3, 1fr);
    }

    .sidebar-top-sections>#usage-section {
        grid-column: auto;
    }
}

/* ── Button Row ── */
.btn-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* ── Form Stack ── */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Multi URL List ── */
.multi-url-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ── Sidebar resize handle ── */
.sidebar-resize-handle {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0.375rem;
    cursor: col-resize;
    align-items: center;
    z-index: 10;
}

@media (min-width: 768px) {
    .sidebar-resize-handle {
        display: flex;
    }
}

.sidebar-resize-handle__bar {
    width: 100%;
    height: 4rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--t-input-border) 50%, transparent);
    transition: background 0.2s;
}

.sidebar-resize-handle:hover .sidebar-resize-handle__bar {
    background: color-mix(in srgb, var(--t-accent) 50%, transparent);
}

.sidebar-resize-handle:active .sidebar-resize-handle__bar {
    background: color-mix(in srgb, var(--t-accent) 80%, transparent);
}

/* ── Spacing + Flex Row utilities → viz utilities/layout.css ── */

/* ── Console Box ── */
.console-box {
    background: var(--t-input-bg);
    border: 1px solid var(--t-input-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    overflow-y: auto;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.console-box::-webkit-scrollbar {
    display: none;
}

.console-box--sm {
    height: 10rem;
}

.console-box--md {
    height: 16rem;
}

.console-box--lg {
    height: 20rem;
}

/* ── Files List ── */
.files-list {
    background: var(--t-input-bg);
    border: 1px solid var(--t-input-border);
    border-radius: 0.5rem;
    overflow: hidden;
    max-height: 480px;
    overflow-y: auto;
    scrollbar-width: none;
}

.files-list::-webkit-scrollbar {
    display: none;
}

/* ── JSON Preview ── */
.json-preview {
    background: var(--t-input-bg);
    border: 1px solid var(--t-input-border);
    border-radius: 0.25rem;
    padding: 0.75rem;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(74, 222, 128, 0.8);
    overflow-x: auto;
    overflow-y: auto;
    max-height: 20rem;
    scrollbar-width: none;
    white-space: pre-wrap;
}

.json-preview::-webkit-scrollbar {
    display: none;
}

/* ── Info Panel ── */
.info-panel {
    background: var(--t-input-bg);
    border: 1px solid var(--t-input-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ── Action Buttons Row ── */
.action-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Resize Handle ── */
.sidebar-resize-handle {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    align-items: center;
    z-index: 10;
}

@media (min-width: 768px) {
    .sidebar-resize-handle {
        display: flex;
    }
}

.sidebar-resize-handle__bar {
    width: 100%;
    height: 4rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--t-input-border) 50%, transparent);
    transition: background 0.2s;
}

.sidebar-resize-handle:hover .sidebar-resize-handle__bar,
.sidebar-resize-handle:active .sidebar-resize-handle__bar {
    background: color-mix(in srgb, var(--t-accent) 50%, transparent);
}

/* ── Checkbox ── */
.checkbox-accent {
    accent-color: #ef4444;
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
}

/* ── Small action button (inline) ── */
.btn-action-inline {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    transition: color 0.15s;
    cursor: pointer;
    background: none;
    border: none;
}

.btn-action-inline--orange {
    color: #ea580c;
}

.btn-action-inline--orange:hover {
    color: #fb923c;
}

.btn-action-inline--cyan {
    color: #0891b2;
}

.btn-action-inline--cyan:hover {
    color: #22d3ee;
}

.btn-action-inline--muted {
    color: var(--t-text-muted);
}

.btn-action-inline--muted:hover {
    color: var(--t-text);
}

.btn-action-inline--accent {
    color: var(--t-footer-text);
}

.btn-action-inline--accent:hover {
    color: var(--t-btn-active-text);
}

.btn-action-inline:disabled {
    opacity: 0.5;
}

/* ── Free badge ── */
.badge-free {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: #4ade80;
}

/* ── Usage period tabs ── */
.usage-tab {
    flex: 1;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.25rem;
    border: 1px solid;
    border-radius: 0.25rem;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
    cursor: pointer;
    background: transparent;
}

.usage-tab--active {
    background: var(--t-btn-active-bg);
    border-color: var(--t-btn-active-border);
    color: var(--t-btn-active-text);
}

.usage-tab--inactive {
    border-color: var(--t-btn-inactive-border);
    color: var(--t-text-muted);
}

/* ── Filter label checkbox ── */
.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--t-input-bg);
    border: 1px solid var(--t-input-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── File Row ── */
.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid color-mix(in srgb, var(--t-input-border) 50%, transparent);
    cursor: pointer;
    transition: background 0.15s;
}

.file-row:hover {
    background: var(--t-card-bg);
}

.file-row:active {
    background: color-mix(in srgb, var(--t-btn-inactive-bg) 50%, transparent);
}

.file-row--selected {
    background: var(--t-accent-muted);
}

.file-row__info {
    flex: 1;
    min-width: 0;
    margin-right: 0.5rem;
}

.file-row__title {
    font-size: 0.875rem;
    color: var(--t-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.125rem;
}

.file-row__date,
.file-row__size {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--t-text-muted);
}

.file-row__date {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row__sev {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

.file-row__size {
    flex-shrink: 0;
}

.file-row__actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

@media (min-width: 768px) {
    .file-row__actions {
        opacity: 0;
    }

    .file-row:hover .file-row__actions {
        opacity: 1;
    }
}

.file-row__btn {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t-text-muted);
    transition: color 0.15s;
    background: none;
    border: none;
    cursor: pointer;
}

@media (min-width: 768px) {
    .file-row__btn {
        width: 1.75rem;
        height: 1.75rem;
    }
}

.file-row__btn--view:hover {
    color: #22d3ee;
}

.file-row__btn--view:active {
    color: #67e8f9;
}

.file-row__btn--raw:hover {
    color: #fbbf24;
}

.file-row__btn--raw:active {
    color: #fcd34d;
}

.file-row__btn--delete:hover {
    color: var(--t-btn-active-text);
}

.file-row__btn--delete:active {
    color: #fca5a5;
}

.file-row__select {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t-placeholder);
    transition: color 0.15s;
    background: none;
    border: none;
    cursor: pointer;
}

.file-row__select--active {
    color: var(--t-btn-active-text);
}

.select-checkbox-wrap {
    display: flex;
    align-items: center;
    padding-right: 0.5rem;
    flex-shrink: 0;
}

/* ── File toggle ── */
.file-toggle--active {
    color: var(--t-btn-active-text);
    border-color: var(--t-submit-border);
    background: var(--t-accent-muted);
}

.file-toggle--inactive {
    color: var(--t-text-muted);
    border-color: var(--t-input-border);
}

/* ── Admin Stats ── */
.admin-stats__label {
    color: var(--t-text-muted);
}

.admin-stats__value {
    color: var(--t-text-strong);
}

.admin-stats__sep {
    color: var(--t-placeholder);
}

/* ── Files list empty ── */
.files-list__empty {
    padding: 2rem 0;
    text-align: center;
    color: var(--t-text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

/* ── Usage Stats ── */
.usage-empty {
    color: var(--t-placeholder);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}

.usage-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.usage-card {
    background: var(--t-input-bg);
    border: 1px solid var(--t-input-border);
    border-radius: 0.5rem;
    padding: 0.625rem;
    text-align: center;
}

.usage-card__label {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--t-text-muted);
    margin-bottom: 0.125rem;
}

.usage-card__value {
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--t-text-strong);
}

.usage-card__value--muted {
    color: var(--t-text-muted);
}

.usage-breakdown {
    background: var(--t-input-bg);
    border: 1px solid var(--t-input-border);
    border-radius: 0.5rem;
    padding: 0.625rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.usage-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
}

.usage-stat-row__label {
    color: var(--t-text-muted);
}

.usage-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.usage-section__title {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--t-text-muted);
    margin-bottom: 0.25rem;
}

.usage-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--t-input-bg);
    border: 1px solid var(--t-input-border);
    border-radius: 0.25rem;
    padding: 0.375rem 0.625rem;
}

.usage-breakdown-row__name {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--t-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.usage-breakdown-row__values {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.usage-breakdown-row__count {
    color: var(--t-text-muted);
}

/* ── Reset button ── */
.usage-reset-btn {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--t-text-muted);
    background: none;
    border: 1px solid var(--t-input-border);
    border-radius: 0.25rem;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.usage-reset-btn:hover {
    color: #ef4444;
    border-color: #ef4444;
}

/* ── Console entry ── */
.console-entry {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.75;
}

/* ── Console resize handle ── */
.console-resize-handle {
    width: 100%;
    height: 0.75rem;
    cursor: row-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.25rem;
}

.console-resize-handle__bar {
    width: 3rem;
    height: 0.25rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--t-input-border) 50%, transparent);
    transition: background 0.2s;
}

.console-resize-handle:hover .console-resize-handle__bar {
    background: color-mix(in srgb, var(--t-accent) 50%, transparent);
}

.console-resize-handle:active .console-resize-handle__bar {
    background: color-mix(in srgb, var(--t-accent) 80%, transparent);
}

/* ── Copy toast ── */
.copy-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 83, 45, 0.9);
    color: #bbf7d0;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
    z-index: 300;
    transition: opacity 0.3s;
}

/* ── Grid empty state ── */
.grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 0;
}

.grid-empty__text {
    font-family: 'JetBrains Mono', monospace;
    color: var(--t-footer-text);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}