/* ================================================
   DESIGN TOKENS
   ================================================ */
:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;

    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #3b82f6;
    --info-light: #eff6ff;

    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.08);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 256px;
    --navbar-height: 64px;
}

/* ================================================
   RESET & BASE
   ================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
}

a { color: inherit; text-decoration: none; transition: var(--transition); }

/* ================================================
   LAYOUT
   ================================================ */
.app-container { display: flex; flex-direction: column; min-height: 100vh; }

/* Navbar */
.navbar {
    height: var(--navbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.navbar-brand {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.brand-logo {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.navbar-user { display: flex; align-items: center; gap: 12px; }

.user-info { display: flex; flex-direction: column; align-items: flex-end; }
.user-name { font-size: 0.875rem; font-weight: 600; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

.user-avatar {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Main Layout */
.main-wrapper { display: flex; flex: 1; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
}

.sidebar-nav { display: flex; flex-direction: column; flex: 1; }
.sidebar-section { margin-bottom: 6px; }

.sidebar-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    padding: 12px 12px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
}

.nav-item:hover { background: var(--bg-app); color: var(--accent); }

.nav-item-active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.nav-icon { font-size: 1rem; flex-shrink: 0; }

.sidebar-footer { padding-top: 12px; border-top: 1px solid var(--border); margin-top: auto; }

.nav-item-logout { color: var(--danger) !important; }
.nav-item-logout:hover { background: var(--danger-light) !important; }

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 36px;
    max-width: 1400px;
    width: 100%;
}

/* ================================================
   PAGE HEADERS
   ================================================ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.page-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-top: 4px; }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb a { color: var(--accent); font-weight: 500; }
.breadcrumb a:hover { color: var(--accent-hover); }
.breadcrumb span { color: var(--text-light); }
.breadcrumb-current { color: var(--text-main); font-weight: 600; }

/* ================================================
   CARDS
   ================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.card-wide { max-width: 820px; margin-left: auto; margin-right: auto; }

/* ================================================
   STAT CARDS
   ================================================ */
.grid { display: grid; gap: 16px; margin-bottom: 24px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.stat-card {
    background: var(--bg-card);
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 6px;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.stat-number { font-size: 2rem; font-weight: 800; color: var(--primary); letter-spacing: -0.03em; }

.stat-card.stat-open { border-left: 3px solid var(--warning); }
.stat-card.stat-closed { border-left: 3px solid var(--success); }
.stat-card.stat-in-progress { border-left: 3px solid var(--accent); }

/* ================================================
   PROJECT CARDS
   ================================================ */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex; flex-direction: column; gap: 12px;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.project-card-header { display: flex; align-items: center; justify-content: space-between; }

.project-card-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--accent-light), #e0e7ff);
    color: var(--accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.8rem;
    letter-spacing: 0.04em;
}

.project-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.project-card-desc {
    font-size: 0.825rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
}

.project-card-stats {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.project-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.project-stat-number { font-size: 1.3rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.project-stat-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); }

.project-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.project-card-link { font-size: 0.8rem; font-weight: 600; color: var(--accent); }

/* Project Hero */
.project-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.project-hero-left { display: flex; align-items: flex-start; gap: 18px; }

.project-icon-large {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: white;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem;
    flex-shrink: 0;
}

.project-hero-title { font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.project-hero-desc { font-size: 0.875rem; color: var(--text-muted); margin-top: 4px; max-width: 480px; }
.project-hero-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ================================================
   BUTTONS
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(37,99,235,0.35); }

.btn-secondary { background: white; border-color: var(--border); color: var(--text-main); }
.btn-secondary:hover { background: var(--bg-app); border-color: var(--border-strong); }

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

/* ================================================
   TABLES
   ================================================ */
.table-container { width: 100%; overflow-x: auto; }

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

th {
    text-align: left;
    padding: 11px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

td {
    padding: 15px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--accent-light); }

/* ================================================
   BADGES
   ================================================ */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge-status-open { background: var(--warning-light); color: #92400e; }
.badge-status-in_progress { background: var(--info-light); color: #1e40af; }
.badge-status-review { background: #f3e8ff; color: #6b21a8; }
.badge-status-closed { background: var(--success-light); color: #065f46; }

.badge-priority-low { background: #f1f5f9; color: #475569; }
.badge-priority-medium { background: var(--info-light); color: #1e40af; }
.badge-priority-high { background: var(--warning-light); color: #92400e; }
.badge-priority-critical { background: var(--danger-light); color: #991b1b; }

.badge-type-bug { background: var(--danger-light); color: #991b1b; }
.badge-type-feature { background: var(--success-light); color: #065f46; }
.badge-type-task { background: var(--info-light); color: #1e40af; }

/* ================================================
   FORMS
   ================================================ */
.form-group { margin-bottom: 18px; }

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-main);
    transition: var(--transition);
    background: white;
    appearance: none;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea { min-height: 120px; resize: vertical; }
.is-invalid { border-color: var(--danger); }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }

.form-actions {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex; gap: 12px;
}

/* ================================================
   FILE UPLOAD
   ================================================ */
.file-upload-zone {
    position: relative;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: #fafbfc;
    transition: var(--transition);
    min-height: 140px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.file-upload-zone:hover, .file-upload-zone.dragging {
    border-color: var(--accent);
    background: var(--accent-light);
}

.file-upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100% !important;
    height: 100%;
    z-index: 2;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.file-upload-content {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 24px; text-align: center; pointer-events: none; z-index: 1;
}

.file-upload-icon { font-size: 2rem; }
.file-upload-text { font-size: 0.875rem; color: var(--text-muted); }
.file-upload-text strong { color: var(--accent); }
.file-upload-hint { font-size: 0.75rem; color: var(--text-light); }

.file-preview-container {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    position: relative; min-height: 140px;
}

.file-preview-img {
    max-height: 200px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.file-preview-remove {
    position: absolute;
    top: 10px; right: 10px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    z-index: 10;
}

.file-upload-compact { min-height: 80px; }
.file-upload-compact .file-upload-content { flex-direction: row; gap: 10px; padding: 16px; }

/* ================================================
   SCREENSHOT DISPLAY
   ================================================ */
.screenshot-container {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: zoom-in;
    border: 1px solid var(--border);
    background: #f8fafc;
    display: flex; align-items: center; justify-content: center;
}

.screenshot-img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
    transition: var(--transition);
}

.screenshot-overlay {
    position: absolute; inset: 0;
    background: rgba(15,23,42,0);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 600; font-size: 0.875rem;
    opacity: 0; transition: var(--transition);
}

.screenshot-container:hover .screenshot-overlay { background: rgba(15,23,42,0.45); opacity: 1; }
.screenshot-container:hover .screenshot-img { transform: scale(1.01); }

/* ================================================
   COMMENTS
   ================================================ */
.comments-list { display: flex; flex-direction: column; gap: 14px; }

.comment {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-app);
    border: 1px solid var(--border);
}

.comment-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}

.comment-author { font-weight: 700; font-size: 0.875rem; }
.comment-date { font-size: 0.72rem; color: var(--text-light); }
.comment-body { font-size: 0.875rem; color: var(--text-main); line-height: 1.6; }
.comment-own { background: var(--accent-light); border-color: #bfdbfe; }

/* ================================================
   ALERTS
   ================================================ */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }

/* ================================================
   INFO BOXES (Ticket Detail)
   ================================================ */
.info-box {
    padding: 13px;
    background: var(--bg-app);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.info-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-light);
    margin-bottom: 4px;
}

.info-value { font-weight: 600; color: var(--text-main); font-size: 0.875rem; }

.ticket-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
    align-items: start;
}

/* ================================================
   AVATAR
   ================================================ */
.avatar-xs {
    width: 24px; height: 24px;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ================================================
   EMPTY STATES
   ================================================ */
.empty-state {
    text-align: center;
    padding: 60px 32px;
}

.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }

/* ================================================
   UTILITIES
   ================================================ */
.text-main { color: var(--text-main); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }

/* ================================================
   PAGINATION
   ================================================ */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span {
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.8rem; font-weight: 600;
    background: white;
}
.pagination .active { background: var(--accent); color: white; border-color: var(--accent); }

/* ================================================
   AUTH PAGES
   ================================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #1e293b 50%, #312e81 100%);
    padding: 24px;
}

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

.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo { font-size: 3rem; margin-bottom: 16px; display: block; }
.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-bottom: 6px; letter-spacing: -0.02em; }
.auth-subtitle { font-size: 0.875rem; color: var(--text-muted); }
.auth-footer { margin-top: 24px; text-align: center; font-size: 0.875rem; color: var(--text-muted); }
.auth-footer a { color: var(--accent); font-weight: 600; }

/* ================================================
   HAMBURGER MENU
   ================================================ */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.hamburger:hover { background: var(--bg-app); }
.hamburger:active { background: var(--border); }

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.is-active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 199;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sidebar-overlay.is-visible {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Sidebar logout button styled as nav-item */
.sidebar-logout-btn {
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
}

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

/* Tablets and below */
@media (max-width: 1024px) {
    .ticket-detail-grid { grid-template-columns: 1fr; }
    .project-hero { flex-direction: column; }
}

/* Medium screens */
@media (max-width: 768px) {
    .hamburger { display: flex; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 200;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        padding-top: 20px;
    }

    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content { padding: 20px 16px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .project-grid { grid-template-columns: 1fr; }
    .project-hero-actions { flex-direction: column; width: 100%; }
    .project-hero-actions .btn { width: 100%; justify-content: center; }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-header .flex { width: 100%; }
    .page-header .btn { flex: 1; justify-content: center; }

    .card-header {
        flex-direction: column;
        gap: 10px;
    }

    /* Filter bars responsive */
    .flex.items-center.gap-4.flex-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .flex.items-center.gap-4.flex-wrap > div[style*="flex: 1"] {
        min-width: unset !important;
    }

    .filter-select, select[style*="width: auto"] {
        width: 100% !important;
    }

    /* Table mobile cards */
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    table { min-width: 600px; }

    .project-hero-left { flex-direction: column; align-items: flex-start; }

    .breadcrumb { flex-wrap: wrap; }
}

/* Small screens */
@media (max-width: 480px) {
    .navbar { padding: 0 12px; }
    .user-info { display: none; }

    .main-content { padding: 16px 12px; }

    .grid-4 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }

    .stat-card { padding: 16px; }
    .stat-number { font-size: 1.5rem; }

    .card { padding: 16px; }
    .card-wide { margin-left: 0; margin-right: 0; }

    .page-title { font-size: 1.3rem; }

    .auth-card { padding: 28px 20px; }
    .auth-title { font-size: 1.25rem; }

    .project-card { padding: 18px; }
    .project-card-stats { gap: 8px; }
    .project-stat-number { font-size: 1.1rem; }

    .project-hero { padding: 20px; }
    .project-hero-title { font-size: 1.2rem; }
    .project-icon-large { width: 48px; height: 48px; font-size: 0.85rem; }

    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; justify-content: center; }

    .btn { padding: 10px 16px; font-size: 0.85rem; }

    /* Comments */
    .comment { padding: 12px; }
    .comment-header { flex-direction: column; align-items: flex-start; gap: 4px; }

    /* Info boxes on ticket detail */
    .info-box { padding: 10px; }

    .empty-state { padding: 40px 16px; }
    .empty-state-icon { font-size: 2.5rem; }
}
