/* ================================================
   UDAT Core Admin - CSS
   A modern, distinctive CMS interface
   ================================================ */

:root {
    /* Brand palette - distinctive deep teal + warm accent */
    --uc-primary: #0d6e6e;
    --uc-primary-light: #14a3a3;
    --uc-primary-dark: #084e4e;
    --uc-primary-50: #e6f5f5;
    --uc-accent: #e8653a;
    --uc-accent-light: #ff8a5c;
    --uc-accent-dark: #c44e28;

    /* Neutrals */
    --uc-bg: #f5f6fa;
    --uc-bg-card: #ffffff;
    --uc-bg-sidebar: #1a2332;
    --uc-bg-sidebar-hover: #243044;
    --uc-text: #2d3748;
    --uc-text-light: #718096;
    --uc-text-muted: #a0aec0;
    --uc-text-sidebar: #cbd5e0;
    --uc-border: #e2e8f0;
    --uc-border-light: #edf2f7;

    /* Status colors */
    --uc-success: #38a169;
    --uc-warning: #dd6b20;
    --uc-danger: #e53e3e;
    --uc-info: #3182ce;

    /* Sizing */
    --uc-sidebar-width: 260px;
    --uc-sidebar-collapsed: 68px;
    --uc-topbar-height: 0px;
    --uc-radius: 10px;
    --uc-radius-sm: 6px;
    --uc-radius-lg: 16px;
    --uc-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --uc-shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --uc-shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 6px 10px rgba(0,0,0,0.06);
    --uc-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --uc-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --uc-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============ RESET & BASE ============ */

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

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body.uc-admin {
    font-family: var(--uc-font);
    background: var(--uc-bg);
    color: var(--uc-text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--uc-primary); text-decoration: none; }
a:hover { color: var(--uc-primary-light); }

img { max-width: 100%; height: auto; }

/* ============ SIDEBAR ============ */

.uc-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--uc-sidebar-width);
    height: 100vh;
    background: var(--uc-bg-sidebar);
    color: var(--uc-text-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width var(--uc-transition);
    overflow: hidden;
}

.uc-sidebar.collapsed {
    width: var(--uc-sidebar-collapsed);
}

.uc-sidebar-brand {
    display: flex;
    align-items: center;
    padding: 18px 16px;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 64px;
}

.uc-sidebar.collapsed .uc-sidebar-brand {
    justify-content: center;
    padding: 18px 8px;
    gap: 0;
}

.uc-sidebar.collapsed .uc-brand-icon {
    display: none;
}

.uc-sidebar.collapsed .uc-sidebar-toggle {
    margin-left: 0;
}

.uc-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--uc-primary), var(--uc-accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

.uc-brand-text {
    font-weight: 600;
    font-size: 17px;
    color: #fff;
    white-space: nowrap;
}

.uc-sidebar.collapsed .uc-brand-text,
.uc-sidebar.collapsed .nav-text,
.uc-sidebar.collapsed .uc-nav-section,
.uc-sidebar.collapsed .uc-user-details,
.uc-sidebar.collapsed .uc-site-selector {
    display: none;
}

.uc-sidebar-toggle {
    background: none;
    border: none;
    color: var(--uc-text-sidebar);
    cursor: pointer;
    margin-left: auto;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
}
.uc-sidebar-toggle:hover { background: rgba(255,255,255,0.1); }

.uc-site-selector {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.uc-site-select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--uc-radius-sm);
    color: #fff;
    font-family: var(--uc-font);
    font-size: 13px;
    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='%23cbd5e0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.uc-site-select option { background: var(--uc-bg-sidebar); color: #fff; }

/* Navigation */
.uc-nav {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.uc-nav::-webkit-scrollbar { width: 6px; }
.uc-nav::-webkit-scrollbar-track { background: transparent; }
.uc-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.uc-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.uc-nav-section {
    padding: 16px 16px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--uc-text-muted);
}
.uc-nav-collapsible {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: color 0.15s;
}
.uc-nav-collapsible:hover { color: var(--uc-text-sidebar); }
.uc-nav-arrow {
    font-size: 16px;
    transition: transform 0.2s;
}
.uc-nav-collapsible.open .uc-nav-arrow { transform: rotate(180deg); }
.uc-nav-group {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
}
.uc-nav-collapsible.open + .uc-nav-group { display: block; }
.uc-sidebar.collapsed .uc-nav-arrow { display: none; }
.uc-sidebar.collapsed .uc-nav-group { display: block; }

.uc-nav-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    color: var(--uc-text-sidebar);
    font-size: 14px;
    font-weight: 400;
    border-radius: 0;
    margin: 1px 8px;
    border-radius: var(--uc-radius-sm);
    transition: all var(--uc-transition);
    position: relative;
}

.uc-nav-link:hover {
    background: var(--uc-bg-sidebar-hover);
    color: #fff;
}

.uc-nav-link.active {
    background: rgba(13, 110, 110, 0.3);
    color: #fff;
    font-weight: 500;
}

.uc-nav-link.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--uc-primary-light);
    border-radius: 0 3px 3px 0;
}

.uc-nav-link .material-symbols-outlined {
    font-size: 20px;
    flex-shrink: 0;
}

/* Sidebar footer */
.uc-sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 12px 16px;
}

.uc-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.uc-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--uc-primary), var(--uc-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.uc-user-details { flex: 1; min-width: 0; }
.uc-user-name { font-size: 13px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-user-role { font-size: 11px; color: var(--uc-text-muted); }

.uc-logout-btn {
    color: var(--uc-text-muted);
    padding: 6px;
    border-radius: 6px;
    display: flex;
}
.uc-logout-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ============ MAIN CONTENT ============ */

.uc-main {
    min-height: 100vh;
    transition: margin-left var(--uc-transition);
}

.uc-main.has-sidebar {
    margin-left: var(--uc-sidebar-width);
}

.uc-main.sidebar-collapsed {
    margin-left: var(--uc-sidebar-collapsed);
}

/* ============ PAGE HEADER ============ */

.uc-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 20px;
    gap: 16px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 201;
    background: var(--uc-bg);
    border-bottom: 1px solid var(--uc-border-light);
}

.uc-page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--uc-text);
    letter-spacing: -0.3px;
}

.uc-page-header .uc-subtitle {
    font-size: 14px;
    color: var(--uc-text-light);
    margin-top: 2px;
}

.uc-page-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ============ BUTTONS ============ */

.uc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--uc-radius-sm);
    font-family: var(--uc-font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--uc-transition);
    white-space: nowrap;
    text-decoration: none;
}

.uc-btn .material-symbols-outlined { font-size: 18px; }

.uc-btn-primary {
    background: var(--uc-primary);
    color: #fff;
}
.uc-btn-primary:hover { background: var(--uc-primary-dark); color: #fff; }

.uc-btn-accent {
    background: var(--uc-accent);
    color: #fff;
}
.uc-btn-accent:hover { background: var(--uc-accent-dark); color: #fff; }

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

.uc-btn-danger {
    background: var(--uc-danger);
    color: #fff;
}
.uc-btn-danger:hover { background: #c53030; color: #fff; }

.uc-btn-ghost {
    background: transparent;
    color: var(--uc-text-light);
}
.uc-btn-ghost:hover { background: var(--uc-bg); color: var(--uc-text); }

.uc-btn-sm { padding: 6px 14px; font-size: 13px; }
.uc-btn-lg { padding: 12px 28px; font-size: 15px; }
.uc-btn-icon { padding: 8px; }

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

.uc-card {
    background: var(--uc-bg-card);
    border-radius: var(--uc-radius);
    box-shadow: var(--uc-shadow);
    border: 1px solid var(--uc-border-light);
}

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

.uc-card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.uc-card-body { padding: 24px; }

.uc-card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--uc-border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============ CONTENT AREA ============ */

.uc-content { padding: 0 32px 32px; }

/* ============ TABLE ============ */

.uc-table-wrap {
    overflow-x: auto;
}

.uc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.uc-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--uc-text-light);
    border-bottom: 2px solid var(--uc-border);
    white-space: nowrap;
}

.uc-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--uc-border-light);
    vertical-align: middle;
}

.uc-table tbody tr:hover { background: var(--uc-primary-50); }

.uc-table .uc-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

/* ============ BADGES ============ */

.uc-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    gap: 4px;
}

.uc-badge-published { background: #c6f6d5; color: #22543d; }
.uc-badge-draft { background: #fefcbf; color: #744210; }
.uc-badge-scheduled { background: #bee3f8; color: #2a4365; }
.uc-badge-archived { background: #e2e8f0; color: #4a5568; }

/* ============ FORMS ============ */

.uc-form-group {
    margin-bottom: 20px;
}

.uc-form-group label,
.uc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--uc-text);
    margin-bottom: 6px;
}

.uc-form-group .uc-hint {
    font-size: 12px;
    color: var(--uc-text-muted);
    margin-top: 4px;
}

.uc-input,
.uc-select,
.uc-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--uc-border);
    border-radius: var(--uc-radius-sm);
    font-family: var(--uc-font);
    font-size: 14px;
    color: var(--uc-text);
    background: var(--uc-bg-card);
    transition: border-color var(--uc-transition), box-shadow var(--uc-transition);
}

.uc-input:focus,
.uc-select:focus,
.uc-textarea:focus {
    outline: none;
    border-color: var(--uc-primary);
    box-shadow: 0 0 0 3px var(--uc-primary-50);
}

.uc-textarea { min-height: 100px; resize: vertical; }

.uc-input-error { border-color: var(--uc-danger); }

.uc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.uc-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ============ FLASH MESSAGES ============ */

.uc-flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    margin: 16px 32px 0;
    border-radius: var(--uc-radius-sm);
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.uc-flash-success { background: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }
.uc-flash-error { background: #fed7d7; color: #742a2a; border: 1px solid #feb2b2; }
.uc-flash-warning { background: #fefcbf; color: #744210; border: 1px solid #faf089; }
.uc-flash-info { background: #bee3f8; color: #2a4365; border: 1px solid #90cdf4; }

.uc-flash .material-symbols-outlined { font-size: 20px; }
.uc-flash-close { background: none; border: none; font-size: 20px; cursor: pointer; margin-left: auto; color: inherit; opacity: 0.6; }
.uc-flash-close:hover { opacity: 1; }

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ============ DASHBOARD STATS ============ */

.uc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.uc-stat-card {
    background: var(--uc-bg-card);
    border-radius: var(--uc-radius);
    box-shadow: var(--uc-shadow);
    border: 1px solid var(--uc-border-light);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.uc-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.uc-stat-icon .material-symbols-outlined { font-size: 24px; color: #fff; }

.uc-stat-icon-primary { background: linear-gradient(135deg, var(--uc-primary), var(--uc-primary-light)); }
.uc-stat-icon-accent { background: linear-gradient(135deg, var(--uc-accent), var(--uc-accent-light)); }
.uc-stat-icon-info { background: linear-gradient(135deg, var(--uc-info), #63b3ed); }
.uc-stat-icon-success { background: linear-gradient(135deg, var(--uc-success), #68d391); }

.uc-stat-value { font-size: 28px; font-weight: 700; color: var(--uc-text); line-height: 1.1; }
.uc-stat-label { font-size: 13px; color: var(--uc-text-light); margin-top: 2px; }

/* ============ LOGIN PAGE ============ */

.uc-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--uc-bg-sidebar) 0%, #0d3d3d 100%);
    padding: 20px;
}

.uc-login-card {
    background: var(--uc-bg-card);
    border-radius: var(--uc-radius-lg);
    box-shadow: var(--uc-shadow-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
}

.uc-login-brand {
    text-align: center;
    margin-bottom: 36px;
}

.uc-login-brand .uc-brand-icon {
    width: 56px;
    height: 56px;
    font-size: 20px;
    margin: 0 auto 16px;
}

.uc-login-brand h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--uc-text);
    margin-bottom: 4px;
}

.uc-login-brand p {
    font-size: 14px;
    color: var(--uc-text-light);
}

.uc-login-error {
    background: #fed7d7;
    color: #742a2a;
    padding: 12px 16px;
    border-radius: var(--uc-radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid #feb2b2;
}

.uc-login-form .uc-form-group { margin-bottom: 18px; }

.uc-login-form .uc-btn-primary {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
    margin-top: 8px;
}

/* ============ SITE SELECTOR PAGE ============ */

.uc-site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.uc-site-card {
    background: var(--uc-bg-card);
    border-radius: var(--uc-radius);
    box-shadow: var(--uc-shadow);
    border: 1px solid var(--uc-border-light);
    padding: 28px;
    cursor: pointer;
    transition: all var(--uc-transition);
    text-decoration: none;
    color: var(--uc-text);
    display: block;
}

.uc-site-card:hover {
    box-shadow: var(--uc-shadow-md);
    border-color: var(--uc-primary);
    transform: translateY(-2px);
    color: var(--uc-text);
}

.uc-site-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.uc-site-card p { font-size: 13px; color: var(--uc-text-light); }

/* ============ EMPTY STATES ============ */

.uc-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--uc-text-light);
}

.uc-empty .material-symbols-outlined { font-size: 56px; color: var(--uc-border); margin-bottom: 12px; }
.uc-empty h3 { font-size: 18px; color: var(--uc-text); margin-bottom: 6px; }
.uc-empty p { font-size: 14px; margin-bottom: 20px; }

/* ============ MODAL ============ */

.uc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.uc-modal-overlay.active { display: flex; }

.uc-modal {
    background: var(--uc-bg-card);
    border-radius: var(--uc-radius-lg);
    box-shadow: var(--uc-shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.uc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--uc-border-light);
}

.uc-modal-header h2 { font-size: 18px; font-weight: 600; }

.uc-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--uc-text-light);
    padding: 4px;
    border-radius: 6px;
    display: flex;
}
.uc-modal-close:hover { background: var(--uc-bg); }

.uc-modal-body { padding: 24px; }

.uc-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--uc-border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============ PAGE EDITOR SPECIFIC ============ */

.uc-editor-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

.uc-editor-canvas {
    min-height: 400px;
}

.uc-block-list {
    list-style: none;
}

.uc-block-item {
    background: var(--uc-bg-card);
    border: 1px solid var(--uc-border-light);
    border-radius: var(--uc-radius);
    margin-bottom: 12px;
    transition: all var(--uc-transition);
    position: relative;
}

.uc-block-item:hover {
    border-color: var(--uc-primary);
    box-shadow: var(--uc-shadow-md);
}

.uc-block-item.dragging {
    opacity: 0.5;
    box-shadow: var(--uc-shadow-lg);
}

.uc-block-header {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
    border-bottom: 1px solid var(--uc-border-light);
    cursor: move;
    background: var(--uc-bg);
    border-radius: var(--uc-radius) var(--uc-radius) 0 0;
}

.uc-block-drag-handle {
    color: var(--uc-text-muted);
    cursor: grab;
    display: flex;
}

.uc-block-type-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--uc-primary);
}

.uc-block-actions {
    margin-left: auto;
    display: flex;
    gap: 2px;
}

.uc-block-actions button {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--uc-text-muted);
    border-radius: 4px;
    display: flex;
}
.uc-block-actions button:hover { background: var(--uc-border-light); color: var(--uc-text); }

.uc-block-body {
    padding: 16px;
}

.uc-block-add {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 2px dashed var(--uc-border);
    border-radius: var(--uc-radius);
    color: var(--uc-text-muted);
    cursor: pointer;
    transition: all var(--uc-transition);
    gap: 8px;
    font-size: 14px;
}
.uc-block-add:hover {
    border-color: var(--uc-primary);
    color: var(--uc-primary);
    background: var(--uc-primary-50);
}

/* Sidebar panel for page editor */
.uc-editor-sidebar .uc-card { position: sticky; top: 20px; }

/* Visibility toggles */
.uc-visibility-toggles {
    display: flex;
    gap: 6px;
}

.uc-vis-toggle {
    padding: 6px 12px;
    border: 1px solid var(--uc-border);
    border-radius: var(--uc-radius-sm);
    font-size: 12px;
    cursor: pointer;
    background: var(--uc-bg-card);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--uc-transition);
}

.uc-vis-toggle.active {
    background: var(--uc-primary-50);
    border-color: var(--uc-primary);
    color: var(--uc-primary);
}

.uc-vis-toggle .material-symbols-outlined { font-size: 16px; }

/* Block type picker — tabbed */
.uc-bp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--uc-border-light);
    padding: 0 16px;
    overflow-x: auto;
}
.uc-bp-tab {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--uc-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.uc-bp-tab:hover { color: var(--uc-text); }
.uc-bp-tab.active { color: var(--uc-primary); border-bottom-color: var(--uc-primary); }
.uc-bp-panels { max-height: 420px; overflow-y: auto; }
.uc-bp-panel { display: none !important; }
.uc-bp-panel.active { display: grid !important; }

.uc-block-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 16px;
}

.uc-block-pick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1px solid var(--uc-border-light);
    border-radius: var(--uc-radius);
    cursor: pointer;
    transition: all var(--uc-transition);
    text-align: center;
    background: var(--uc-bg-card);
}

.uc-block-pick-item:hover {
    border-color: var(--uc-primary);
    background: var(--uc-primary-50);
    transform: translateY(-2px);
}

.uc-block-pick-item .material-symbols-outlined { font-size: 26px; color: var(--uc-primary); }
.uc-block-pick-item span:last-child { font-size: 11px; font-weight: 500; line-height: 1.3; }

/* Columns layout in editor */
.uc-columns-editor {
    display: grid;
    gap: 12px;
    padding: 8px;
    background: var(--uc-bg);
    border-radius: var(--uc-radius-sm);
}

.uc-columns-editor .uc-column {
    background: var(--uc-bg-card);
    border: 1px dashed var(--uc-border);
    border-radius: var(--uc-radius-sm);
    min-height: 80px;
    padding: 8px;
}

/* ============ MEDIA LIBRARY ============ */

.uc-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.uc-media-item {
    border-radius: var(--uc-radius);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--uc-transition);
    background: var(--uc-bg-card);
    box-shadow: var(--uc-shadow);
}

.uc-media-item:hover { border-color: var(--uc-primary); transform: translateY(-2px); }
.uc-media-item.selected { border-color: var(--uc-accent); }

.uc-media-thumb {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--uc-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.uc-media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.uc-media-thumb .material-symbols-outlined { font-size: 40px; color: var(--uc-text-muted); }

.uc-media-info {
    padding: 10px 12px;
}

.uc-media-name {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    line-height: 1.3;
}

.uc-media-meta {
    font-size: 11px;
    color: var(--uc-text-muted);
    margin-top: 2px;
}

/* Upload area */
.uc-upload-zone {
    border: 2px dashed var(--uc-border);
    border-radius: var(--uc-radius);
    padding: 40px;
    text-align: center;
    transition: all var(--uc-transition);
    cursor: pointer;
    margin-bottom: 24px;
}

.uc-upload-zone:hover,
.uc-upload-zone.dragover {
    border-color: var(--uc-primary);
    background: var(--uc-primary-50);
}

.uc-upload-zone .material-symbols-outlined { font-size: 40px; color: var(--uc-text-muted); }
.uc-upload-zone p { color: var(--uc-text-light); margin-top: 8px; }

/* ============ TABS ============ */

.uc-tabs {
    display: flex;
    border-bottom: 2px solid var(--uc-border-light);
    margin-bottom: 24px;
    gap: 0;
}

.uc-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--uc-text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--uc-transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--uc-font);
}

.uc-tab:hover { color: var(--uc-text); }
.uc-tab.active { color: var(--uc-primary); border-bottom-color: var(--uc-primary); }
.uc-tab-sm { padding: 5px 12px; font-size: 12px; }

.uc-tab-panel { display: none; }
.uc-tab-panel.active { display: block; }

/* ============ SEARCH ============ */

.uc-search-bar {
    position: relative;
    max-width: 320px;
}

.uc-search-bar .material-symbols-outlined {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--uc-text-muted);
}

.uc-search-bar input {
    padding-left: 40px;
}

/* ============ LOADING ============ */

.uc-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--uc-border);
    border-top-color: var(--uc-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.uc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: var(--uc-text-light);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1024px) {
    .uc-editor-layout {
        grid-template-columns: 1fr;
    }
    .uc-editor-sidebar .uc-card { position: static; }
}

@media (max-width: 768px) {
    .uc-sidebar {
        transform: translateX(-100%);
        width: var(--uc-sidebar-width);
    }
    .uc-sidebar.mobile-open { transform: translateX(0); }
    .uc-main.has-sidebar { margin-left: 0; }
    .uc-page-header { padding: 16px 20px; }
    .uc-content { padding: 0 20px 20px; }
    .uc-flash { margin: 12px 20px 0; }
    .uc-block-picker { grid-template-columns: repeat(3, 1fr); }
    .uc-stats-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ============ UTILITY ============ */

.uc-text-muted { color: var(--uc-text-muted); }
.uc-text-center { text-align: center; }
.uc-mt-1 { margin-top: 8px; }
.uc-mt-2 { margin-top: 16px; }
.uc-mt-3 { margin-top: 24px; }
.uc-mb-1 { margin-bottom: 8px; }
.uc-mb-2 { margin-bottom: 16px; }
.uc-mb-3 { margin-bottom: 24px; }
.uc-flex { display: flex; }
.uc-flex-between { display: flex; justify-content: space-between; align-items: center; }
.uc-gap-1 { gap: 8px; }
.uc-gap-2 { gap: 16px; }
.uc-hidden { display: none !important; }

/* Responsive visibility (for block preview) */
.uc-hide-desktop { }
.uc-hide-tablet { }
.uc-hide-mobile { }

@media (min-width: 1025px) {
    .uc-hide-desktop { display: none !important; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .uc-hide-tablet { display: none !important; }
}
@media (max-width: 768px) {
    .uc-hide-mobile { display: none !important; }
}

/* ============ DRAG & DROP HIGHLIGHT ============ */

.uc-drop-target {
    outline: 2px dashed var(--uc-primary);
    outline-offset: -2px;
    background: var(--uc-primary-50) !important;
}

/* ============ RICHTEXT EDITOR CONTAINER ============ */

.uc-richtext-editor {
    border: 1px solid var(--uc-border);
    border-radius: var(--uc-radius-sm);
    overflow: hidden;
}

.uc-richtext-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 8px;
    background: var(--uc-bg);
    border-bottom: 1px solid var(--uc-border);
}

.uc-richtext-toolbar button {
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--uc-text);
    display: flex;
    align-items: center;
}
.uc-richtext-toolbar button:hover { background: var(--uc-border-light); }
.uc-richtext-toolbar button.active { background: var(--uc-primary-50); color: var(--uc-primary); }

.uc-richtext-content {
    min-height: 200px;
    padding: 16px;
    outline: none;
    line-height: 1.7;
}

.uc-richtext-content:focus {
    box-shadow: inset 0 0 0 2px var(--uc-primary-50);
}

/* Mini rich text editor (used in accordion, tabs, directories, events) */
.uc-mini-rte {
    border: 1px solid var(--uc-border-light);
    border-radius: 4px;
    padding: 8px 10px;
    min-height: 60px;
    font-size: 13px;
    line-height: 1.5;
    outline: none;
    background: var(--uc-bg);
    font-family: inherit;
}
.uc-mini-rte:focus {
    border-color: var(--uc-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}
.uc-mini-rte p { margin: 0 0 6px; }
.uc-mini-rte ul, .uc-mini-rte ol { margin: 0 0 6px 18px; padding: 0; }
.uc-mini-rte a { color: var(--uc-primary); }
