/* ========================================
   HUMBOLDT EVENTS — COMPONENTS
   Buttons, cards, badges, forms, modals, tables
   ======================================== */

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: var(--text-sm);
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary { background: var(--accent); color: var(--text-inverse); }
.btn-primary:hover { box-shadow: var(--shadow-glow); }

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); }

.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 6px 12px;
}
.btn-ghost:hover { color: var(--accent); background: var(--accent-muted); }

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-muted); }

.btn-sm { padding: 6px 12px; font-size: var(--text-xs); }
.btn-lg { padding: 14px 28px; font-size: var(--text-lg); }
.btn-xl { padding: 18px 36px; font-size: var(--text-xl); }
.btn-icon { padding: 8px; min-width: 36px; min-height: 36px; }
.btn-block { width: 100%; }

.btn-group { display: inline-flex; gap: 0; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.active { background: var(--accent); color: var(--text-inverse); }

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}
.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}
.card-flat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}
.card-flat:hover { border-color: var(--border); box-shadow: none; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

/* ========================================
   EVENT CARDS
   ======================================== */

/* --- Grid variant --- */
.event-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.event-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.event-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-input);
}
.event-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.event-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    opacity: 0.3;
}
.event-card__image--placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.6;
}

.event-card__badges {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    right: var(--space-sm);
    display: flex;
    justify-content: space-between;
    z-index: 2;
}

.event-card__body {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    flex: 1;
}

.event-card__title {
    font-size: var(--text-base);
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-card__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.event-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.event-card__footer {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-light);
    margin-top: auto;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* --- List variant --- */
.event-card--list {
    flex-direction: row;
    align-items: center;
}
.event-card--list .event-card__image {
    width: 120px;
    min-width: 120px;
    aspect-ratio: 1;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.event-card--list .event-card__body { flex: 1; padding: var(--space-md); }
@media (max-width: 639px) {
    .event-card--list .event-card__image {
        width: 80px;
        min-width: 80px;
    }
}

/* --- Sponsored/Featured event card --- */
.event-card--sponsored {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    position: relative;
}
.event-card--sponsored::before {
    content: 'Sponsored';
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: var(--accent);
    color: var(--text-inverse);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    z-index: 3;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
}
.badge-free     { background: var(--accent-muted); color: var(--accent); }
.badge-price    { background: var(--accent-muted); color: var(--accent); }
.badge-age      { background: rgba(255,255,255,0.1); color: var(--text-muted); }
[data-theme="light"] .badge-age { background: rgba(0,0,0,0.06); }

.badge-pending  { background: rgba(255,183,77,0.2); color: var(--warning); }
.badge-approved { background: var(--accent-muted); color: var(--accent); }
.badge-rejected { background: rgba(248,113,113,0.2); color: var(--error); }
.badge-verified { background: var(--accent-muted); color: var(--accent); }
.badge-info     { background: rgba(96,165,250,0.2); color: var(--info); }

/* Category badges */
.badge-cat-music     { background: rgba(0,255,157,0.15); color: var(--cat-music); }
.badge-cat-comedy    { background: rgba(251,191,36,0.15); color: var(--cat-comedy); }
.badge-cat-theater   { background: rgba(192,132,252,0.15); color: var(--cat-theater); }
.badge-cat-festival  { background: rgba(251,146,60,0.15); color: var(--cat-festival); }
.badge-cat-sports    { background: rgba(56,189,248,0.15); color: var(--cat-sports); }
.badge-cat-community { background: rgba(167,139,250,0.15); color: var(--cat-community); }
.badge-cat-arts      { background: rgba(244,114,182,0.15); color: var(--cat-arts); }
.badge-cat-outdoor   { background: rgba(52,211,153,0.15); color: var(--cat-outdoor); }
.badge-cat-food      { background: rgba(251,113,133,0.15); color: var(--cat-food); }
.badge-cat-education { background: rgba(129,140,248,0.15); color: var(--cat-education); }
.badge-cat-government{ background: rgba(148,163,184,0.15); color: var(--cat-government); }
.badge-cat-market    { background: rgba(252,211,77,0.15); color: var(--cat-market); }
.badge-cat-film      { background: rgba(232,121,249,0.15); color: var(--cat-film); }
.badge-cat-dance     { background: rgba(45,212,191,0.15); color: var(--cat-dance); }
.badge-cat-charity   { background: rgba(248,113,113,0.15); color: var(--cat-charity); }
.badge-cat-other     { background: rgba(156,163,175,0.15); color: var(--cat-other); }

/* ========================================
   FORMS
   ======================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--space-md);
}
.form-label {
    color: var(--accent);
    font-size: var(--text-sm);
    font-weight: 600;
    display: block;
}
.form-label--required::after {
    content: ' *';
    color: var(--error);
}
.form-input,
.form-select,
.form-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
    line-height: 1.5;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}
.form-input.error,
.form-select.error,
.form-textarea.error { border-color: var(--error); }
.form-input.error:focus { box-shadow: 0 0 0 3px rgba(248,113,113,0.2); }
.form-error { color: var(--error); font-size: var(--text-xs); margin-top: 2px; }
.form-hint  { color: var(--text-muted); font-size: var(--text-xs); margin-top: 2px; }
.form-textarea { min-height: 100px; resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}
@media (max-width: 639px) {
    .form-row { grid-template-columns: 1fr; }
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: var(--text-sm);
}
.form-checkbox input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-bar-height) + 16px);
    right: 16px;
    left: 16px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
@media (min-width: 768px) {
    .toast-container {
        bottom: 24px;
        left: auto;
        max-width: 380px;
    }
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toast-in 300ms ease forwards;
    font-size: var(--text-sm);
    pointer-events: auto;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--error); }
.toast-info    { border-left: 3px solid var(--info); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: var(--text-lg);
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(10px); }
}

/* ========================================
   INLINE ALERTS
   ======================================== */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}
.alert-success { background: var(--accent-muted); color: var(--accent); border: 1px solid var(--accent); }
.alert-error   { background: rgba(248,113,113,0.15); color: var(--error); border: 1px solid var(--error); }
.alert-warning { background: rgba(255,183,77,0.15); color: var(--warning); border: 1px solid var(--warning); }
.alert-info    { background: rgba(96,165,250,0.15); color: var(--info); border: 1px solid var(--info); }

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-lg) 0;
}
.pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-sm);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}
.pagination__btn:hover { border-color: var(--accent); color: var(--accent); }
.pagination__btn.active {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
}
.pagination__btn:disabled { opacity: 0.3; cursor: not-allowed; }
.pagination__ellipsis { color: var(--text-dim); padding: 0 var(--space-xs); }

.load-more-btn {
    display: block;
    width: 100%;
    padding: var(--space-md);
    margin-top: var(--space-lg);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}
.load-more-btn:hover { border-color: var(--accent); color: var(--accent); }
.load-more-btn:disabled {
    opacity: 0.5;
    cursor: default;
    color: var(--text-muted);
}

/* ========================================
   SKELETON LOADERS
   ======================================== */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-card) 25%,
        var(--bg-input) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text { height: 16px; margin-bottom: 8px; }
.skeleton-text--sm { height: 12px; width: 60%; }
.skeleton-heading { height: 24px; width: 70%; margin-bottom: 12px; }
.skeleton-image { aspect-ratio: 16/9; border-radius: var(--radius-md); }
.skeleton-card {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   CONTENT TRANSITIONS
   ======================================== */
.content-area {
    transition: opacity var(--transition-base);
}
.content-area.loading {
    opacity: 0.4;
    pointer-events: none;
}

/* Stagger animation */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stagger-item {
    animation: fade-in-up 400ms ease forwards;
    opacity: 0;
}
.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 50ms; }
.stagger-item:nth-child(3) { animation-delay: 100ms; }
.stagger-item:nth-child(4) { animation-delay: 150ms; }
.stagger-item:nth-child(5) { animation-delay: 200ms; }
.stagger-item:nth-child(6) { animation-delay: 250ms; }
.stagger-item:nth-child(n+7) { animation-delay: 300ms; }

/* ========================================
   AVATAR
   ======================================== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-input);
    border: 2px solid var(--border);
}
.avatar--sm { width: 28px; height: 28px; }
.avatar--lg { width: 64px; height: 64px; }
.avatar--xl { width: 96px; height: 96px; }
.avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-muted);
    color: var(--accent);
    font-weight: 700;
    font-size: var(--text-sm);
}

/* ========================================
   USER TYPE BADGES
   ======================================== */
.user-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}
.user-type-badge--band    { background: rgba(192,132,252,0.2); color: #c084fc; }
.user-type-badge--venue   { background: rgba(251,146,60,0.2); color: #fb923c; }
.user-type-badge--advertiser { background: rgba(96,165,250,0.2); color: #60a5fa; }
.user-type-badge--verified { border: 1px solid var(--accent); }

/* ========================================
   ARTIST / VENUE CARDS
   ======================================== */
.entity-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-decoration: none;
    color: inherit;
}
.entity-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}
.entity-card__image {
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--bg-input);
}
.entity-card__info { flex: 1; min-width: 0; }
.entity-card__name {
    font-weight: 700;
    font-size: var(--text-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.entity-card__meta { font-size: var(--text-sm); color: var(--text-muted); }

/* ========================================
   UPLOAD ZONE
   ======================================== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}
.upload-zone:hover,
.upload-zone.drag-active {
    border-color: var(--accent);
    background: var(--accent-muted);
}
.upload-zone__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    color: var(--text-muted);
}
.upload-zone__text { color: var(--text-muted); font-size: var(--text-sm); }
.upload-zone__text strong { color: var(--accent); }
.upload-zone input[type="file"] { display: none; }

/* ========================================
   COMMENT
   ======================================== */
.comment {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
}
.comment:last-child { border-bottom: none; }
.comment__body { flex: 1; }
.comment__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}
.comment__author { font-weight: 600; font-size: var(--text-sm); }
.comment__time { color: var(--text-muted); font-size: var(--text-xs); }
.comment__text { font-size: var(--text-sm); line-height: 1.6; }
.comment__actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}
.comment__replies {
    margin-left: var(--space-xl);
    border-left: 2px solid var(--border-light);
    padding-left: var(--space-md);
}

/* ========================================
   TABS
   ======================================== */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all var(--transition-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-sans);
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ========================================
   TABLES (admin)
   ======================================== */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}
.table th {
    background: var(--bg-input);
    padding: var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-card-hover); }

@media (max-width: 767px) {
    .table-responsive th { display: none; }
    .table-responsive td {
        display: flex;
        justify-content: space-between;
        padding: var(--space-sm) var(--space-md);
    }
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        margin-right: var(--space-md);
    }
    .table-responsive tr {
        display: block;
        border-bottom: 1px solid var(--border);
        margin-bottom: var(--space-sm);
    }
}

/* ========================================
   EMPTY STATES
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl) var(--space-lg);
    text-align: center;
}
.empty-state__icon {
    width: 120px;
    height: 120px;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}
.empty-state__title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}
.empty-state__text {
    color: var(--text-muted);
    font-size: var(--text-base);
    margin-bottom: var(--space-lg);
    max-width: 400px;
}

/* ========================================
   STAT CARDS (admin)
   ======================================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}
.stat-card__label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}
.stat-card__value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--accent);
}
.stat-card__change {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress-container {
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    transition: width var(--transition-base);
    border-radius: var(--radius-full);
}

/* ========================================
   FILTER BAR
   ======================================== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
}
.filter-bar .form-select {
    width: auto;
    min-width: 140px;
    padding: 8px 12px;
    font-size: var(--text-sm);
}

.filter-trigger { display: none; }
@media (max-width: 1023px) {
    .filter-bar { display: none; }
    .filter-trigger { display: inline-flex; }
}

/* Slide-up filter panel (mobile) */
.filter-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-lg);
    z-index: var(--z-modal);
    transform: translateY(100%);
    transition: transform var(--transition-base);
    max-height: 70vh;
    overflow-y: auto;
}
.filter-panel.open { transform: translateY(0); }
.filter-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}
.filter-panel__backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-modal);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}
.filter-panel__backdrop.open { opacity: 1; pointer-events: auto; }

/* ========================================
   VIEW TOGGLE (Grid / List)
   ======================================== */
.view-toggle {
    display: inline-flex;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}
.view-toggle__btn {
    padding: 6px 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
}
.view-toggle__btn:hover { color: var(--text); }
.view-toggle__btn.active {
    background: var(--accent);
    color: var(--text-inverse);
}

/* ========================================
   MODALS
   ======================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-modal);
    z-index: var(--z-modal);
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--space-lg);
    animation: modal-in 300ms ease forwards;
}
.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}
.modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--text-2xl);
    cursor: pointer;
    line-height: 1;
}
.modal__close:hover { color: var(--text); }

@media (min-width: 768px) {
    .modal-backdrop { align-items: center; }
    .modal {
        max-width: 560px;
        border-radius: var(--radius-lg);
        animation: modal-in-center 300ms ease forwards;
    }
}
@keyframes modal-in {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
@keyframes modal-in-center {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
