/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

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

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

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-accent-hover);
}

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

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-bg-tertiary);
}

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

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

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

.btn-success:hover:not(:disabled) {
    background-color: #16a34a;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
}

.btn-icon {
    padding: var(--spacing-sm);
    width: 36px;
    height: 36px;
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-alpha);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-secondary);
}

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

.form-help {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xs);
}

.form-error {
    font-size: 0.75rem;
    color: var(--color-danger);
    margin-top: var(--spacing-xs);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

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

/* Cards */
.card {
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-bg-secondary);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--color-border);
    background-color: var(--color-bg-secondary);
}

/* Category Cards */
.category-card {
    display: block;
    padding: var(--spacing-lg);
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.category-card[style*="border-left"] {
    border-left-width: 4px;
    padding-left: calc(var(--spacing-lg) - 3px);
}

.category-card:hover {
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}

.category-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.category-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.category-meta {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

/* Category Card Wrapper (for admin actions) */
.category-card-wrapper {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.category-card-wrapper:hover {
    box-shadow: var(--shadow-md);
}

.category-card-wrapper:hover .category-card {
    border-color: var(--color-accent);
}

.category-card-wrapper:hover .category-actions {
    border-color: var(--color-accent);
}

.category-card-wrapper .category-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.category-card-wrapper .category-card:hover {
    transform: none;
    box-shadow: none;
}

.category-actions {
    display: flex;
    gap: var(--spacing-xs);
    justify-content: flex-end;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-top: -1px;
    transition: border-color 0.2s ease;
}

/* Page List */
.page-list {
    list-style: none;
}

.page-list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

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

.page-list-item:hover {
    background-color: var(--color-bg-secondary);
}

.page-list-link {
    display: block;
    flex: 1;
    min-width: 0;
    color: var(--color-text-primary);
}

.page-list-link:hover {
    text-decoration: none;
}

.page-list-title {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.page-list-summary {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.page-list-meta {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: var(--spacing-sm);
}

.page-list-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

.page-list-actions .btn-icon {
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.page-list-actions .btn-icon:hover {
    opacity: 1;
}

/* Breadcrumbs */
.breadcrumbs-wrapper {
    position: sticky;
    top: 64px; /* Below navbar */
    z-index: 50;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-lg);
    max-width: 1200px;
    margin: calc(-1 * var(--spacing-md)) auto 0; /* Pull up into main-content padding */
}

.breadcrumbs-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    background: var(--color-bg-primary);
    z-index: -1;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    font-size: 0.875rem;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    width: fit-content;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Remove margin when inside wrapper (wrapper handles spacing) */
.breadcrumbs-wrapper .breadcrumbs {
    margin-bottom: 0;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}

.breadcrumb-item a {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--color-accent);
    background-color: var(--color-bg-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    text-decoration: none;
}

.breadcrumb-item:first-child a::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath d='M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: var(--spacing-xs);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.breadcrumb-item:first-child a:hover::before {
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%234f46e5'%3E%3Cpath d='M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z'/%3E%3C/svg%3E");
}

.breadcrumb-separator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    opacity: 0.4;
    margin: 0 var(--spacing-xs);
    font-size: 0.75rem;
}

.breadcrumb-separator::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.breadcrumb-item:last-child {
    color: var(--color-text-primary);
    font-weight: 600;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--color-bg-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.breadcrumb-item:last-child::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--color-accent);
    border-radius: 50%;
    margin-right: var(--spacing-sm);
    animation: breadcrumb-pulse 2s ease-in-out infinite;
}

@keyframes breadcrumb-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Page Header */
.page-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.page-summary {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.page-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.page-actions {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

/* Page Content (Markdown) */
.page-content {
    line-height: 1.6;
}

.page-content h1 { font-size: 1.375rem; margin-top: var(--spacing-lg); margin-bottom: var(--spacing-xs); }
.page-content h2 { font-size: 1.25rem; margin-top: var(--spacing-md); margin-bottom: var(--spacing-xs); }
.page-content h3 { font-size: 1.125rem; margin-top: var(--spacing-md); margin-bottom: var(--spacing-xs); }
.page-content h4 { font-size: 1rem; margin-top: var(--spacing-sm); margin-bottom: var(--spacing-xs); }

.page-content p {
    margin-bottom: var(--spacing-sm);
}

.page-content ul, .page-content ol {
    margin-bottom: var(--spacing-sm);
    padding-left: 1.25rem;
}

.page-content li {
    margin-bottom: 0.125rem;
}

.page-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: var(--spacing-md);
    margin: var(--spacing-md) 0;
    color: var(--color-text-secondary);
    font-style: italic;
}

.page-content code {
    background-color: var(--color-bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.875em;
}

.page-content pre {
    background-color: var(--color-bg-tertiary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--spacing-md);
}

.page-content pre code {
    background: none;
    padding: 0;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-md);
}

.page-content th, .page-content td {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    text-align: left;
}

.page-content th {
    background-color: var(--color-bg-secondary);
    font-weight: 600;
}

.page-content img {
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-primary {
    background-color: var(--color-accent-alpha);
    color: var(--color-accent);
}

.badge-success {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
}

.badge-danger {
    background-color: var(--color-danger-bg);
    color: var(--color-danger-text);
}

.badge-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.badge-secondary {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.stat-card {
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border-top: 3px solid var(--color-accent);
    transition: all 0.2s ease;
}

.stat-card:nth-child(1) { border-top-color: var(--color-accent); }
.stat-card:nth-child(2) { border-top-color: var(--color-success); }
.stat-card:nth-child(3) { border-top-color: var(--color-secondary); }
.stat-card:nth-child(4) { border-top-color: var(--color-info); }

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xs);
}

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

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

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

.table tbody tr:hover {
    background-color: var(--color-bg-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--color-text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-state-description {
    margin-bottom: var(--spacing-lg);
}

/* Tree View */
.tree-view {
    list-style: none;
}

.tree-item {
    position: relative;
}

.tree-item-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.tree-item-header:hover {
    background-color: var(--color-bg-secondary);
}

.tree-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: transform 0.2s ease;
}

.tree-toggle.expanded {
    transform: rotate(90deg);
}

.tree-children {
    padding-left: var(--spacing-lg);
    display: none;
}

.tree-children.expanded {
    display: block;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

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

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

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
}

.tab {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

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

.tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Alert Box */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.alert-info {
    background-color: var(--color-info-bg);
    border: 1px solid var(--color-info);
    color: var(--color-info-text);
}

.alert-success {
    background-color: var(--color-success-bg);
    border: 1px solid var(--color-success);
    color: var(--color-success-text);
}

.alert-warning {
    background-color: var(--color-warning-bg);
    border: 1px solid var(--color-warning);
    color: var(--color-warning-text);
}

.alert-danger {
    background-color: var(--color-danger-bg);
    border: 1px solid var(--color-danger);
    color: var(--color-danger-text);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.toggle-switch-label {
    font-size: 0.875rem;
    color: var(--color-text-primary);
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: var(--color-bg-tertiary);
    border-radius: 12px;
    transition: background-color 0.2s ease;
}

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

.toggle-slider.active {
    background-color: var(--color-accent);
}

.toggle-slider.active::after {
    transform: translateX(20px);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 1rem;
}

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

.modal-content.modal-sm {
    max-width: 400px;
}

.modal-content.modal-lg {
    max-width: 600px;
}

.modal-content.modal-xl {
    max-width: 900px;
}

.modal-content.modal-fullscreen {
    max-width: 95vw;
    width: 95vw;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-fullscreen .modal-header {
    flex-shrink: 0;
}

.modal-content.modal-fullscreen .modal-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-content.modal-fullscreen .modal-body-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

.modal-content.modal-fullscreen .modal-actions {
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-lg);
    margin: 0;
}

/* Modal Editor Form - Condensed metadata layout */
.modal-content.modal-fullscreen .modal-editor-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-editor-form .editor-meta-section {
    flex-shrink: 0;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.modal-editor-form .editor-meta-section .meta-collapse-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem var(--spacing-lg);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-align: left;
    transition: background-color 0.15s;
}

.modal-editor-form .editor-meta-section .meta-collapse-toggle:hover {
    background: var(--color-bg-tertiary);
}

.modal-editor-form .editor-meta-section .collapse-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.modal-editor-form .editor-meta-section .collapse-icon.rotated {
    transform: rotate(-90deg);
}

.modal-editor-form .editor-meta-section .meta-toggle-label {
    font-weight: 500;
    flex-shrink: 0;
}

.modal-editor-form .editor-meta-section .meta-summary {
    flex: 1;
    font-weight: 600;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.modal-editor-form .editor-meta-section .editor-meta-content {
    padding: 0 var(--spacing-lg) var(--spacing-md);
    overflow: hidden;
}

.modal-editor-form .editor-meta-section.collapsed {
    padding-bottom: 0;
}

.modal-editor-form .editor-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md) var(--spacing-lg);
}

.modal-editor-form .editor-meta-grid .form-group {
    margin-bottom: 0;
}

.modal-editor-form .editor-meta-grid .form-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.modal-editor-form .editor-meta-grid .form-input,
.modal-editor-form .editor-meta-grid .form-select {
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
}

.modal-editor-form .editor-content-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.modal-editor-form .editor-content-section .markdown-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: none;
    border-radius: 0;
}

.modal-editor-form .editor-content-section .editor-content {
    flex: 1;
    min-height: 0;
}

.modal-editor-form .editor-content-section .editor-pane,
.modal-editor-form .editor-content-section .preview-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.modal-editor-form .editor-content-section .editor-textarea,
.modal-editor-form .editor-content-section .preview-content {
    flex: 1;
    min-height: 0;
}

.modal-editor-form .modal-actions {
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-md) var(--spacing-lg);
    margin: 0;
}

@media (max-width: 900px) {
    .modal-editor-form .editor-meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .modal-editor-form .editor-meta-grid {
        grid-template-columns: 1fr;
    }
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

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

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

.modal-form,
.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.modal-text {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

/* Form Error in Modal */
.form-error {
    background-color: var(--color-danger-bg);
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: var(--color-danger-text);
    font-size: 0.875rem;
}

/* Emoji Picker */
.emoji-picker-wrapper {
    position: relative;
    display: flex;
    gap: 0.5rem;
}

.emoji-picker-wrapper .form-input {
    flex: 1;
    cursor: pointer;
}

.emoji-picker-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.15s ease;
}

.emoji-picker-btn:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-accent);
}

/* Emoji Modal */
.emoji-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.emoji-tab {
    padding: 0.375rem 0.75rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.emoji-tab:hover {
    background: var(--color-bg-tertiary);
}

.emoji-tab.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.emoji-picker-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.1s ease;
}

.emoji-picker-item:hover {
    background: var(--color-bg-tertiary);
    transform: scale(1.2);
}

.emoji-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

/* Keyboard Shortcuts Modal */
.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item kbd {
    font-family: inherit;
    font-size: 0.75rem;
    padding: 3px 6px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-secondary);
    margin-right: 4px;
}

.shortcut-item span {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.shortcuts-note {
    margin-top: var(--spacing-md);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
}
