/* ==========================================
   TICKET RISER - Main Stylesheet
   Color Scheme: White & Light Green
   ========================================== */

:root {
    --primary: #2ecc71;
    --primary-dark: #27ae60;
    --primary-light: #f0fdf4;
    --primary-border: #bbf7d0;
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f0fdf4;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --sidebar-bg: linear-gradient(180deg, #064e3b 0%, #065f46 40%, #047857 100%);
    --sidebar-width: 260px;
    --header-height: 70px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    font-size: 14px;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ==========================================
   LAYOUT
   ========================================== */

.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon { font-size: 24px; }
.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: white;
    flex-shrink: 0;
}

.user-info { overflow: hidden; }
.user-name {
    font-size: 14px; font-weight: 600;
    color: white;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role-badge {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: rgba(46,204,113,0.25);
    color: white;
    border-left: 3px solid var(--primary);
}

.nav-icon { font-size: 18px; flex-shrink: 0; }
.nav-text { flex: 1; }

.nav-badge {
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

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

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: var(--transition);
    cursor: pointer;
}
.logout-btn:hover { background: rgba(239,68,68,0.2); color: #fca5a5; }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ==========================================
   HEADER
   ========================================== */

.main-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left { display: flex; align-items: center; gap: 16px; }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}
.hamburger span {
    width: 22px; height: 2px;
    background: var(--text-primary);
    display: block;
    transition: var(--transition);
    border-radius: 2px;
}
.hamburger:hover span { background: var(--primary); }

.page-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 12px; color: var(--text-muted); }

.header-right { display: flex; align-items: center; gap: 12px; }

.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.role-badge.manager { background: #fef3c7; color: #92400e; }
.role-badge.developer { background: #dbeafe; color: #1e40af; }

.header-user { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(46,204,113,0.3); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-success { background: #10b981; color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.w-full { width: 100%; }
.mt-10 { margin-top: 10px; }

/* ==========================================
   SECTION HEADER
   ========================================== */

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

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================
   STATS GRID
   ========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    border-top: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon { font-size: 28px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); }
.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ==========================================
   PROJECT CARDS
   ========================================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.project-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.project-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-border); transform: translateY(-2px); }

.project-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.project-icon { font-size: 32px; flex-shrink: 0; }

.project-info { flex: 1; }
.project-info h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.project-info p { font-size: 13px; color: var(--text-muted); line-height: 1.4; }

.dev-badge {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ticket-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.ts-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px;
    border-right: 1px solid var(--border);
    gap: 2px;
}
.ts-item:last-child { border-right: none; }
.ts-val { font-size: 18px; font-weight: 800; }
.ts-lbl { font-size: 10px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; }
.ts-item.pending .ts-val { color: #f59e0b; }
.ts-item.solved .ts-val { color: #10b981; }
.ts-item.renewed .ts-val { color: #3b82f6; }

.project-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================
   TICKET CARDS
   ========================================== */

.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.ticket-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ticket-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

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

.ticket-id {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-family: monospace;
}

.ticket-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.ticket-project {
    font-size: 12px;
    color: var(--primary-dark);
    font-weight: 500;
}

.ticket-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.ticket-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.ticket-media-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.media-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.media-badge.img { background: #fef3c7; color: #92400e; }
.media-badge.vid { background: #ede9fe; color: #6d28d9; }
.media-badge.doc { background: #dbeafe; color: #1e40af; }

/* ==========================================
   STATUS BADGES
   ========================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.solved { background: #d1fae5; color: #065f46; }
.status-badge.renewed { background: #dbeafe; color: #1e3a8a; }
.status-badge.active { background: #d1fae5; color: #065f46; }
.status-badge.inactive { background: #fee2e2; color: #991b1b; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* ==========================================
   TABLES
   ========================================== */

.table-wrap {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

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

.data-table thead { background: var(--bg-tertiary); }
.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-tertiary); }

.table-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white;
    flex-shrink: 0;
}

.code-badge {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 12px;
}

.action-btns { display: flex; gap: 4px; flex-wrap: wrap; }

/* ==========================================
   FORMS
   ========================================== */

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    background: white;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46,204,113,0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.flex-2 { grid-column: span 2; }

/* ==========================================
   MODALS
   ========================================== */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 960px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.modal-close:hover { background: #fee2e2; color: #dc2626; }

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

/* Confirm Modal */
.confirm-body {
    text-align: center;
    padding: 32px 24px !important;
}
.confirm-icon { font-size: 48px; margin-bottom: 12px; }
.confirm-body h3 { font-size: 18px; margin-bottom: 8px; }
.confirm-body p { color: var(--text-muted); font-size: 14px; }

/* ==========================================
   FILE UPLOAD
   ========================================== */

.upload-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 8px;
}

.upload-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border);
}

.upload-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.upload-icon { font-size: 20px; }
.upload-section-header h4 { font-size: 14px; font-weight: 700; flex: 1; }
.upload-section-header small { color: var(--text-muted); font-size: 11px; }

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.drop-zone-inner { pointer-events: none; }
.drop-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.drop-zone p { font-size: 13px; color: var(--text-muted); }

.browse-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    pointer-events: all;
}

.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.preview-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 90px;
}

.preview-img {
    width: 80px; height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}

.preview-video-placeholder {
    width: 80px; height: 80px;
    background: #1e293b;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
}

.preview-name {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-remove {
    position: absolute;
    top: -6px; right: 0;
    width: 18px; height: 18px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}

.preview-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }

.preview-doc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 13px;
}
.preview-size { color: var(--text-muted); font-size: 11px; margin-left: auto; }

/* ==========================================
   FILTERS BAR
   ========================================== */

.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group .form-input {
    width: auto;
    min-width: 160px;
    padding: 8px 12px;
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-btn {
    width: 36px; height: 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    color: var(--text-muted);
}
.view-btn.active, .view-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* ==========================================
   TICKET DETAIL
   ========================================== */

.ticket-detail-layout { display: flex; flex-direction: column; gap: 20px; }

.td-meta-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.td-meta-item { display: flex; flex-direction: column; gap: 4px; }
.td-meta-item label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; }
.td-meta-item span { font-size: 14px; font-weight: 600; }

.td-details {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border);
}
.td-details h4 { font-size: 14px; margin-bottom: 10px; }
.td-details p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* ==========================================
   MEDIA SECTIONS
   ========================================== */

.media-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.media-section-header {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}
.media-section-header h4 { font-size: 14px; font-weight: 700; flex: 1; }
.media-count {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 12px;
}

.media-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    padding: 16px;
}

.media-thumb {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
    border: 2px solid var(--border);
    transition: var(--transition);
}
.media-thumb:hover { border-color: var(--primary); }
.media-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.media-thumb:hover img { transform: scale(1.05); }

.thumb-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: var(--transition);
    color: white; font-size: 13px;
}
.media-thumb:hover .thumb-overlay { opacity: 1; }

.thumb-download {
    position: absolute;
    bottom: 4px; right: 4px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    transition: var(--transition);
    z-index: 2;
}
.thumb-download:hover { background: var(--primary); }

.video-thumb { background: #1e293b; }

.video-placeholder {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px;
}
.play-btn {
    font-size: 28px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    transition: var(--transition);
}
.video-thumb:hover .play-btn { background: var(--primary); }
.video-name { font-size: 10px; color: rgba(255,255,255,0.7); text-align: center; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }

.doc-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }

.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.doc-item:hover { border-color: var(--primary-border); background: var(--primary-light); }
.doc-icon { font-size: 24px; flex-shrink: 0; }
.doc-info { flex: 1; }
.doc-info strong { display: block; font-size: 13px; }
.doc-info small { color: var(--text-muted); font-size: 11px; }

/* ==========================================
   LIGHTBOX
   ========================================== */

.lightbox {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}
.lightbox.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.lightbox-close {
    position: absolute;
    top: 16px; right: 20px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    z-index: 1;
}
.lightbox-close:hover { background: rgba(239,68,68,0.6); }

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex; align-items: center; justify-content: center;
}
.lightbox-content img, .lightbox-content video {
    max-width: 100%; max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* ==========================================
   DEVELOPER ASSIGN MODAL
   ========================================== */

.assign-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.assign-col h4 { font-size: 14px; margin-bottom: 10px; }

.assign-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.assign-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
}
.assign-item.assigned { background: #d1fae5; border-color: #6ee7b7; }
.assign-item.available { background: var(--bg-secondary); }

/* ==========================================
   DETAIL PANEL
   ========================================== */

.detail-desc {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ds-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.ds-item span { display: block; font-size: 22px; font-weight: 800; }
.ds-item label { font-size: 11px; color: var(--text-muted); }
.ds-item.pending span { color: #f59e0b; }
.ds-item.solved span { color: #10b981; }
.ds-item.renewed span { color: #3b82f6; }

.dev-list { display: flex; flex-direction: column; gap: 8px; }
.dev-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.dev-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}
.dev-item > div { flex: 1; }
.dev-item strong { display: block; font-size: 13px; }
.dev-item small { color: var(--text-muted); font-size: 11px; }

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

#toast-container {
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 500;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid;
}

.toast.show { transform: translateX(0); opacity: 1; }

.toast-success {
    background: white;
    border-left-color: #10b981;
    color: var(--text-primary);
}
.toast-error {
    background: white;
    border-left-color: #ef4444;
    color: var(--text-primary);
}

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg { flex: 1; }
.toast-close {
    background: none; border: none;
    cursor: pointer; color: var(--text-muted);
    font-size: 14px; padding: 0 2px;
}

/* ==========================================
   LOADING & EMPTY STATES
   ========================================== */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 12px;
    grid-column: 1 / -1;
    width: 100%;
}

.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.mini-loader {
    width: 24px; height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
    grid-column: 1 / -1;
}
.empty-icon { font-size: 56px; }
.empty-state h3 { font-size: 18px; color: var(--text-primary); font-weight: 700; }
.empty-state p { font-size: 14px; max-width: 300px; }

.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    min-height: 110px;
    border-top: 4px solid #e0e0e0 !important;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* ==========================================
   UTILITIES
   ========================================== */

.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ==========================================
   RESPONSIVE - TABLET
   ========================================== */

@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .flex-2 { grid-column: auto; }
    .assign-columns { grid-template-columns: 1fr; }
}

/* ==========================================
   RESPONSIVE - MOBILE
   ========================================== */

@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }

    .sidebar {
        transform: translateX(-260px);
        width: 260px;
        z-index: 1001;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-close { display: flex; }
    .sidebar-overlay.active { display: block; }

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

    .hamburger { display: flex; }

    .main-header { padding: 0 16px; }
    .content { padding: 16px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 22px; }

    .projects-grid,
    .tickets-grid {
        grid-template-columns: 1fr;
    }

    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-group { width: 100%; }
    .filter-group .form-input { flex: 1; }
    .view-toggle { justify-content: flex-end; }

    .modal { max-width: 100%; max-height: 95vh; }
    .modal-xl, .modal-lg { max-width: 100%; }

    .detail-stats { grid-template-columns: repeat(2, 1fr); }
    .td-meta-row { grid-template-columns: repeat(2, 1fr); }

    .upload-sections { gap: 12px; }

    .table-wrap { overflow-x: auto; }

    #toast-container { bottom: 10px; right: 10px; left: 10px; max-width: none; }

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

    .header-user { display: none; }
    .role-badge { font-size: 10px; }

    .action-btns { flex-direction: column; }

    .ticket-stats-row { grid-template-columns: repeat(2, 1fr); }
    .ts-item:nth-child(2) { border-right: 1px solid var(--border); }
    .ts-item:nth-child(3) { border-right: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 12px; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .modal-body { padding: 16px; }
    .modal-header { padding: 14px 16px; }
    .modal-footer { padding: 12px 16px; }
}

/* ==========================================
   PRINT
   ========================================== */
@media print {
    .sidebar, .main-header, .filters-bar, .btn { display: none !important; }
    .main-wrapper { margin-left: 0; }
    .content { padding: 0; }
}