/**
 * Pusedainos Wiki - Admin Panel CSS
 * 
 * Styles for the administration interface.
 */

/* ===== Variables ===== */
:root {
    --admin-primary: #2563eb;
    --admin-primary-hover: #1d4ed8;
    --admin-danger: #dc2626;
    --admin-success: #16a34a;
    --admin-warning: #d97706;
    --admin-text: #1f2937;
    --admin-text-light: #6b7280;
    --admin-bg: #f3f4f6;
    --admin-bg-white: #ffffff;
    --admin-border: #e5e7eb;
    --admin-sidebar-bg: #1f2937;
    --admin-sidebar-text: #9ca3af;
    --admin-sidebar-active: #ffffff;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--admin-text);
    background: var(--admin-bg);
}

a {
    color: var(--admin-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* ===== Sidebar ===== */
.admin-sidebar {
    width: 240px;
    background: var(--admin-sidebar-bg);
    color: var(--admin-sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

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

.sidebar-header .logo {
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    text-decoration: none;
}

.admin-badge {
    display: inline-block;
    font-size: 0.625rem;
    background: var(--admin-primary);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    text-transform: uppercase;
    vertical-align: middle;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

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

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

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

.sidebar-nav li a.active {
    background: rgba(255,255,255,0.1);
    color: var(--admin-sidebar-active);
    border-left: 3px solid var(--admin-primary);
    padding-left: calc(1rem - 3px);
}

.sidebar-nav .icon {
    font-size: 1rem;
}

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

.view-site {
    color: var(--admin-sidebar-text);
    font-size: 0.8125rem;
}

/* ===== Main Content ===== */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--admin-text-light);
}

.logout-btn {
    padding: 0.375rem 0.75rem;
    background: var(--admin-bg);
    border-radius: 4px;
    font-size: 0.8125rem;
}

.logout-btn:hover {
    background: var(--admin-border);
    text-decoration: none;
}

.admin-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* ===== Flash Messages ===== */
.flash-message {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.flash-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.flash-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

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

.stat-card {
    background: var(--admin-bg-white);
    padding: 1.25rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.stat-label {
    font-size: 0.8125rem;
    color: var(--admin-text-light);
    margin-top: 0.25rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

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

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

/* ===== Tables ===== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--admin-bg-white);
}

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

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

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

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid var(--admin-border);
    background: var(--admin-bg-white);
    color: var(--admin-text);
    transition: all 0.15s;
}

.btn:hover {
    background: var(--admin-bg);
    text-decoration: none;
}

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

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

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

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-published {
    background: #dcfce7;
    color: #166534;
}

.status-draft {
    background: #fef3c7;
    color: #92400e;
}

.featured-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.625rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

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

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    background: var(--admin-bg-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-group .help-text {
    font-size: 0.75rem;
    color: var(--admin-text-light);
    margin-top: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ===== Article Form ===== */
.article-form .form-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

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

.form-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-section {
    background: var(--admin-bg-white);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

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

.current-photo {
    margin-bottom: 0.5rem;
}

.current-photo img {
    border-radius: 4px;
    border: 1px solid var(--admin-border);
}

/* ===== Articles Toolbar ===== */
.articles-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.toolbar-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toolbar-filters select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    font-size: 0.8125rem;
}

.search-box {
    display: flex;
}

.search-box input {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--admin-border);
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 0.8125rem;
}

.search-box button {
    padding: 0.375rem 0.75rem;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.articles-count {
    font-size: 0.8125rem;
    color: var(--admin-text-light);
    margin-bottom: 0.75rem;
}

.articles-table {
    background: var(--admin-bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.articles-table .actions {
    white-space: nowrap;
}

.articles-table .actions .btn {
    margin-right: 0.25rem;
}

.inline-form {
    display: inline;
}

/* ===== Categories Layout ===== */
.categories-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
}

.categories-form-section,
.categories-list-section {
    background: var(--admin-bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.categories-form-section h2,
.categories-list-section h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
}

/* ===== Analytics ===== */
.analytics-toolbar {
    margin-bottom: 1rem;
}

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

.period-filter label {
    font-weight: 500;
}

.period-filter select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
}

.analytics-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.analytics-section {
    background: var(--admin-bg-white);
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.analytics-section h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.simple-chart {
    width: 100%;
    border-collapse: collapse;
}

.simple-chart tr {
    border-bottom: 1px solid var(--admin-border);
}

.simple-chart td {
    padding: 0.5rem;
}

.chart-label {
    width: 60px;
    font-size: 0.75rem;
    color: var(--admin-text-light);
}

.chart-bar-cell {
    width: 100%;
}

.chart-bar {
    height: 20px;
    background: var(--admin-primary);
    border-radius: 2px;
    min-width: 2px;
}

.chart-value {
    width: 60px;
    text-align: right;
    font-size: 0.8125rem;
}

/* ===== Error List ===== */
.error-list {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.error-list ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #991b1b;
}

/* ===== Admin Grid (User Management) ===== */
.admin-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
}

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

.admin-section h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

/* ===== Additional Button Styles ===== */
.btn-secondary {
    background: var(--admin-bg);
    border-color: var(--admin-border);
    color: var(--admin-text);
}

.btn-secondary:hover {
    background: var(--admin-border);
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    border-radius: 3px;
    margin-left: 0.25rem;
    text-transform: uppercase;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ===== Form Helpers ===== */
.required {
    color: var(--admin-danger);
}

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

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

.modal-content {
    background: var(--admin-bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.modal-content h3 {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Table Actions */
.admin-table .actions {
    white-space: nowrap;
}

.admin-table .actions .btn {
    margin-right: 0.25rem;
}

.admin-table .actions .btn:last-child {
    margin-right: 0;
}

/* Flash message list */
.flash-message ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* ===== No Data ===== */
.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--admin-text-light);
}

.no-data a {
    display: inline-block;
    margin-top: 0.75rem;
}

/* ===== Custom Fields (Article Editor) ===== */
.custom-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: start;
}

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

.custom-field-row .btn-danger {
    padding: 0.375rem 0.5rem;
    font-size: 1rem;
    line-height: 1;
}

#custom-fields-container:empty + .btn {
    margin-top: 0;
}

#custom-fields-container + .btn {
    margin-top: 0.5rem;
}

/* Infobox section transitions */
.infobox-section {
    transition: opacity 0.2s ease;
}

/* Events checklist for artist */
.events-checklist {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    padding: 0.5rem;
    background: var(--admin-bg);
}

.events-checklist .checkbox-label {
    display: block;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--admin-border);
}

.events-checklist .checkbox-label:last-child {
    border-bottom: none;
}

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

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: transparent;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--admin-text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Sidebar Overlay */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.admin-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .admin-sidebar {
        position: fixed;
        left: -240px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s;
    }
    
    .admin-sidebar.open {
        left: 0;
    }
    
    .admin-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        z-index: 500;
    }
    
    /* Adjust for feedback banner when visible */
    body:has(.feedback-banner:not(.hidden)) .admin-topbar {
        top: 45px;
    }
    
    .admin-main {
        padding-top: 56px; /* Height of fixed topbar */
    }
    
    body:has(.feedback-banner:not(.hidden)) .admin-main {
        padding-top: 101px; /* 45px banner + 56px topbar */
    }
    
    .page-title {
        font-size: 0.9rem;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .user-menu {
        flex-shrink: 0;
    }
    
    .user-menu .user-name {
        display: none;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-stats {
        grid-template-columns: 1fr;
    }
}

/* ===== Settings Page ===== */
.settings-layout {
    display: grid;
    gap: 2rem;
}

.settings-section {
    background: var(--admin-card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--admin-border);
}

.settings-section h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--admin-text);
}

.section-description {
    color: var(--admin-text-secondary);
    margin-bottom: 1.5rem;
}

/* Toggle Switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 52px;
    min-width: 52px;
    height: 28px;
    background: #cbd5e1;
    border-radius: 14px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

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

.toggle-switch input:checked + .toggle-slider {
    background: #22c55e;
}

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

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.toggle-label {
    font-weight: 500;
    color: var(--admin-text);
}

/* Feedback Summary */
.feedback-summary {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--admin-border);
}

.feedback-summary h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.summary-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.summary-stat {
    text-align: center;
}

.summary-stat.has-open .stat-number {
    color: var(--admin-warning);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-primary);
}

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

/* Info Table */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

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

.info-table th {
    width: 150px;
    color: var(--admin-text-secondary);
    font-weight: 500;
}

.info-table code {
    background: var(--admin-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.875rem;
}

/* ===== Feedback Management ===== */
.feedback-toolbar {
    margin-bottom: 1.5rem;
}

.toolbar-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    background: var(--admin-card-bg);
    color: var(--admin-text);
    font-size: 0.875rem;
}

/* Feedback List */
.feedback-list {
    display: grid;
    gap: 1rem;
}

.feedback-card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 1rem;
    transition: box-shadow 0.2s;
}

.feedback-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feedback-card.priority-critical {
    border-left: 4px solid #ef4444;
}

.feedback-card.priority-high {
    border-left: 4px solid #f97316;
}

.feedback-card.priority-medium {
    border-left: 4px solid #eab308;
}

.feedback-card.priority-low {
    border-left: 4px solid #22c55e;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.card-id {
    font-weight: 600;
    color: var(--admin-text-secondary);
}

.status-badge,
.priority-badge,
.type-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.status-open {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-resolved {
    background: #dcfce7;
    color: #166534;
}

.status-badge.status-wont_fix {
    background: #f3f4f6;
    color: #6b7280;
}

.priority-badge.priority-critical {
    background: #fee2e2;
    color: #b91c1c;
}

.priority-badge.priority-high {
    background: #ffedd5;
    color: #c2410c;
}

.priority-badge.priority-medium {
    background: #fef9c3;
    color: #a16207;
}

.priority-badge.priority-low {
    background: #dcfce7;
    color: #166534;
}

.type-badge {
    background: #f3f4f6;
    color: #374151;
}

.card-description {
    margin: 0 0 0.5rem 0;
    color: var(--admin-text);
}

.card-page {
    margin: 0;
    font-size: 0.875rem;
}

.card-page a {
    color: var(--admin-primary);
    text-decoration: none;
}

.card-page a:hover {
    text-decoration: underline;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--admin-border);
}

.card-time {
    font-size: 0.8rem;
    color: var(--admin-text-secondary);
}

/* Feedback Detail View */
.feedback-detail {
    background: var(--admin-card-bg);
    border-radius: 8px;
    border: 1px solid var(--admin-border);
}

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

.detail-badges {
    display: flex;
    gap: 0.5rem;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    padding: 1.5rem;
}

.detail-main h2 {
    margin: 0 0 0.25rem 0;
}

.detail-meta {
    color: var(--admin-text-secondary);
    margin-bottom: 1.5rem;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-secondary);
    margin: 0 0 0.5rem 0;
}

.detail-section code {
    display: block;
    background: var(--admin-bg);
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    word-break: break-all;
}

.description-box {
    background: var(--admin-bg);
    padding: 1rem;
    border-radius: 6px;
    line-height: 1.6;
}

.screenshot-container {
    background: var(--admin-bg);
    padding: 0.5rem;
    border-radius: 6px;
}

.feedback-screenshot {
    max-width: 100%;
    border-radius: 4px;
    cursor: zoom-in;
}

/* Response History */
.response-history {
    border-left: 2px solid var(--admin-border);
    padding-left: 1rem;
}

.response-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--admin-border);
}

.response-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.response-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.response-meta span {
    color: var(--admin-text-secondary);
}

.response-comment {
    background: var(--admin-bg);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

/* Sidebar Cards */
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-card {
    background: var(--admin-bg);
    border-radius: 8px;
    padding: 1rem;
}

.sidebar-card h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
}

.sidebar-card.danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.sidebar-card .form-group {
    margin-bottom: 0.75rem;
}

.sidebar-card select,
.sidebar-card textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
}

/* No Data */
.no-data {
    text-align: center;
    padding: 3rem;
    color: var(--admin-text-secondary);
}

.no-data p {
    margin: 0.5rem 0;
}

.no-data a {
    color: var(--admin-primary);
}

/* Page URL Banner */
.page-url-banner {
    background: #f0f9ff;
    border-bottom: 1px solid #bae6fd;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.page-url-banner .page-label {
    font-weight: 500;
    color: #0369a1;
}

.page-url-banner .page-link {
    color: #0284c7;
    text-decoration: none;
    word-break: break-all;
}

.page-url-banner .page-link:hover {
    text-decoration: underline;
}

/* Card Page URL (list view) */
.card-page-url {
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #64748b;
}

.card-page-url a {
    color: #0284c7;
    text-decoration: none;
    word-break: break-all;
}

.card-page-url a:hover {
    text-decoration: underline;
}

/* Toolbar Actions */
.feedback-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-warning {
    background: #fef3c7 !important;
    color: #92400e !important;
    border: 1px solid #fcd34d;
}

.btn-warning:hover {
    background: #fde68a !important;
}

/* Small text helper */
.small-text {
    font-size: 0.75rem;
    color: var(--admin-text-secondary);
    margin-bottom: 0.5rem;
}

/* Modal styles */
.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: 10000;
    padding: 1rem;
}

.modal-content {
    background: var(--admin-card-bg);
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-large {
    max-width: 700px;
}

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

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

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

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

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* AI Instructions textarea */
.ai-instructions-text {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    resize: vertical;
}

@media (max-width: 768px) {
    .detail-content {
        grid-template-columns: 1fr;
    }
    
    .detail-sidebar {
        order: -1;
    }
    
    .feedback-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-actions {
        justify-content: flex-end;
    }
}
