/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --color-bg: #f1f5f9;
    --color-surface: #ffffff;
    --color-surface-muted: #f8fafc;
    --color-border: #e2e8f0;
    --color-border-strong: #cbd5e1;

    --color-text: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;

    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-soft: #eef2ff;

    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-danger-soft: #fef2f2;

    --color-success: #10b981;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 999px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);

    --sidebar-width: 280px;
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-hover);
}

img {
    display: block;
    max-width: 100%;
}

h1, h2, h3, h4, p {
    margin: 0;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

.text-muted {
    color: var(--color-text-muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================================================
   App layout
   ========================================================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--color-border);
}

.sidebar__brand-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-radius: var(--radius-md);
    font-size: 18px;
}

.sidebar__brand-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.sidebar__brand-sub {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 400;
}

.sidebar__section {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.sidebar__title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.sidebar__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
}

/* Main content */
.main {
    flex: 1;
    min-width: 0;
    padding: 32px 40px 48px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 4px;
}

.page-header__subtitle {
    font-size: 15px;
    color: var(--color-text-secondary);
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

/* Panel cards (sections) */
.panel-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    animation: fadeInUp 0.4s ease backwards;
}

.panel-card:nth-child(2) { animation-delay: 0.05s; }
.panel-card:nth-child(3) { animation-delay: 0.1s; }

.panel-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.panel-card__header--between {
    justify-content: space-between;
}

.panel-card__icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 15px;
}

.panel-card__title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.panel-card__desc {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   Category tree
   ========================================================================== */

.category-tree {
    margin-top: 16px;
}

.category-tree ul {
    padding-left: 16px;
    margin-top: 2px;
}

.category-tree > li {
    margin-bottom: 2px;
}

.cat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.cat-row:hover {
    background: var(--color-surface-muted);
}

.cat-row:hover .cat-actions {
    opacity: 1;
}

.toggle {
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    border-radius: 4px;
    flex-shrink: 0;
    transition: transform var(--transition), color var(--transition);
}

.toggle:hover {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}

.toggle i {
    font-size: 10px;
    transition: transform var(--transition);
}

.toggle.is-open i {
    transform: rotate(90deg);
}

.toggle-empty {
    width: 20px;
    flex-shrink: 0;
}

.cat-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.cat-name:hover {
    color: var(--color-primary);
}

.cat-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition);
}

/* ==========================================================================
   Document grid
   ========================================================================== */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.doc-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    animation: fadeInUp 0.35s ease backwards;
}

.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-strong);
}

.doc-card__thumb {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--color-surface-muted);
}

.doc-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.doc-card:hover .doc-card__thumb img {
    transform: scale(1.03);
}

.pdf-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--color-text-muted);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.pdf-placeholder i {
    font-size: 32px;
    color: #ef4444;
    opacity: 0.8;
}

.pdf-placeholder span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.doc-card__body {
    padding: 14px 16px 12px;
}

.doc-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-card__desc {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-card__price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.doc-card__actions {
    display: flex;
    gap: 6px;
    padding: 0 12px 12px;
    border-top: 1px solid var(--color-border);
    padding-top: 10px;
    margin: 0 12px 12px;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form--compact .form-group {
    margin-bottom: 12px;
}

input,
textarea,
select {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--color-border-strong);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

textarea {
    min-height: 88px;
    resize: vertical;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

input[type="file"] {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    margin-right: 12px;
    cursor: pointer;
    transition: background var(--transition);
}

input[type="file"]::file-selector-button:hover {
    background: #e0e7ff;
}

/* Search field */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 14px;
    pointer-events: none;
}

.search-box input {
    padding-left: 40px;
    padding-right: 16px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    border-color: transparent;
}

.search-box input:focus {
    background: var(--color-surface);
    border-color: var(--color-primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-xs);
}

.btn--primary:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-sm);
}

.btn--secondary {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn--secondary:hover {
    background: var(--color-surface-muted);
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.btn--ghost {
    width: 100%;
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn--ghost:hover {
    background: var(--color-danger-soft);
    border-color: #fecaca;
    color: var(--color-danger);
}

.btn--sm {
    padding: 8px 12px;
    font-size: 13px;
}

.btn--block {
    width: 100%;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.icon-btn:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.icon-btn--danger:hover {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* ==========================================================================
   Progress bar
   ========================================================================== */

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 16px;
}

.progress-bar__fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--color-primary), #818cf8);
    border-radius: var(--radius-full);
    transition: width 0.2s ease;
}

/* ==========================================================================
   Data table (shops list)
   ========================================================================== */

.data-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--color-surface-muted);
}

.data-table__actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.modal-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 20px 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

/* ==========================================================================
   Modal
   ========================================================================== */

#modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
    overflow-y: auto;
}

#modal.is-open {
    opacity: 1;
    visibility: visible;
}


/* ==========================================================================
   Login page
   ========================================================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    animation: fadeInUp 0.5s ease;
}

.auth-card__brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-card__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-radius: var(--radius-md);
    font-size: 24px;
}

.auth-card h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-card__subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.auth-card .btn--block {
    margin-top: 8px;
}

.auth-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .main {
        padding: 24px 28px 40px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        max-height: none;
    }

    .sidebar__section {
        max-height: 280px;
    }

    .main {
        padding: 20px 16px 32px;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header__actions {
        width: 100%;
    }

    .page-header__actions .btn {
        flex: 1;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .cat-actions {
        opacity: 1;
    }

    #modal {
        padding: 24px 12px;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .panel-card {
        padding: 18px;
    }

    .doc-card__body {
        padding: 10px 12px 8px;
    }

    .doc-card__title {
        font-size: 13px;
    }
}

/* ==========================================================================
   DMS extensions
   ========================================================================== */

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; display: flex; gap: 8px; align-items: center; }
.alert--error { background: var(--color-danger-soft); color: var(--color-danger); }

.type-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.type-tab { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-secondary); padding: 8px 16px; border-radius: var(--radius-full); cursor: pointer; font-size: 13px; font-weight: 500; transition: all var(--transition); }
.type-tab.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

.dropzone { position: relative; border: 2px dashed var(--color-border-strong); border-radius: var(--radius-md); padding: 28px; text-align: center; background: var(--color-surface-muted); transition: border-color var(--transition), background var(--transition); margin-bottom: 20px; }
.dropzone.is-dragover { border-color: var(--color-primary); background: var(--color-primary-soft); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone__content i { font-size: 32px; color: var(--color-primary); margin-bottom: 8px; }
.dropzone__content p { margin: 0; color: var(--color-text-secondary); }
.dropzone__content span { color: var(--color-primary); font-weight: 600; }
.dropzone__files { margin-top: 12px; text-align: left; font-size: 12px; color: var(--color-text-muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group--full { grid-column: 1 / -1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--color-text-muted); }
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }

.doc-card__badge { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.92); padding: 3px 8px; border-radius: var(--radius-full); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.doc-card__thumb { border: none; padding: 0; width: 100%; cursor: pointer; position: relative; display: block; }
.doc-card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.doc-card__tag { font-size: 11px; color: var(--color-text-muted); }

.cat-row.is-active { background: var(--color-primary-soft); }
.cat-row.is-active .cat-name { color: var(--color-primary); font-weight: 600; }

.modal, #modal { display: flex; position: fixed; inset: 0; z-index: 1000; align-items: flex-start; justify-content: center; padding: 48px 16px; background: rgba(15,23,42,.45); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity var(--transition-slow), visibility var(--transition-slow); overflow-y: auto; }
.modal.is-open, #modal.is-open { opacity: 1; visibility: visible; }
.modal__dialog { width: 100%; max-width: 480px; background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 28px; transform: translateY(16px) scale(.98); transition: transform var(--transition-slow); position: relative; }
.modal.is-open .modal__dialog { transform: translateY(0) scale(1); }
.modal__dialog--wide { max-width: 960px; }
.modal__close { position: absolute; top: 12px; right: 12px; border: none; background: var(--color-surface-muted); width: 32px; height: 32px; border-radius: var(--radius-sm); cursor: pointer; color: var(--color-text-muted); }

.modal--preview .preview-toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.preview-stage { min-height: 400px; max-height: 75vh; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #0f172a; border-radius: var(--radius-md); }
.preview-stage img { max-width: 100%; max-height: 75vh; transition: transform .18s cubic-bezier(.2,.8,.2,1); transform-origin: center center; cursor: zoom-in; user-select: none; }
.preview-stage iframe { width: 100%; height: 75vh; border: none; }

.collapsible-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows .3s ease, opacity .25s ease;
}

.collapsible-panel__inner {
    overflow: hidden;
    min-height: 0;
}

.collapsible-panel.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
}

#toggleUploadFormBtn .fa-solid {
    transition: transform .2s ease;
}

#toggleUploadFormBtn[aria-expanded="true"] .fa-solid {
    transform: rotate(180deg);
}

.toast { position: fixed; bottom: 24px; right: 24px; background: var(--color-text); color: #fff; padding: 12px 18px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px); transition: all var(--transition); z-index: 2000; pointer-events: none; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast--error { background: var(--color-danger); }

@media (max-width: 768px) {
    .form-grid, .form-row { grid-template-columns: 1fr; }
    .sidebar.is-collapsed { display: none; }
}
