/* ═══════════════════════════════════════ */
/* ISSUES PAGE STYLES - IMPROVED           */
/* ═══════════════════════════════════════ */

.issues-page { }

/* Toolbar */
.issues-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.issues-toolbar-left { display: flex; gap: 8px; align-items: center; }
.issues-toolbar-right { display: flex; gap: 8px; }
.issues-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 9px 16px;
    min-width: 260px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.issues-search:focus-within {
    border-color: #0b3eae;
    box-shadow: 0 0 0 3px rgba(11,62,174,0.08);
}
.issues-search i { color: #94a3b8; font-size: 13px; }
.issues-search input {
    border: none; outline: none; background: transparent;
    font-size: 14px; color: #1e293b; width: 100%;
}
.issues-search input::placeholder { color: #cbd5e1; }

/* Tabs */
.issues-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}
.issues-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s;
    border-radius: 6px 6px 0 0;
}
.issues-tab:hover { color: #0b3eae; background: #f8fafc; }
.issues-tab.active {
    color: #0b3eae;
    background: #fff;
}
.issues-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0; right: 0;
    height: 2px;
    background: #0b3eae;
    border-radius: 2px 2px 0 0;
}
.issues-tab-content { display: none; }
.issues-tab-content.active { display: block; }

/* Filters Bar */
.issues-filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    background: #f8fafc;
    min-width: 130px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-group select:focus { border-color: #0b3eae; box-shadow: 0 0 0 2px rgba(11,62,174,0.1); background: #fff; }
.btn-clear-filters {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}
.btn-clear-filters:hover { background: #fee2e2; color: #dc2626; border-color: #fecaca; }

/* Issues Table */
.issues-list-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.issues-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.issues-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.issues-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.12s;
}
.issues-table tbody tr:hover { background: #f0f4ff; }
.issues-table tbody tr:last-child { border-bottom: none; }
.issues-table tbody td {
    padding: 12px 16px;
    color: #334155;
    vertical-align: middle;
}
.col-id { width: 50px; color: #94a3b8 !important; font-weight: 600; font-size: 12px; }
.col-tracker { width: 95px; }
.col-subject { }
.col-status { width: 110px; }
.col-priority { width: 95px; }
.col-assignee { width: 140px; }
.col-updated { width: 100px; font-size: 12px; color: #94a3b8 !important; }

.issue-subject-link {
    color: #1e293b;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.12s;
}
.issue-subject-link:hover { color: #0b3eae; text-decoration: underline; }

/* Badges */
.issue-tracker-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tracker-bug { background: #fee2e2; color: #991b1b; }
.tracker-feature { background: #dcfce7; color: #166534; }
.tracker-task { background: #dbeafe; color: #1e40af; }
.tracker-support { background: #fef3c7; color: #92400e; }
.tracker-improvement { background: #f3e8ff; color: #6b21a8; }
.tracker-default { background: #f1f5f9; color: #475569; }

.issue-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.issue-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}
.priority-immediate { color: #dc2626; }
.priority-urgent { color: #ea580c; }
.priority-high { color: #d97706; }
.priority-normal { color: #475569; }
.priority-low { color: #94a3b8; }

/* Empty State */
.issues-empty-state {
    text-align: center;
    padding: 70px 20px;
    color: #94a3b8;
}
.issues-empty-state i { font-size: 56px; color: #cbd5e1; margin-bottom: 20px; display: block; }
.issues-empty-state h4 { margin: 0 0 8px; font-size: 18px; color: #64748b; }
.issues-empty-state p { margin: 0 0 24px; font-size: 14px; }

/* Board View */
.issues-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 400px;
}
.board-column {
    min-width: 270px;
    max-width: 310px;
    flex: 1;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}
.board-column-header {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.board-column-count {
    background: #e2e8f0;
    color: #64748b;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.board-column-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.board-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.board-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.board-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.4;
}
.board-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #94a3b8;
}
.board-card-id { font-weight: 600; }

/* Summary View */
.issues-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.summary-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.summary-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.summary-card h4 i { color: #0b3eae; }
.summary-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 13px;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}
.summary-stat-row:last-child { border-bottom: none; }
.summary-stat-value { font-weight: 700; color: #1e293b; }
.summary-big-number {
    font-size: 40px;
    font-weight: 800;
    color: #0b3eae;
    text-align: center;
    padding: 20px 0;
}

/* ═══════════════════════════════════════ */
/* Issue Create/Edit Modal                 */
/* ═══════════════════════════════════════ */
.issue-modal-dialog {
    max-width: 780px;
    width: 95%;
}

.issue-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}
.issue-form-row .form-group {
    margin-bottom: 16px;
}

.required-star {
    color: #ef4444;
    font-weight: 400;
}

.issue-done-slider-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.issue-done-slider-wrap input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
}
.issue-done-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0b3eae;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.issue-done-label {
    font-size: 13px;
    font-weight: 600;
    color: #0b3eae;
    min-width: 36px;
    text-align: right;
}

/* ═══════════════════════════════════════ */
/* Attachment Upload                        */
/* ═══════════════════════════════════════ */
.issue-attachments-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    background: #fafbfc;
    transition: all 0.2s;
    cursor: pointer;
}
.issue-attachments-upload-area:hover,
.issue-attachments-upload-area.dragover {
    border-color: #0b3eae;
    background: #f0f4ff;
}
.issue-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px 20px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}
.issue-dropzone-content i {
    font-size: 28px;
    color: #94a3b8;
    margin-bottom: 4px;
}
.issue-dropzone-content small {
    color: #94a3b8;
    font-size: 11px;
}
.issue-dropzone-content strong {
    color: #0b3eae;
}

.issue-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.issue-attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    transition: background 0.12s;
}
.issue-attachment-item:hover {
    background: #f1f5f9;
}
.issue-attachment-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #eef2ff;
    color: #0b3eae;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.issue-attachment-icon.img-preview {
    background: none;
    overflow: hidden;
}
.issue-attachment-icon.img-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}
.issue-attachment-info {
    flex: 1;
    min-width: 0;
}
.issue-attachment-name {
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.issue-attachment-size {
    font-size: 11px;
    color: #94a3b8;
}
.issue-attachment-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.12s;
    font-size: 13px;
}
.issue-attachment-remove:hover {
    color: #ef4444;
    background: #fee2e2;
}
.issue-attachment-progress {
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}
.issue-attachment-progress-bar {
    height: 100%;
    background: #0b3eae;
    border-radius: 2px;
    transition: width 0.3s;
}

/* Attachment download link in detail view */
.issue-attachment-download {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    color: #334155;
    transition: all 0.12s;
    cursor: pointer;
}
.issue-attachment-download:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #0b3eae;
}

/* ═══════════════════════════════════════ */
/* Issue Detail Modal                       */
/* ═══════════════════════════════════════ */
.issue-detail-dialog {
    max-width: 920px;
    width: 95%;
    max-height: 90vh;
}

.issue-detail-layout {
    display: flex;
    min-height: 400px;
}
.issue-detail-main {
    flex: 1;
    padding: 28px;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
}
.issue-detail-sidebar {
    width: 270px;
    padding: 24px;
    background: #f8fafc;
    flex-shrink: 0;
    overflow-y: auto;
}
.issue-detail-field {
    margin-bottom: 16px;
}
.issue-detail-field-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.issue-detail-field-value {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
}
.issue-detail-description {
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
    margin-bottom: 28px;
    white-space: pre-wrap;
    padding: 16px;
    background: #fafbfc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
}
.issue-detail-description:empty {
    padding: 20px;
    text-align: center;
}
.issue-detail-description:empty::after {
    content: 'No description provided.';
    color: #94a3b8;
    font-style: italic;
}

/* Attachments section in detail */
.issue-detail-attachments {
    margin-bottom: 24px;
}
.issue-detail-attachments-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.issue-detail-attachments-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Comments */
.issue-comments-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
}
.issue-comments-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.issue-comment {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}
.issue-comment:last-of-type { border-bottom: none; }
.issue-comment-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eef2ff;
    color: #0b3eae;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.issue-comment-body { flex: 1; }
.issue-comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}
.issue-comment-author { font-size: 13px; font-weight: 600; color: #1e293b; }
.issue-comment-time { font-size: 11px; color: #94a3b8; }
.issue-comment-content {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    white-space: pre-wrap;
}
.issue-add-comment {
    margin-top: 16px;
}
.issue-add-comment textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.issue-add-comment textarea:focus {
    outline: none;
    border-color: #0b3eae;
    box-shadow: 0 0 0 3px rgba(11,62,174,0.08);
}
.issue-add-comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

/* Add comment attachment area */
.issue-comment-attachment-area {
    margin-top: 8px;
}
.issue-comment-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.12s;
}
.issue-comment-attach-btn:hover {
    border-color: #0b3eae;
    color: #0b3eae;
    background: #f0f4ff;
}

/* Progress bar */
.issue-progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}
.issue-progress-bar-fill {
    height: 100%;
    background: #10b981;
    border-radius: 3px;
    transition: width 0.3s;
}

@media (max-width: 768px) {
    .issues-toolbar { flex-direction: column; }
    .issues-filters-bar { flex-direction: column; }
    .issue-detail-layout { flex-direction: column; }
    .issue-detail-sidebar { width: 100%; border-right: none; border-top: 1px solid #e2e8f0; }
    .issues-board { flex-direction: column; }
    .board-column { max-width: 100%; min-width: 100%; }
    .issue-form-row { flex-direction: column; gap: 0; }
    .issue-modal-dialog { max-width: 100%; }
    .issue-detail-dialog { max-width: 100%; }
}