/**
 * Design System Variables
 * Single source of truth for colors, spacing, and component styles
 *
 * Usage: var(--color-pending), var(--spacing-md), etc.
 */

:root {
    /* ==================== STATUS COLORS ==================== */
    /* 3-status workflow: pending -> approved / rejected */

    /* Pending (Amber) */
    --color-pending: #f59e0b;
    --color-pending-light: #fbbf24;
    --color-pending-bg: rgba(245, 158, 11, 0.1);
    --color-pending-bg-solid: #fef3c7;
    --color-pending-text: #92400e;
    --color-pending-gradient: linear-gradient(135deg, #fbbf24, #f59e0b);

    /* Approved (Green) */
    --color-approved: #22c55e;
    --color-approved-light: #4ade80;
    --color-approved-bg: rgba(34, 197, 94, 0.1);
    --color-approved-bg-solid: #dcfce7;
    --color-approved-text: #166534;
    --color-approved-gradient: linear-gradient(135deg, #4ade80, #22c55e);

    /* Rejected (Red) */
    --color-rejected: #ef4444;
    --color-rejected-light: #f87171;
    --color-rejected-bg: rgba(239, 68, 68, 0.1);
    --color-rejected-bg-solid: #fee2e2;
    --color-rejected-text: #991b1b;
    --color-rejected-gradient: linear-gradient(135deg, #f87171, #ef4444);

    /* Created (Blue - for charts) */
    --color-created: #0284c7;
    --color-created-bg: rgba(2, 132, 199, 0.7);

    /* ==================== PRIORITY COLORS ==================== */
    --color-priority-low: #0ea5e9;
    --color-priority-normal: #22c55e;
    --color-priority-high: #f59e0b;
    --color-priority-urgent: #ef4444;

    /* ==================== CATEGORY COLORS ==================== */
    --color-category-curbs: #3b82f6;
    --color-category-roads: #ef4444;
    --color-category-lights: #eab308;
    --color-category-drainage: #06b6d4;
    --color-category-signs: #a855f7;
    --color-category-other: #6b7280;

    /* ==================== PRIMARY BRAND ==================== */
    --color-primary-50: #f0f9ff;
    --color-primary-100: #e0f2fe;
    --color-primary-200: #bae6fd;
    --color-primary-300: #7dd3fc;
    --color-primary-400: #38bdf8;
    --color-primary-500: #0ea5e9;
    --color-primary-600: #0284c7;
    --color-primary-700: #0369a1;
    --color-primary-800: #075985;
    --color-primary-900: #0c4a6e;

    /* ==================== NEUTRAL COLORS ==================== */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* ==================== SEMANTIC BACKGROUNDS ==================== */
    /* Light mode: Clean, airy feel - light bg, white cards */
    --bg-primary: #f1f5f9;
    --bg-secondary: #e2e8f0;
    --bg-tertiary: #cbd5e1;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --border-color: #e5e7eb;
    --border-color-light: #f3f4f6;

    /* ==================== SPACING ==================== */
    --spacing-xs: 0.25rem;  /* 4px */
    --spacing-sm: 0.5rem;   /* 8px */
    --spacing-md: 1rem;     /* 16px */
    --spacing-lg: 1.5rem;   /* 24px */
    --spacing-xl: 2rem;     /* 32px */
    --spacing-2xl: 3rem;    /* 48px */

    /* ==================== BORDER RADIUS ==================== */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-full: 9999px;

    /* ==================== SHADOWS ==================== */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);

    /* ==================== TRANSITIONS ==================== */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;

    /* ==================== Z-INDEX LAYERS ==================== */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-toast: 500;
}

/* ==================== DARK MODE ==================== */
.dark {
    /* Dark mode: Deep, rich feel - dark bg, slightly lighter cards */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-card-hover: #283548;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --border-color: #334155;
    --border-color-light: #475569;

    /* Adjusted status colors for dark mode */
    --color-pending-bg: rgba(245, 158, 11, 0.2);
    --color-pending-bg-solid: rgba(245, 158, 11, 0.3);
    --color-pending-text: #fbbf24;

    --color-approved-bg: rgba(34, 197, 94, 0.2);
    --color-approved-bg-solid: rgba(34, 197, 94, 0.3);
    --color-approved-text: #4ade80;

    --color-rejected-bg: rgba(239, 68, 68, 0.2);
    --color-rejected-bg-solid: rgba(239, 68, 68, 0.3);
    --color-rejected-text: #f87171;

    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ==================== REUSABLE COMPONENT CLASSES ==================== */
/* Use these classes instead of repeating Tailwind patterns across pages */

/* ========== STATUS BADGES ========== */
/* Usage: <span class="badge badge-status-pending">Pending</span> */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    transition: transform var(--transition-fast);
}
.badge:hover {
    transform: scale(1.02);
}

/* Status badges with light/dark mode support */
.badge-status-pending {
    background: #fef3c7;
    color: #92400e;
}
.dark .badge-status-pending {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.badge-status-approved {
    background: #dcfce7;
    color: #166534;
}
.dark .badge-status-approved {
    background: rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.badge-status-rejected {
    background: #fee2e2;
    color: #991b1b;
}
.dark .badge-status-rejected {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* ========== PRIORITY BADGES ========== */
/* Usage: <span class="badge badge-priority-high">High</span> */
.badge-priority-low {
    background: #e0f2fe;
    color: #0369a1;
}
.dark .badge-priority-low {
    background: rgba(14, 165, 233, 0.25);
    color: #7dd3fc;
}

.badge-priority-normal {
    background: #dcfce7;
    color: #166534;
}
.dark .badge-priority-normal {
    background: rgba(34, 197, 94, 0.25);
    color: #86efac;
}

.badge-priority-high {
    background: #fef3c7;
    color: #92400e;
}
.dark .badge-priority-high {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.badge-priority-urgent {
    background: #fee2e2;
    color: #dc2626;
}
.dark .badge-priority-urgent {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

/* ========== PRIORITY BARS (vertical indicator) ========== */
/* Usage: <div class="priority-bar priority-bar-high"></div> */
.priority-bar {
    width: 4px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}
.priority-bar-low { background: var(--color-priority-low); }
.priority-bar-normal { background: var(--color-priority-normal); }
.priority-bar-high { background: var(--color-priority-high); }
.priority-bar-urgent { background: var(--color-priority-urgent); }

/* ========== PRIORITY DOTS ========== */
/* Usage: <span class="priority-dot priority-dot-high"></span> */
.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}
.priority-dot-low { background: var(--color-priority-low); }
.priority-dot-normal { background: var(--color-priority-normal); }
.priority-dot-high { background: var(--color-priority-high); }
.priority-dot-urgent { background: var(--color-priority-urgent); }

/* ========== ISSUE CARDS ========== */
/* Reusable card component with hover effects and borders */
.issue-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    overflow: hidden;
}
.issue-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary-300);
    transform: translateY(-2px);
}
.dark .issue-card {
    background: #1e293b;
    border-color: #334155;
}
.dark .issue-card:hover {
    border-color: var(--color-primary-600);
}

/* Card with gradient border on hover */
.issue-card-fancy {
    position: relative;
}
.issue-card-fancy::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 2px;
    background: linear-gradient(135deg, transparent 0%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}
.issue-card-fancy:hover::before {
    background: linear-gradient(135deg, var(--color-primary-400) 0%, #6366f1 100%);
    opacity: 1;
}

/* ========== LIST ROW ========== */
/* Horizontal list item with priority indicator */
.issue-row {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
}
.issue-row:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-300);
}
.dark .issue-row {
    background: #1e293b;
    border-color: #334155;
}
.dark .issue-row:hover {
    border-color: var(--color-primary-600);
}

/* ========== TABLE STYLES ========== */
.data-table-container {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.dark .data-table-container {
    background: #1e293b;
    border-color: #334155;
}

/* ========== VOTE BUTTONS ========== */
.vote-btn {
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    color: var(--text-muted);
}
.vote-btn:hover {
    transform: scale(1.1);
}
.vote-btn-active-up {
    color: #22c55e;
}
.vote-btn-active-down {
    color: #ef4444;
}
.vote-score {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}
.vote-score-positive { color: #22c55e; }
.vote-score-negative { color: #ef4444; }
.vote-score-neutral { color: var(--text-muted); }

/* ========== ICON CONTAINERS ========== */
/* Category icon box */
.icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}
.icon-box-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
}
.icon-box-md {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
}
.icon-box-lg {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
}
.icon-box-primary {
    background: var(--color-primary-100);
    color: var(--color-primary-600);
}
.dark .icon-box-primary {
    background: rgba(14, 165, 233, 0.2);
    color: var(--color-primary-400);
}

/* ========== LOCATION BOX ========== */
.location-box {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.625rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.dark .location-box {
    background: rgba(51, 65, 85, 0.5);
}
.location-box i {
    color: #f87171;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* ========== META INFO ========== */
.meta-text {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.meta-divider {
    color: var(--border-color);
}

/* Legacy status classes for backwards compatibility */
.status-pending {
    background: var(--color-pending-bg-solid);
    color: var(--color-pending-text);
}
.status-approved {
    background: var(--color-approved-bg-solid);
    color: var(--color-approved-text);
}
.status-rejected {
    background: var(--color-rejected-bg-solid);
    color: var(--color-rejected-text);
}

/* Card base styles */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}
.card:hover {
    box-shadow: var(--shadow-md);
}

/* Button base styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: var(--color-primary-600);
    color: white;
}
.btn-primary:hover {
    background: var(--color-primary-700);
}
.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
}

/* Kanban styles */
.kanban-board {
    display: grid;
    gap: var(--spacing-md);
}
.kanban-column {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}
.kanban-header {
    padding: var(--spacing-md);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}
.kanban-header-pending { background: var(--color-pending-gradient); }
.kanban-header-approved { background: var(--color-approved-gradient); }
.kanban-header-rejected { background: var(--color-rejected-gradient); }

.kanban-board.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.kanban-count {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
}
.kanban-cards {
    padding: var(--spacing-sm);
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.kanban-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}
.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xs);
    min-width: 0;
}
.kanban-card-title {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.kanban-card-title:hover {
    color: var(--color-primary-600);
}
.kanban-card-category {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}
.kanban-card-image {
    margin-top: var(--spacing-sm);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}
.kanban-card-image img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}
.kanban-card-image-count {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}
.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color-light);
}
.kanban-card-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.kanban-card-actions {
    display: flex;
    gap: var(--spacing-sm);
}
.kanban-card-actions a,
.kanban-card-actions button {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
}
.kanban-card-actions a:hover,
.kanban-card-actions button:hover {
    color: var(--color-primary-600);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

/* Stat cards */
.stat-card {
    transition: transform var(--transition-fast);
}
.stat-card:hover {
    transform: translateY(-2px);
}

/* Vote count display */
.vote-count {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.8rem;
}

/* ========== DETAIL PAGE BADGES ========== */
/* Alias for badge classes - used on issue detail page */
.detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
}
.detail-badge-pending {
    background: #fef3c7;
    color: #92400e;
}
.dark .detail-badge-pending {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}
.detail-badge-approved {
    background: #dcfce7;
    color: #166534;
}
.dark .detail-badge-approved {
    background: rgba(34, 197, 94, 0.25);
    color: #4ade80;
}
.detail-badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}
.dark .detail-badge-rejected {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}
/* Priority detail badges */
.detail-badge-low {
    background: #e0f2fe;
    color: #0369a1;
}
.dark .detail-badge-low {
    background: rgba(14, 165, 233, 0.25);
    color: #7dd3fc;
}
.detail-badge-normal {
    background: #dcfce7;
    color: #166534;
}
.dark .detail-badge-normal {
    background: rgba(34, 197, 94, 0.25);
    color: #86efac;
}
.detail-badge-high {
    background: #fef3c7;
    color: #92400e;
}
.dark .detail-badge-high {
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}
.detail-badge-urgent {
    background: #fee2e2;
    color: #dc2626;
}
.dark .detail-badge-urgent {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

/* ========== ISSUE DETAIL PAGE STYLES ========== */
.issue-page-map {
    height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.issue-page-map.editing {
    height: 350px;
}

.comment-input {
    resize: none;
}
.comment-item {
    transition: background var(--transition-normal);
}
.comment-item:hover {
    background: rgba(0, 0, 0, 0.02);
}
.dark .comment-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.image-container {
    position: relative;
}
.image-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-normal);
    border: none;
}
.image-container:hover .image-delete-btn {
    opacity: 1;
}

/* ========== MOBILE ACTION BAR ========== */
.issue-mobile-action-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: white;
    padding: 8px 16px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-color);
    justify-content: space-around;
    gap: 8px;
}
.dark .issue-mobile-action-bar {
    background: #1e293b;
    border-top-color: #334155;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.issue-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 16px;
    min-width: 64px;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}
.issue-action-btn i {
    font-size: 18px;
}
.issue-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}
.dark .issue-action-btn:hover {
    background: #334155;
    color: #f3f4f6;
}
.issue-action-btn.active {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}
.dark .issue-action-btn.active {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}
.issue-action-btn.active-down {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}
.dark .issue-action-btn.active-down {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}
.issue-action-btn.issue-action-primary {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}
.issue-action-btn.issue-action-primary:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
}

@media (max-width: 768px) {
    .issue-mobile-action-bar {
        display: flex;
    }
}

/* ========== GENERIC MOBILE HEADER ========== */
/* Reusable mobile header pattern for all pages (admin, user, etc.) */
.mobile-header {
    display: none;
    position: sticky;
    top: 64px; /* Below main nav (h-16 = 64px) */
    z-index: 50;
    background: white;
    border-bottom: 1px solid var(--border-color);
    margin: -1rem -1rem 1rem -1rem;
}
.dark .mobile-header {
    background: #0f172a;
    border-bottom-color: #334155;
}
@media (max-width: 768px) {
    .mobile-header { display: block; }
}
.mobile-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 8px;
    gap: 12px;
}
.mobile-header-title-wrap {
    flex: 1;
    min-width: 0;
}
.mobile-header-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.mobile-header-title i {
    color: var(--primary-500);
}
.mobile-header-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}
.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
/* Mobile header button styles */
.mobile-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
}
.mobile-header-btn:hover,
.mobile-header-btn:active {
    background: var(--bg-hover);
}
.mobile-header-btn.primary {
    background: var(--primary-500);
    color: white;
}
.mobile-header-btn.primary:hover {
    background: var(--primary-600);
}
.mobile-header-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-600);
}
.dark .mobile-header-link {
    color: var(--primary-400);
}
.mobile-quick-stats {
    display: flex;
    justify-content: space-around;
    padding: 8px 12px 12px;
    gap: 4px;
}
.quick-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 56px;
}
.quick-stat:active {
    transform: scale(0.95);
}
.quick-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.quick-stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* Status colors for quick stats - 3 status workflow */
.quick-stat.pending .quick-stat-value { color: #f59e0b; }
.quick-stat.approved .quick-stat-value { color: #22c55e; }
.quick-stat.rejected .quick-stat-value { color: #ef4444; }
.quick-stat.score .quick-stat-value { color: #0ea5e9; }

/* ========== GENERIC MOBILE ACTION BAR ========== */
/* Reusable bottom action bar for all pages */
.mobile-action-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: white;
    padding: 8px 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-color);
    justify-content: space-around;
    gap: 4px;
}
.dark .mobile-action-bar {
    background: #1e293b;
    border-top-color: #334155;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 12px;
    min-width: 56px;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    position: relative;
}
.action-btn i {
    font-size: 18px;
}
.action-btn:hover,
.action-btn.active {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}
.dark .action-btn:hover,
.dark .action-btn.active {
    background: #334155;
    color: #f3f4f6;
}
.action-btn.active {
    color: var(--color-primary-500);
}
.dark .action-btn.active {
    color: var(--color-primary-400);
}
.action-btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    padding: 10px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}
.action-btn-primary:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
}
.action-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: #ef4444;
    color: white;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

@media (max-width: 768px) {
    .mobile-header {
        display: block;
    }
    .mobile-action-bar {
        display: flex;
    }
    /* Move dark mode toggle above mobile bottom nav */
    body .fixed.bottom-6.left-6 {
        bottom: calc(90px + env(safe-area-inset-bottom));
    }
}

/* ========== MOBILE BOTTOM NAVIGATION ========== */
/*
 * Flexbox layout with fixed-width center button for consistent centering.
 * The center primary button is always exactly centered.
 */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    background: var(--bg-primary);
    padding: 8px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-color);
    /* Flexbox for proper centering */
    justify-content: center;
    align-items: flex-end;
    gap: 0;
}

.dark .mobile-bottom-nav {
    background: var(--bg-secondary);
    border-top-color: var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Left and right button groups - equally spaced */
.mobile-nav-left,
.mobile-nav-right {
    display: flex;
    flex: 1;
    justify-content: space-evenly;
    align-items: center;
}

/* Center button container - fixed width for perfect centering */
.mobile-nav-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 80px;
}

/* Individual nav item styling */
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    min-width: 48px;
    min-height: 48px;
}

/* Hide text labels - icons only */
.mobile-nav-item span:not(.nav-badge) {
    display: none;
}

.mobile-nav-item i {
    font-size: 20px;
}

.mobile-nav-item:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.05);
}

.dark .mobile-nav-item {
    color: #9ca3af;
}

.dark .mobile-nav-item:active {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-item.active {
    color: var(--color-primary-600);
}

.dark .mobile-nav-item.active {
    color: var(--color-primary-400);
}

/* Primary center button (Report Issue) */
.mobile-nav-item.mobile-nav-primary {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    color: white !important;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    margin-top: -24px;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
    min-height: auto;
    padding: 0;
}

.mobile-nav-item.mobile-nav-primary i {
    font-size: 24px;
    margin: 0;
}

.mobile-nav-item.mobile-nav-primary:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-700));
}

/* Active state for primary button (e.g., when sidebar is open) */
.mobile-nav-item.mobile-nav-primary.active {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}

/* Badge indicator for active filters/states */
.nav-badge {
    display: block !important;
    position: absolute;
    top: 6px;
    right: 50%;
    transform: translateX(14px);
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

.dark .nav-badge {
    border-color: var(--color-slate-800);
}

/* Hide nav by default, show on mobile */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
}

/* ========== BOTTOM SHEET (Unified Mobile Component) ========== */
/* Sits ABOVE the mobile nav bar, same style as issues filter drawer */
.bottom-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 140;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.bottom-sheet-overlay.show {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    display: none;
    position: fixed;
    bottom: calc(70px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-radius: 20px 20px 0 0;
    max-height: 60vh;
    z-index: 145;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    flex-direction: column;
}

.bottom-sheet.show {
    transform: translateY(0);
}

.dark .bottom-sheet {
    background: var(--bg-secondary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Handle bar at top */
.bottom-sheet::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 10px auto;
}

.dark .bottom-sheet::before {
    background: #475569;
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.bottom-sheet-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dark .bottom-sheet-header h3 {
    color: #f1f5f9;
}

.bottom-sheet-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.2s;
}

.bottom-sheet-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark .bottom-sheet-close {
    color: #9ca3af;
}

.dark .bottom-sheet-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    max-height: calc(60vh - 80px);
}

@media (max-width: 768px) {
    .bottom-sheet-overlay {
        display: block;
    }
    .bottom-sheet {
        display: flex;
    }
}

@media (min-width: 769px) {
    .bottom-sheet-overlay,
    .bottom-sheet {
        display: none !important;
    }
}

/* ========== INVITE CODE STYLING ========== */
.invite-code {
    font-family: 'SF Mono', 'Consolas', monospace;
    background: var(--bg-tertiary);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    letter-spacing: 0.5px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* ========== ISSUE DETAIL MODAL ========== */
.issue-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 1rem;
}
.issue-detail-modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    color: var(--text-primary);
}
.dark .issue-detail-modal {
    background: #1e293b;
}
.issue-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.issue-detail-header-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}
.issue-detail-header-link:hover .issue-detail-title h2 {
    color: var(--color-primary-600);
}
.issue-detail-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.issue-detail-icon i {
    font-size: 1.25rem;
}
.issue-detail-title {
    min-width: 0;
}
.issue-detail-title h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-fast);
}
.issue-detail-title .subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.issue-detail-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.issue-detail-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.issue-detail-body {
    padding: 1.25rem;
}
.issue-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.issue-detail-section {
    margin-bottom: 1.25rem;
}
.issue-detail-section:last-child {
    margin-bottom: 0;
}
.issue-detail-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.issue-detail-section p {
    color: var(--text-secondary);
    line-height: 1.5;
}
.issue-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.issue-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.issue-detail-meta-item .icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}
.issue-detail-meta-item .info {
    display: flex;
    flex-direction: column;
}
.issue-detail-meta-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.issue-detail-meta-item .value {
    font-size: 0.8125rem;
    color: var(--text-primary);
    line-height: 1.25rem;
}
.issue-detail-meta-item .value a {
    color: var(--color-primary-600);
    text-decoration: none;
}
.issue-detail-meta-item .value a:hover {
    text-decoration: underline;
}
.issue-detail-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.issue-detail-images img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: opacity var(--transition-fast);
}
.issue-detail-images img:hover {
    opacity: 0.8;
}
/* Hero image */
.issue-detail-hero {
    position: relative;
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
}
.issue-detail-hero-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: opacity var(--transition-fast);
}
.issue-detail-hero:hover .issue-detail-hero-img {
    opacity: 0.9;
}
.issue-detail-hero-count {
    position: absolute;
    bottom: 0.625rem;
    right: 0.625rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 1.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.issue-detail-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.dark .issue-detail-footer {
    background: #0f172a;
}

/* ========== MODAL SIZE UTILITIES ========== */
/* Usage: <div class="modal-content modal-sm"> */
.modal-sm { max-width: 400px; }
.modal-md { max-width: 500px; }
.modal-lg { max-width: 640px; }
.modal-xl { max-width: 800px; }
.modal-full { max-width: 100%; }

/* ========== LEGEND DOTS (for charts) ========== */
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========== TEXT UTILITIES ========== */
.text-primary-color { color: var(--color-primary-600); }
.text-pending { color: var(--color-pending); }
.text-approved { color: var(--color-approved); }
.text-rejected { color: var(--color-rejected); }

/* ========== BACKGROUND UTILITIES ========== */
.bg-status-pending { background: var(--color-pending-bg-solid); }
.bg-status-approved { background: var(--color-approved-bg-solid); }
.bg-status-rejected { background: var(--color-rejected-bg-solid); }
