/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root {
    --bg-color: #f7f9fc;
    --text-primary: #1a1c21;
    --text-secondary: #878a99;
    --border-color: #eff2f7;
    --white: #ffffff;
    --primary-color: #0ab39c;
    --primary-hover: #089d89;
    --danger-color: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

/* ==========================================================================
   2. LAYOUT & NAVIGATION
   ========================================================================== */

/* Top Navbar */
.top-navbar {
    background: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    height: 64px;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-left .hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.nav-left .hamburger-btn:hover {
    color: var(--text-primary);
}

.nav-left .logo {
    text-decoration: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: #ffffff;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.close-sidebar-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.close-sidebar-btn:hover {
    color: var(--text-primary);
}

.sidebar-menu {
    list-style: none;
    padding: 16px;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: #ecfdf3;
    color: var(--primary-color);
}

/* Main Dashboard Container */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 24px 24px;
}

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

.main-header h1 {
    font-size: 20px;
    font-weight: 600;
}

/* ==========================================================================
   3. UI COMPONENTS (BUTTONS & BADGES)
   ========================================================================== */

/* Buttons */
.icon-btn,
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid #dcdfe4;
    padding: 8px 16px;
    border-radius: 4px;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn {
    padding: 8px;
    color: #878a99;
}

.action-btn:hover,
.icon-btn:hover {
    background-color: #f3f6f9;
}

.icon-btn-plain,
.action-btn-plain {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    /* Slightly darker than secondary */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.icon-btn-plain:hover,
.action-btn-plain:hover {
    color: var(--text-primary);
    background-color: #f1f5f9;
}

.action-btn-plain.loading {
    opacity: 0.5;
    pointer-events: none;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

.btn-mark {
    background: none;
    border: 1px solid #d1d5db;
    cursor: pointer;
    color: #374151;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
}

.btn-mark:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.btn-mark.disabled {
    opacity: 1;
    cursor: default;
    background-color: #c4c7ca;
    color: #6a717a;
    border-color: #bbc1c9;
    font-weight: 600;
}

.btn-download-all {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download-all:hover {
    background-color: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
}

.renew-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.renew-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 179, 156, 0.25);
}

.download-btn {
    width: 100%;
    justify-content: center;
    padding: 10px;
    font-size: 14px;
}

/* Badges */
.id-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    display: inline-block;
    border: 1px solid;
    /* Red (Pending) Default */
    background-color: #ebcbcb;
    color: #991b1b;
    border-color: #faa0a0;
}

.id-badge.completed {
    background-color: #d2fde4;
    color: #027a48;
    border-color: #d0f5df;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 12px;
    letter-spacing: -0.01em;
}

.user-profile .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.user-profile .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   4. TABLES & DATA DISPLAY
   ========================================================================== */

/* Table Card */
.table-card {
    background: var(--white);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(56, 65, 74, 0.15);
    overflow: hidden;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.orders-table th {
    padding: 16px 24px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    background-color: #fcfcfc;
}

.orders-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.orders-table tbody tr:last-child td {
    border-bottom: none;
}

.text-right {
    text-align: right;
}

.actions {
    display: flex;
    gap: 12px;
}

/* ==========================================================================
   5. MODALS & POPOVERS
   ========================================================================== */

/* Order Details Popover */
.details-popover {
    position: absolute;
    z-index: 9999 !important;
    /* Always on top */
    width: 340px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: none;
    /* Toggled via JS */
    flex-direction: column;
    padding: 0;
    transition: opacity 0.1s ease-out;
}

.details-popover.active {
    display: flex !important;
}

.details-popover .modal-body {
    padding: 16px;
}

.details-popover .modal-header {
    padding: 16px 16px 0;
}

/* Generic Custom Modal Overlay (Used for Logout, etc.) */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.custom-modal-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform: translateY(0);
    animation: slideUp 0.3s ease-out;
}

.modal-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.modal-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-btn.secondary {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.modal-btn.secondary:hover {
    background: #e2e8f0;
}

.modal-btn.primary {
    background: var(--primary-color);
    /* Fixed var name */
    color: white;
}

.modal-btn.primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* QR Modal Specifics */
.qr-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-overlay.active {
    opacity: 1;
    visibility: visible;
}

.qr-card {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.qr-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.qr-frame {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: inline-block;
    border: 1px solid #e2e8f0;
}

.qr-frame img {
    width: 150px;
    height: 150px;
    display: block;
}

.qr-modal-open .qr-card {
    transform: scale(1);
    opacity: 1;
}

.close-qr-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

/* Expired Plan Overlay */
.expired-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.expired-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
}

.expired-icon {
    background: #fef2f2;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
}

.expired-card h2 {
    font-size: 24px;
    color: #1a1c21;
    margin-bottom: 12px;
}

.expired-card p {
    color: #64748b;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* ==========================================================================
   6. FILE LIST & INFO DISPLAY
   ========================================================================== */

/* File List in Modals/Popovers */
.file-list-container {
    border-radius: 8px;
    padding: 5px;
    max-height: 240px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: background-color 0.2s;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-item:hover {
    background: #f1f5f9;
}

.file-icon {
    width: 32px;
    height: 32px;
    background: #e0f2fe;
    color: #0284c7;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   7. ANIMATIONS & UTILITIES
   ========================================================================== */

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0ab39c;
    border-radius: 50%;
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* Date Picker Invisible Overlay Hack */
.full-cover-date-input {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 10;
    cursor: pointer;
}

.full-cover-date-input::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

/* ==========================================================================
   8. RESPONSIVE DESIGN
   ========================================================================== */

/* Print Modal File Button */
.file-print-btn {
    padding: 6px;
    color: #475569;
    background: #f1f5f9;
    border-radius: 6px;
    border: 2px solid #e3e6eb;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-print-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.file-print-btn:active {
    transform: translateY(0);
    background: #cbd5e1;
    box-shadow: none;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 2s linear infinite;
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 0 16px 16px 16px;
    }

    .modal-card,
    .custom-modal-card {
        width: 95%;
        max-height: 95vh;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
    }
}

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

.toast {
    background: white;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid var(--primary-color);
}

.toast.toast-error {
    border-left-color: var(--danger-color);
}

.toast.toast-warning {
    border-left-color: #f59e0b;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.toast-content small {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 4px;
}

.toast.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* ==========================================================================
   SKELETON LOADERS
   ========================================================================== */

.skeleton-row {
    height: 60px;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.skeleton-row td {
    padding: 12px 16px;
}

.skeleton-box {
    display: inline-block;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    height: 16px;
}

.skeleton-box.skeleton-id {
    width: 60px;
    height: 20px;
}

.skeleton-box.skeleton-action {
    width: 80px;
    height: 32px;
    border-radius: 6px;
}

.skeleton-box.skeleton-summary {
    width: 150px;
}

.skeleton-box.skeleton-mode {
    width: 70px;
    height: 24px;
    border-radius: 12px;
}

.skeleton-box.skeleton-mark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==========================================================================
   EXTRACTED INLINE STYLES
   ========================================================================== */

/* Logo Text in Sidebar */
.logo-text {
    text-decoration: none;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1px;
    color: #1e293b;
}

.logo-text .accent {
    color: #0ab39c;
}

/* Sidebar Footer Item (Logout) */
.sidebar-footer-item {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-footer-item a {
    color: #ff8f8f;
}

/* Modal Card Compact (Order Details Popover) */
.modal-card-compact {
    text-align: left;
    max-width: 100%;
    box-shadow: none;
    border: none;
    padding: 12px;
    border-radius: 12px;
}

.modal-body-compact {
    padding: 0;
}

/* Print Modal Specific Styles */
#print-modal {
    width: 450px;
}

.print-modal-card {
    text-align: left;
    max-width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 12px;
    background: white;
}

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

.print-modal-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1c21;
}

.print-modal-subtitle {
    margin: 2px 0 0;
    font-size: 11px;
    color: #64748b;
}

/* Details Header */
.details-header {
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.details-date {
    font-size: 13px;
    color: #1a1c21;
    font-weight: 500;
}

/* Download Section */
.download-section {
    margin-top: 12px;
    border-top: 1px solid #eff2f7;
    padding-top: 12px;
}

.btn-full-width {
    width: 100%;
    justify-content: center;
}

/* Close Button Variants */
.close-btn-sm {
    padding: 2px;
}

.close-btn-md {
    padding: 4px;
    color: #64748b;
}

/* High Z-Index for Print Modal */
.z-index-high {
    z-index: 9999;
}

/* ==========================================================================
   OFFLINE BANNER
   ========================================================================== */

.offline-banner {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    animation: slideDown 0.3s ease-out;
}

.offline-banner svg {
    flex-shrink: 0;
    stroke: #92400e;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   SEARCH INPUT
   ========================================================================== */

.search-container {
    position: relative;
    display: inline-block;
    margin-right: 12px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    padding: 8px 12px 8px 38px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    width: 220px;
    transition: all 0.2s ease;
    background: white;
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(10, 179, 156, 0.1);
    width: 280px;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    margin-top: 16px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn svg {
    flex-shrink: 0;
}

.page-indicator {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 100px;
    text-align: center;
}

/* ==========================================================================
   MODAL POPOVER POSITIONING FIX
   ========================================================================== */
.details-popover {
    position: absolute;
    /* top/left will be set by JS */
    z-index: 9999;

    /* Start hidden and removed from layout */
    display: none;
    opacity: 0;

    pointer-events: none;
}

.details-popover.active {
    display: block;
    /* Ensure it is part of layout */
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transition: opacity 0.15s ease;
}

.z-index-high {
    z-index: 10000;
}

/* ==========================================================================
   SEARCH CLEAR BUTTON 
   ========================================================================== */
#search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 5;
}

#search-clear-btn:hover {
    color: #ef4444;
    background-color: #f1f5f9;
}

#search-clear-btn svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

/* Ensure input has space for the button */
.search-input {
    padding-right: 40px !important;
}