/* ==========================================================================
   REPORTS OVERVIEW – Styles
   ========================================================================== */

/* ---- Attachment pill badges ---- */
.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.attach-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
    white-space: nowrap;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: none;
    outline: none;
}

.attach-badge:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.attach-badge.badge-pdf {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.attach-badge.badge-pdf i {
    color: #dc2626;
}

.attach-badge.badge-excel {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.attach-badge.badge-excel i {
    color: #16a34a;
}

.attach-badge.badge-other {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .attach-badge.badge-pdf {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.4);
}

[data-theme="dark"] .attach-badge.badge-excel {
    background: rgba(22, 163, 74, 0.15);
    border-color: rgba(22, 163, 74, 0.4);
}

/* ---- No attachments placeholder ---- */
.no-attach {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

/* ---- Reports modal specific ---- */
#report-modal .modal-content1 {
    max-width: 720px;
}

/* File upload zone */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--bg-color);
    position: relative;
}

.file-upload-zone:hover,
.file-upload-zone.drag-over {
    border-color: var(--accent-color);
    background: rgba(9, 132, 227, 0.04);
}

.file-upload-zone i {
    font-size: 2rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.file-upload-zone p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

.file-upload-zone strong {
    color: var(--accent-color);
}

.file-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Existing attachments in edit mode */
.existing-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.existing-attach-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-size: 0.82rem;
    color: var(--text-main);
}

.existing-attach-item button.remove-attach-btn {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.9rem;
    line-height: 1;
    transition: transform 0.15s;
}

.existing-attach-item button.remove-attach-btn:hover {
    transform: scale(1.2);
}

/* ---- Attachment Viewer Modal ---- */
#attachment-viewer-modal .modal-content1 {
    max-width: 900px;
    max-height: 92vh;
    width: 95%;
}

.attachment-viewer-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    flex-grow: 1;
    overflow: hidden;
}

.viewer-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.viewer-iframe-wrapper {
    flex-grow: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #fff;
    min-height: 500px;
    position: relative;
}

.viewer-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.viewer-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.viewer-loading i {
    font-size: 2rem;
}

.btn-download {
    background: #16a34a;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: filter 0.15s, transform 0.15s;
    font-size: 0.85rem;
}

.btn-download:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-gdocs {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: filter 0.15s, transform 0.15s;
    font-size: 0.85rem;
}

.btn-gdocs:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ---- Category pill in table ---- */
.category-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

[data-theme="dark"] .category-pill {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
}

/* ---- Report name cell ---- */
.report-name-cell {
    font-weight: 600;
    color: var(--text-main);
}

.report-desc-cell {
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Delete confirm style ---- */
.btn-delete-report {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.15s;
}

.btn-delete-report:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(239,68,68,0.3);
}

.btn-edit-report {
    background: rgba(9, 132, 227, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(9, 132, 227, 0.25);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.15s;
    margin-right: 5px;
}

.btn-edit-report:hover {
    background: rgba(9, 132, 227, 0.2);
}

.report-actions-cell {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* ---- New attachment count badge for table icon ---- */
.attach-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg-color);
    border: 1px solid var(--border-color);

/* ==========================================================================
   SIDEBAR FLYOUT FOR REPORTS – FORCED OVERRIDE
   ========================================================================== */
.sidebar-group .sidebar-submenu {
    position: absolute !important;
    left: calc(100% + 15px) !important;
    top: 0 !important;
    width: 240px !important;
    padding: 12px !important;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(25px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(10px) !important;
    pointer-events: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
}

.sidebar-group.open .sidebar-submenu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    pointer-events: auto !important;
}

.sidebar-subitem {
    margin-left: 0 !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
}
