/* PrinterMon Admin Styles */

:root {
    /* Brand Colors */
    --dark: #0a0a0b;
    --slate: #8899a6;
    --light: #e1e8ed;
    --red: #C53D3C;
    --blue: #426EB6;
    --yellow: #FFD400;
    --green: #139B6F;

    /* Semantic Colors - Dark Mode */
    --primary: #5a8fd4;
    --primary-dark: #4a7bc0;
    --accent: #FFD400;
    --text: #e1e8ed;
    --text-light: #8899a6;
    --bg: #15171a;
    --bg-alt: #1c1f24;
    --bg-dark: #0a0a0b;
    --border: #2d3640;
    --success: #17bf85;
    --error: #e04343;
    --warning: #FFD400;
    --sidebar-width: 280px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-alt);
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-logo {
    color: white;
    text-decoration: none;
    display: block;
}

.admin-logo-image {
    max-width: 200px;
    height: auto;
}

.admin-logo span {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.admin-logo small {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 3px solid var(--primary);
}

/* Subnav */
.sidebar-nav .has-subnav > a {
    position: relative;
}

.sidebar-nav .subnav-arrow {
    margin-left: auto;
    transition: transform 0.2s;
    opacity: 0.5;
    flex-shrink: 0;
}

.sidebar-nav .has-subnav.open > a .subnav-arrow {
    transform: rotate(180deg);
}

.sidebar-nav .subnav {
    display: none;
    list-style: none;
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-nav .has-subnav.open .subnav {
    display: block;
}

.sidebar-nav .subnav a {
    padding: 0.5rem 1.5rem 0.5rem 3.25rem;
    font-size: 0.85rem;
}

.sidebar-nav .subnav a:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav .subnav a.active {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-left: 3px solid var(--primary);
}

.sidebar-nav .subnav-group-label {
    padding: 0.6rem 1.5rem 0.15rem 2.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.25rem;
}

.sidebar-nav .subnav-group-label + li a,
.sidebar-nav .subnav-group-label + li + li a {
    padding-left: 3.75rem;
}

.nav-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15em 0.5em;
    border-radius: 10px;
    margin-left: auto;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.875rem;
}

.sidebar-footer a:hover {
    color: white;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: var(--bg);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.maintenance-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--warning);
    color: var(--dark);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.admin-content {
    flex: 1;
    padding: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: rgba(19, 155, 111, 0.15);
    color: var(--green);
    border: 1px solid var(--green);
}

.alert-error {
    background: rgba(197, 61, 60, 0.15);
    color: var(--red);
    border: 1px solid var(--red);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-alt);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.875rem;
}

.dashboard-section {
    background: var(--bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 110, 182, 0.15);
}

.form-group small {
    display: block;
    margin-top: 0.375rem;
    color: var(--text-light);
    font-size: 0.75rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.tag-chip {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.15s;
}

.tag-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tag-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.content-editor {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Toggle Switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    position: relative;
    line-height: 1;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-slider {
    display: inline-block;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
    flex: 0 0 44px;
    vertical-align: middle;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-label {
    font-weight: 500;
    line-height: 24px;
}

/* Remove button in current-image */
.current-image .remove-current-btn {
    margin-left: auto;
    flex-shrink: 0;
}

/* Marked for removal state */
.current-image.marked-for-removal {
    background: rgba(197, 61, 60, 0.1);
    border: 1px dashed var(--error);
}

.current-image.marked-for-removal .current-image-content {
    opacity: 0.5;
    text-decoration: line-through;
}

.current-image.marked-for-removal .remove-current-btn {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--bg-alt);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #a83232;
}

.btn-outline-danger {
    background: transparent;
    border-color: var(--border);
    color: var(--text-light);
}

.btn-outline-danger:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-alt);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.data-table tbody tr:hover {
    background: var(--bg-alt);
}

.data-table code {
    background: var(--bg-alt);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-size: 0.8125rem;
}

.actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.625em;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: capitalize;
}

.badge-nav {
    background: rgba(66, 110, 182, 0.15);
    color: var(--blue);
}

.badge-docs {
    background: rgba(19, 155, 111, 0.15);
    color: var(--green);
}

.badge-snippet {
    background: rgba(255, 212, 0, 0.25);
    color: #9a7d00;
}

.status-published {
    color: var(--success);
    font-weight: 500;
}

.status-draft {
    color: var(--text-light);
}

.status-scheduled {
    color: var(--warning, #f59e0b);
    font-weight: 500;
}

/* Page form layout */
.form-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.form-main {
    background: var(--bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1.5rem;
    height: fit-content;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}

.sidebar-panel {
    background: var(--bg);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-panel h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.type-hint {
    display: none;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.page-header-actions {
    margin-bottom: 1.5rem;
}

.admin-search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.admin-search-bar svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #888);
    pointer-events: none;
}

.admin-search-bar input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-alt);
    color: var(--text);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.admin-search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

.admin-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.admin-filter-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted, #888);
    cursor: pointer;
    transition: all 0.15s;
}

.admin-filter-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.admin-filter-tag.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Page list with drag and drop */
.page-group {
    margin-bottom: 2rem;
}

.page-group-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.pages-list {
    background: var(--bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.page-row {
    border-bottom: 1px solid var(--border);
}

.page-row:last-child {
    border-bottom: none;
}

.page-row.dragging {
    opacity: 0.5;
    background: var(--bg-alt);
}

.page-row-category-header {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate);
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.08));
    margin-top: 0.25rem;
}

.page-row-category-header:first-child {
    border-top: none;
    margin-top: 0;
}

.page-row-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
}

.drag-handle {
    cursor: grab;
    color: var(--text-light);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.drag-handle:hover {
    opacity: 1;
}

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

.expand-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, color 0.2s;
}

.expand-btn:hover {
    color: var(--primary);
}

.expand-btn.expanded {
    transform: rotate(180deg);
}

.page-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-slug {
    background: var(--bg-alt);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
}

.page-slug.copy-slug {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: background 0.2s, color 0.2s;
}

.page-slug.copy-slug:hover {
    background: var(--primary);
    color: white;
}

.page-slug.copy-slug .copy-icon {
    opacity: 0.6;
}

.page-slug.copy-slug:hover .copy-icon {
    opacity: 1;
}

.page-slug.copy-slug.copied {
    background: var(--success);
    color: white;
}

.page-slug.copy-slug {
    position: relative;
}

.page-slug.copy-slug.copied::after {
    content: 'Copied!';
    position: absolute;
    top: -1.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.page-status {
    width: 80px;
    text-align: center;
}

.page-date {
    width: 100px;
    font-size: 0.8125rem;
    color: var(--text-light);
    text-align: right;
}

.page-preview {
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
}

.preview-frame-container {
    padding: 1rem;
    padding-left: 4.5rem;
}

.preview-frame {
    width: 100%;
    height: 400px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.preview-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
    opacity: 0.6;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-state svg {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Settings form */
.settings-form {
    max-width: 600px;
}

.form-section {
    background: var(--bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.form-section h2::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-light);
    border-bottom: 2px solid var(--text-light);
    transform: rotate(-135deg);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.form-section.collapsed h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section.collapsed h2::after {
    transform: rotate(45deg);
}

.form-section.collapsed .form-section-body {
    display: none;
}

/* Image uploads */
.current-image {
    margin-bottom: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-alt);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-image-header {
    display: flex;
    align-items: center;
}

.current-image-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.current-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
}

.selected-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    display: block;
    margin-bottom: 0.25rem;
}

.current-path {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-selector {
    margin-bottom: 0.5rem;
}

.selected-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(19, 155, 111, 0.1);
    border: 1px solid var(--green);
    border-radius: 8px;
}

.selected-file-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.selected-file-info {
    min-width: 0;
}

.selected-path {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favicon-preview {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-preview {
    max-width: 120px;
    max-height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.banner-preview {
    max-width: 200px;
    max-height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.image-input-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.options-divider {
    color: var(--text-light);
    font-size: 0.8rem;
}

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.file-upload-btn {
    cursor: pointer;
    position: relative;
}

.file-upload-btn input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-path {
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--bg-alt);
    border-radius: 4px;
}

.empty-message {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.image-item {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.image-item:hover {
    border-color: var(--primary);
    background: var(--bg-alt);
}

.image-item img {
    width: 100%;
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.image-item .image-name {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Large modal for documentation schema */
.modal-large {
    max-width: 900px;
    max-height: 90vh;
}

.modal-large .modal-body {
    font-size: 0.875rem;
}

.modal-large h4 {
    margin: 1.5rem 0 0.75rem;
    color: var(--text);
}

.modal-large ul {
    margin: 0 0 1rem 1.5rem;
}

.modal-large li {
    margin-bottom: 0.25rem;
}

.modal-large strong {
    color: var(--primary);
}

/* Code block styling */
.code-block {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.code-block code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre;
}

/* File upload area styling */
.file-upload-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.selected-file-name {
    color: var(--text);
    font-size: 0.875rem;
}

/* Documentation Export */
.export-description {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.export-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.export-status {
    font-size: 0.875rem;
    color: var(--text-light);
}

.export-status.success {
    color: var(--success);
}

.export-status.error {
    color: var(--error);
}

.export-download {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.export-info {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Spinning animation for loading */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: var(--bg-alt);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--text-light);
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.875rem;
}

.back-link:hover {
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .form-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }

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

    .admin-main {
        margin-left: 0;
    }

    .admin-header {
        padding: 1rem;
    }

    .admin-content {
        padding: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Content Blocks / Patterns System */
.content-blocks-area {
    margin-top: 1rem;
}

.content-blocks-area > label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

#blocks-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.content-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.block-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.content-block.collapsed .block-header {
    border-bottom: none;
}

.block-header.block-hidden {
    opacity: 0.5;
}

.block-header.block-hidden .block-type::after {
    content: ' (Hidden)';
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
}

.block-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    padding: 0;
}

.block-toggle:hover {
    color: var(--primary);
}

.content-block.collapsed .block-toggle {
    transform: rotate(-90deg);
}

.block-drag-handle {
    cursor: grab;
    color: var(--text-light);
    display: flex;
    align-items: center;
}

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

.content-block.block-dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary);
}

.block-type {
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.block-preview {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.block-actions {
    display: flex;
    gap: 0.25rem;
}

.block-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.15s;
}

.block-btn:hover:not(:disabled) {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.block-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.block-btn.block-delete:hover:not(:disabled) {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

/* Block body and tabs */
.block-body {
    border-top: none;
}

.block-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.block-tab {
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-light);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.block-tab:hover {
    color: var(--text);
    background: var(--bg-alt);
}

.block-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg);
}

.block-tab-content {
    display: none;
}

.block-tab-content.active {
    display: block;
}

.display-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.display-presets-grid .block-field {
    margin: 0;
}

.block-field .code-editor {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    background: var(--bg-dark);
}

.block-field small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.block-field small code {
    background: var(--bg-alt);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

.block-fields {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.block-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 0.375rem;
}

.block-field input,
.block-field textarea,
.block-field select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
}

.block-field textarea {
    min-height: 120px;
    resize: vertical;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
}

.block-field input:focus,
.block-field textarea:focus,
.block-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(90, 143, 212, 0.15);
}

/* Add Block Button */
.btn-add-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 2px dashed var(--border);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-block:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(90, 143, 212, 0.05);
}

/* Dynamic Features List */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.feature-item {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.feature-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.feature-item-header:hover {
    background: rgba(0, 0, 0, 0.3);
}

.feature-item.collapsed .feature-item-header {
    border-bottom: none;
}

.feature-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.feature-item.collapsed .feature-toggle {
    transform: rotate(-90deg);
}

.feature-item-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-light);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feature-preview {
    font-weight: 400;
    color: var(--text-muted, #6b7280);
    margin-left: 0.25rem;
}

.feature-item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.feature-move-btn {
    padding: 0.25rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}

.feature-move-btn:hover:not(:disabled) {
    color: var(--primary);
    border-color: var(--border);
}

.feature-move-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.feature-remove-btn {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.feature-remove-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.feature-item-fields {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-item-fields .block-field {
    margin: 0;
}

.features-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.15s;
}

.btn-text:hover {
    color: var(--primary);
}

.btn-add-feature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    flex: 1;
}

.btn-add-feature:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(90, 143, 212, 0.05);
}

/* Pattern Selection Modal */
.pattern-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.pattern-modal.active {
    display: flex;
}

.pattern-modal-content {
    background: var(--bg);
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.pattern-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.pattern-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.pattern-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s;
}

.pattern-modal-close:hover {
    background: var(--bg-alt);
    color: var(--text);
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    overflow-y: auto;
}

.pattern-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--bg-alt);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.pattern-card:hover {
    border-color: var(--primary);
    background: rgba(90, 143, 212, 0.1);
}

.pattern-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.pattern-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.pattern-desc {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Responsive patterns */
@media (max-width: 600px) {
    .pattern-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pattern-card {
        padding: 1rem 0.75rem;
    }

    .pattern-icon {
        width: 40px;
        height: 40px;
    }
}

/* Image Upload Modal */
.image-upload-body {
    padding: 1.5rem;
}

.image-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 2rem;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: var(--bg-alt);
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.image-dropzone:hover,
.image-dropzone.dragover {
    border-color: var(--primary);
    background: rgba(90, 143, 212, 0.1);
}

.image-dropzone svg {
    color: var(--text-light);
}

.image-dropzone p {
    font-size: 1rem;
    color: var(--text);
    margin: 0;
}

.image-dropzone span {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.image-dropzone small {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.image-preview-area {
    text-align: center;
}

.image-preview-area img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.image-preview-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.image-upload-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Image Modal Tabs */
.image-modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
}

.image-modal-tab,
.file-modal-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.image-modal-tab:hover,
.file-modal-tab:hover {
    color: var(--text);
}

.image-modal-tab.active,
.file-modal-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.image-tab-content,
.file-tab-content {
    display: none;
}

.image-tab-content.active,
.file-tab-content.active {
    display: block;
}

/* Media Library in Modal */
.media-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem;
}

.media-library-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: var(--bg-dark);
}

.media-library-item:hover {
    border-color: var(--border);
}

.media-library-item.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(90, 143, 212, 0.3);
}

.media-library-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-library-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    font-size: 0.6875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-library-loading,
.media-library-empty,
.media-library-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.media-library-error {
    color: var(--error);
}

/* Image field in blocks */
.block-field-image {
    margin-bottom: 0.5rem;
}

.image-field-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.image-field-preview {
    position: relative;
    flex-shrink: 0;
}

.image-field-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.image-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--error);
    border: 2px solid var(--bg);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

.image-remove-btn:hover {
    transform: scale(1.1);
}

.image-upload-trigger {
    flex-shrink: 0;
}

/* Messages List */
.messages-list {
    background: var(--bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.messages-list .data-table tr.unread {
    background: rgba(90, 143, 212, 0.08);
}

.messages-list .data-table tr.unread td {
    font-weight: 500;
}

.status-cell {
    text-align: center;
}

.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.message-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.message-link:hover {
    color: var(--primary);
}

.message-email {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-light);
    font-weight: normal;
}

.date-cell {
    font-size: 0.8125rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* Message View */
.message-view {
    background: var(--bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.message-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
}

.message-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.meta-row label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    min-width: 110px;
    flex-shrink: 0;
}

.meta-row span {
    color: var(--text);
}

.ip-address {
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--text-light) !important;
}

.message-body {
    padding: 1.5rem;
}

.message-content {
    background: var(--bg-alt);
    border-radius: 8px;
    padding: 1.25rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
}

/* FAQ Settings */
.section-description {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.faq-items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.faq-item {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.faq-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border);
}

.faq-item-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-light);
}

.faq-item-fields {
    padding: 1rem;
}

.faq-item-fields .form-group {
    margin-bottom: 0.875rem;
}

.faq-item-fields .form-group:last-child {
    margin-bottom: 0;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group-row .form-group {
    margin-bottom: 0;
}

.btn-add-faq {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-style: dashed;
}

/* Media Library */
.media-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.media-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.media-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-info {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.media-name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.media-size {
    font-size: 0.75rem;
    color: var(--text-light);
}

.media-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-alt);
}

.media-actions .btn-sm {
    flex: 1;
    justify-content: center;
}

.media-actions .inline-form {
    flex: 1;
}

.media-actions .inline-form .btn-sm {
    width: 100%;
}

/* Admin Table */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table td a {
    color: var(--primary);
}

.admin-table tr:hover {
    background: var(--bg-alt);
}

/* Permissions Grid */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.permission-section-title {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    cursor: pointer;
    font-weight: normal;
}

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

/* View Switch Banner */
.view-switch-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    background: var(--warning);
    color: var(--dark);
    font-size: 0.85rem;
    font-weight: 500;
}

/* View Switch Panel */
.view-switch-panel {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    width: 360px;
    height: 100vh;
    background: var(--bg);
    border-right: 1px solid var(--border);
    z-index: 1000;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.view-switch-panel.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.view-switch-panel.open ~ .view-switch-overlay {
    display: block;
}

.view-switch-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

.view-switch-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.view-switch-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.view-switch-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.view-switch-close:hover {
    color: var(--text);
}

.view-switch-form .form-group {
    margin-bottom: 1rem;
}

.view-switch-form .permissions-grid {
    gap: 1rem;
}

.view-switch-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
