/*
 * ═══════════════════════════════════════════════════════════════════
 *  PILOTO PAINEL — ESTILOS PRINCIPAIS v2.0
 *  Usa tokens de ds-tokens.css + base de ds-base.css
 * ═══════════════════════════════════════════════════════════════════
 */

/* Aliases de compatibilidade retroativa → novos tokens */
:root {
    /* Layout */
    --sidebar-w:    var(--sidebar-width);
    --topbar-h:     var(--topbar-height);
    --ease:         var(--dur-normal) var(--ease-smooth);

    /* Cores legadas → novo sistema */
    --bg:            var(--bg-base);
    --bg-elevated:   var(--bg-elevated);
    --surface:       var(--surface-glass);
    --surface-strong: var(--surface-glass-md);
    --surface-soft:  var(--surface-frosted);
    --surface-2:     var(--bg-raised);
    --surface-3:     var(--bg-elevated);

    /* Bordas legadas */
    --line:         var(--border);
    --line-strong:  var(--border-medium);
    --line-glow:    var(--border-glow);

    /* Texto legado */
    --text:         var(--text-primary);
    --text-muted:   var(--text-secondary);
    --text-soft:    var(--text-muted);

    /* Accent legado → novo accent azul Piloto */
    --accent:        var(--accent);
    --accent-strong: var(--accent-muted);
    --accent-soft:   var(--accent-soft);
    --accent-glow:   var(--accent-glow);

    /* Feedback legado */
    --success:       var(--success);
    --success-soft:  var(--success-soft);
    --warning:       var(--warning);
    --warning-soft:  var(--warning-soft);
    --danger:        var(--danger);
    --danger-strong: var(--danger-light);
    --danger-soft:   var(--danger-soft);

    /* Sombras legadas */
    --shadow-lg:    var(--shadow-lg);
    --shadow-md:    var(--shadow-md);
    --shadow-sm:    var(--shadow-sm);

    /* Radius legados */
    --radius-xl:    var(--radius-2xl);
    --radius-lg:    var(--radius-xl);
    --radius-md:    var(--radius-lg);
    --radius-sm:    var(--radius-md);
}

/* ─── Reset já feito em ds-base.css — mantemos apenas overrides do painel ─── */

body {
    /* ds-base.css já define o background via var(--gradient-bg) */
    /* Aqui refinamos o fundo para a identidade Piloto azul-marinho */
    background:
        radial-gradient(ellipse 80% 50% at 10% -5%, rgba(33, 48, 112, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 85% 8%,  rgba(79, 124, 255, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse 120% 50% at 50% 110%, rgba(9, 13, 26, 0.95) 0%, transparent 100%),
        #0b0f1a;
}

/* Grid sutil de fundo — identidade visual premium */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--border-light) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
    background-size: 52px 52px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}


/* ─── Layout, sidebar, topbar, content → ds-layout.css ─── */
/* Aliases de compatibilidade com templates que usam classes antigas */

/* sidebar-nav → .sidebar__nav */
.sidebar-nav { }
/* topbar-breadcrumb → .topbar__breadcrumb */
.topbar-breadcrumb { }
/* old .content already mapped to ds-layout */

/* ─── Layout global → ds-layout.css ─── */



.toolbar {
    padding: 22px 24px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(16, 28, 47, 0.86), rgba(11, 20, 36, 0.84));
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.toolbar-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.toolbar-kicker {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 800;
}

.page-title,
.toolbar-title {
    margin: 0;
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.7rem, 1.2rem + 1vw, 2.2rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.page-subtitle,
.toolbar-subtitle {
    margin: 0;
    max-width: 760px;
    color: var(--text-muted);
    font-size: 0.96rem;
}

.card,
.panel-card,
.stat-card {
    position: relative;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(16, 28, 47, 0.86), rgba(11, 20, 36, 0.88));
    box-shadow: var(--shadow-sm);
}

.card,
.panel-card {
    padding: 24px;
}

.card + .card,
.panel-card + .panel-card {
    margin-top: 16px;
}

.card-title {
    margin: 0 0 18px;
    font-family: 'Sora', sans-serif;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.panel-card-header,
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.section-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-title {
    margin: 0;
    font-family: 'Sora', sans-serif;
    font-size: 1.18rem;
    letter-spacing: -0.02em;
}

.section-copy {
    margin: 0;
    color: var(--text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    overflow: hidden;
    padding: 20px;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(103, 212, 255, 0.22), rgba(51, 168, 255, 0.85));
}

.stat-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 800;
}

.stat-value {
    margin-top: 12px;
    font-family: 'Sora', sans-serif;
    font-size: 2.45rem;
    line-height: 1;
    letter-spacing: -0.05em;
}

.stat-meta {
    margin-top: 12px;
    color: var(--text-soft);
    font-size: 0.84rem;
}

.list-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.summary-chip,
.badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill::before,
.badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
}

.badge-published,
.badge-active {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(143, 244, 201, 0.16);
}

.badge-draft,
.badge-inactive {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
}

.badge-featured {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: rgba(255, 211, 122, 0.18);
}

.table-wrapper {
    overflow: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(16, 28, 47, 0.9), rgba(11, 20, 36, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 16px 18px;
    text-align: left;
    background: rgba(255, 255, 255, 0.028);
    border-bottom: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

tbody td {
    padding: 18px;
    border-bottom: 1px solid rgba(153, 193, 255, 0.08);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--ease), transform var(--ease), opacity var(--ease);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.024);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr.is-removing {
    opacity: 0;
    transform: scale(0.985);
}

.table-wrapper td input[type="number"] {
    max-width: 88px;
}

.table-title-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.table-title-cell a {
    color: var(--text);
    font-weight: 700;
}

.table-title-cell a:hover {
    color: var(--accent);
}

.table-meta {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.td-thumb {
    width: 72px;
}

.td-thumb img,
.td-thumb .no-img {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    object-fit: cover;
}

.td-thumb img {
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.td-thumb .no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px dashed rgba(255, 255, 255, 0.08);
}

.td-actions {
    text-align: right;
}

.table-action-group,
.td-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-family: 'Manrope', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition:
        transform var(--ease),
        background var(--ease),
        border-color var(--ease),
        color var(--ease),
        box-shadow var(--ease),
        opacity var(--ease);
}

.btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(103, 212, 255, 0.8);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.btn.is-busy {
    pointer-events: none;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.24);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.btn-primary {
    color: #03101d;
    background: linear-gradient(135deg, var(--accent) 0%, #b3eeff 100%);
    box-shadow: 0 16px 28px rgba(55, 174, 255, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 18px 32px rgba(55, 174, 255, 0.26);
}

.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover,
.btn-icon:hover {
    background: rgba(103, 212, 255, 0.1);
    border-color: rgba(103, 212, 255, 0.16);
}

.btn-danger {
    color: var(--danger);
    background: rgba(255, 102, 110, 0.08);
    border-color: rgba(255, 102, 110, 0.16);
}

.btn-danger:hover {
    background: rgba(255, 102, 110, 0.14);
    border-color: rgba(255, 102, 110, 0.24);
}

.btn-ghost,
.btn-icon {
    color: var(--text-muted);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
}

.btn-sm {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 0.84rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.filters .field-grow {
    flex: 1 1 260px;
}

label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid.single {
    grid-template-columns: 1fr;
}

.form-grid.thirds {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 360px);
    gap: 20px;
    align-items: start;
}

.editor-main,
.editor-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-card {
    padding: 24px;
}

.form-card .card-title {
    margin-bottom: 16px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(4, 12, 22, 0.78);
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    font-size: 0.95rem;
    transition: border-color var(--ease), background var(--ease), box-shadow var(--ease), transform var(--ease);
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 2px),
        calc(100% - 14px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

textarea {
    min-height: 120px;
    padding: 14px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: rgba(220, 231, 255, 0.38);
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--line-glow);
    box-shadow: 0 0 0 4px rgba(103, 212, 255, 0.08);
    background: rgba(8, 16, 29, 0.94);
}

.form-hint,
small,
.text-small {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color var(--ease), background var(--ease), transform var(--ease);
}

.checkbox-row:hover {
    border-color: rgba(103, 212, 255, 0.14);
    background: rgba(103, 212, 255, 0.08);
    transform: translateY(-1px);
}

.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-strong);
}

.checkbox-row span {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle input {
    display: none;
}

.toggle-track {
    position: relative;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(243, 247, 255, 0.78);
    box-shadow: 0 8px 14px rgba(2, 8, 20, 0.22);
    transition: transform var(--ease), background var(--ease);
}

.toggle input:checked + .toggle-track {
    background: rgba(103, 212, 255, 0.18);
    border-color: rgba(103, 212, 255, 0.28);
    box-shadow: inset 0 0 0 1px rgba(103, 212, 255, 0.08);
}

.toggle input:checked + .toggle-track::after {
    transform: translateX(20px);
    background: linear-gradient(135deg, #ffffff, #9debff);
}

.media-uploader,
.upload-area {
    padding: 16px;
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.media-uploader.has-media,
.upload-area.has-media {
    border-style: solid;
    border-color: rgba(103, 212, 255, 0.14);
}

.upload-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upload-preview img,
.media-preview {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
}

.no-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 188px;
    width: 100%;
    padding: 20px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top left, rgba(103, 212, 255, 0.08), transparent 54%),
        rgba(4, 12, 22, 0.5);
    color: var(--text-soft);
    text-align: center;
    font-size: 0.88rem;
}

.upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 12px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    min-height: 96px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease), opacity var(--ease);
}

.gallery-item:hover {
    transform: translateY(-2px);
    border-color: rgba(103, 212, 255, 0.18);
    box-shadow: var(--shadow-sm);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    min-height: 96px;
    object-fit: cover;
    display: block;
}

.gallery-item .remove-img {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 999px;
    color: white;
    background: rgba(7, 17, 31, 0.72);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity var(--ease), transform var(--ease), background var(--ease);
}

.gallery-item:hover .remove-img {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item .remove-img:hover {
    background: rgba(255, 102, 110, 0.82);
}

.carousel-slide {
    min-height: 188px;
}

.slide-overlay {
    position: absolute;
    inset: auto 10px 10px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(7, 17, 31, 0.72);
    backdrop-filter: blur(10px);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-weight: 700;
    transition: transform var(--ease), border-color var(--ease), background var(--ease), color var(--ease);
}

.pagination a:hover {
    color: var(--text);
    background: rgba(103, 212, 255, 0.12);
    border-color: rgba(103, 212, 255, 0.16);
    transform: translateY(-1px);
}

.pagination span.current {
    color: #03101d;
    background: linear-gradient(135deg, var(--accent), #9ce9ff);
    border-color: transparent;
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 700;
}

.alert-success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(143, 244, 201, 0.16);
}

.alert-error {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(255, 102, 110, 0.18);
}

.alert-warning {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: rgba(255, 211, 122, 0.18);
}

.toast {
    position: fixed;
    right: 28px;
    bottom: 28px;
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    max-width: 360px;
    padding: 0 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 18, 33, 0.94);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity var(--ease), transform var(--ease);
    z-index: 120;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-color: rgba(143, 244, 201, 0.22);
}

.toast.error {
    border-color: rgba(255, 102, 110, 0.26);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(4, 9, 18, 0.74);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ease);
    z-index: 110;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    width: min(100%, 460px);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top left, rgba(103, 212, 255, 0.12), transparent 48%),
        linear-gradient(180deg, rgba(17, 31, 52, 0.98), rgba(10, 18, 32, 0.98));
    box-shadow: var(--shadow-lg);
}

.modal-eyebrow {
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.modal-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.modal-body {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.96rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px;
}

.login-box {
    width: min(100%, 440px);
    padding: 34px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top left, rgba(103, 212, 255, 0.18), transparent 44%),
        linear-gradient(180deg, rgba(16, 28, 47, 0.94), rgba(10, 18, 32, 0.96));
    box-shadow: var(--shadow-lg);
}

.login-logo {
    margin-bottom: 8px;
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.9rem, 1.4rem + 1vw, 2.6rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.login-box .form-group + .form-group {
    margin-top: 16px;
}

.login-box .btn-primary {
    width: 100%;
    margin-top: 22px;
}

.ql-toolbar.ql-snow {
    padding: 10px 12px;
    border-radius: 16px 16px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.04);
}

.ql-container.ql-snow {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-top: none !important;
    border-radius: 0 0 16px 16px;
    background: rgba(4, 12, 22, 0.8);
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    min-height: 320px;
}

.ql-editor.ql-blank::before {
    color: rgba(220, 231, 255, 0.36) !important;
}

.ql-snow .ql-stroke {
    stroke: var(--text-muted);
}

.ql-snow .ql-fill {
    fill: var(--text-muted);
}

.ql-snow .ql-picker {
    color: var(--text-muted);
}

.ql-snow .ql-picker-options {
    background: var(--surface-strong);
    border-color: rgba(255, 255, 255, 0.08);
}

.empty-state {
    padding: 48px 24px;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top left, rgba(103, 212, 255, 0.08), transparent 48%),
        rgba(255, 255, 255, 0.026);
    text-align: center;
}

.empty-state p {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 1rem;
}

.divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 20px 0;
}

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

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

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
}

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

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.mt-0 {
    margin-top: 0;
}

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sortable-ghost {
    opacity: 0.32;
}

.drag-handle {
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

    .editor-side {
        order: -1;
    }
}

@media (max-width: 980px) {
    :root {
        --sidebar-w: 100%;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        inset: auto;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .sidebar::before {
        inset: 16px 16px auto 16px;
        height: 112px;
    }

    .sidebar-nav {
        padding-bottom: 12px;
    }

    .main {
        margin-left: 0;
    }

    .topbar {
        padding: 18px 20px;
    }

    .content {
        padding: 22px 20px 28px;
    }

    .page-header,
    .toolbar {
        flex-direction: column;
    }

    .toolbar-actions,
    .page-header .flex,
    .page-header .toolbar-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .stats-grid,
    .form-grid,
    .form-grid.thirds {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .topbar-user {
        width: 100%;
        justify-content: space-between;
    }

    .btn,
    .pagination a,
    .pagination span {
        width: 100%;
    }

    .filters > * {
        width: 100%;
    }

    .table-action-group,
    .td-actions {
        justify-content: stretch;
    }

    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}
