:root {
    --bg-color: #0c0c14;
    --sidebar-bg: rgba(20, 20, 30, 0.7);
    --card-bg: rgba(30, 30, 45, 0.6);
    --accent-primary: #7c4dff;
    --accent-secondary: #00e5ff;
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-blur: 15px;
}

body.light-mode {
    --bg-color: #f3f4f6;
    --sidebar-bg: rgba(255, 255, 255, 0.9);
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border-color: #e5e7eb;

    /* Override the dark gradient */
    background: var(--bg-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at top right, #1a1a2e, #0c0c14);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    height: calc(100vh - 35px);
    /* Adjust for Menu Bar */
    margin-top: 35px;
    /* Push down */
}

/* Menu Bar */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 35px;
    background: var(--card-bg);
    /* Use card bg for semi-transparency */
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 2000;
    font-size: 0.9rem;
    user-select: none;
}

.menu-item {
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    color: var(--text-secondary);
    transition: color 0.2s;
}



/* Global Search Overlay */
#search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 5000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    animation: fadeIn 0.1s ease-out;
}

.search-container {
    background: var(--bg-color);
    width: 600px;
    max-width: 90%;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-input-wrapper {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    color: var(--text-secondary);
    margin-right: 1rem;
    font-size: 1.2rem;
}

#global-search-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    outline: none;
}

#search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.1s;
}

.search-result-item:hover,
.search-result-item.selected {
    background: rgba(124, 77, 255, 0.1);
}

.search-icon-badge {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.menu-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 2001;
    border-radius: 0 0 8px 8px;
    padding: 0.5rem 0;
}

.menu-item:hover .dropdown-content {
    display: block;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-item i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 3rem;
    padding-left: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item i {
    margin-right: 1rem;
    font-size: 1.2rem;
}

/* Main Content & Section Management */
.main-content {
    flex: 1;
    margin-top: 35px;
    height: calc(100vh - 35px);
    overflow: hidden;
    /* Let view-sections handle their own scrolling */
    display: flex;
    flex-direction: column;
}

/* Debug HUD Styles */
#debug-hud div {
    margin-bottom: 2px;
}

/* Ensure active view is visible and correctly formatted */
.view-section {
    display: none;
    height: calc(100vh - 120px);
    /* Explicit height for sub-containers like FullCalendar */
    animation: fadeIn 0.3s ease-out;
    position: relative;
    overflow-y: auto;
    padding: 1.5rem;
}

#view-calendar {
    overflow: hidden;
    /* Prevent parent scrolling from conflicting with FullCalendar internal scroll */
}

/* Ensure FullCalendar grid is visible in dark mode */
:root {
    --fc-border-color: rgba(255, 255, 255, 0.15) !important;
    --fc-page-bg-color: transparent !important;
    --fc-neutral-bg-color: rgba(255, 255, 255, 0.05) !important;
}

.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
    border: 1px solid var(--fc-border-color) !important;
}

/* Force the calendar harness to fill its container */
.fc .fc-view-harness {
    min-height: 500px !important;
    flex-grow: 1;
}

.fc-scroller {
    overflow: hidden !important;
    /* Let FullCalendar handle its own scrolling internally */
}

body.debug-mode .view-section {
    border: 2px dashed #00ff00 !important;
}

body.debug-mode .view-section::before {
    content: attr(id);
    position: absolute;
    top: 5px;
    left: 5px;
    background: #00ff00;
    color: black;
    font-size: 10px;
    padding: 2px 5px;
    z-index: 1000;
    font-weight: bold;
}

/* Ensure active view is visible and correctly formatted */
#view-dashboard,
#view-appraisals,
#view-calendar,
#view-settings,
#view-debug,
#view-map {
    width: 100%;
}

#view-map {
    padding: 0;
    /* Map fills the whole area */
}

#map-container {
    width: 100%;
    height: 100%;
}

/* Dashboard View needs to be a grid itself to hold widgets */
#view-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    grid-gap: 2rem;
    align-content: start;
}

.header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header h2 {
    font-size: 2rem;
    font-weight: 700;
}

/* Widget Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(124, 77, 255, 0.3);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-content {
    color: var(--text-secondary);
}

/* List Items */
.list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item .time {
    font-size: 0.8rem;
    color: var(--accent-secondary);
    min-width: 60px;
}

.list-item .details {
    margin-left: 1rem;
}

/* Command Bar */
.command-bar {
    position: fixed;
    bottom: 2rem;
    left: calc(260px + 2rem);
    right: 2rem;
    z-index: 1000;
    /* Light Grey Theme */
    background: rgba(240, 242, 245, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
}

/* Specific override for input inside the light command bar */
.command-bar .command-input {
    color: #1f2937;
    /* Dark text */
}

.command-bar .command-input::placeholder {
    color: #6b7280;
    /* Grey placeholder */
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.5rem 1rem;
    outline: none;
}

/* Ensure dropdown options are visible */
select.command-input option {
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.command-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.command-btn:hover {
    background: var(--accent-secondary);
    color: var(--bg-color);
}

.command-btn.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.command-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

.pulse {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Modal Styling */
/* Modal Styling - Premium Glassmorphism */
.modal {
    display: none;
    position: fixed;
    z-index: 9000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    /* Lighter blackout for glass feel */
    backdrop-filter: blur(8px);
    align-items: center;
    /* Centering */
    justify-content: center;
    /* Centering */
}

.modal-content {
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.95), rgba(15, 15, 25, 0.98));
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid rgba(124, 77, 255, 0.2);
    /* Subtle purple border */
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 9001;
    pointer-events: auto;
    color: var(--text-primary);
}

/* GLOBAL FIX: Ensure ALL modal inputs are clickable */
.modal input,
.modal select,
.modal textarea,
.modal button {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10000 !important;
    cursor: text;
    -webkit-user-select: text !important;
    user-select: text !important;
}

.modal button {
    cursor: pointer;
}

.modal .modal-body {
    pointer-events: auto;
    position: relative;
    z-index: 9002;
}

/* Ensure no invisible overlay is blocking */
.modal::before,
.modal::after {
    pointer-events: none !important;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-content input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    outline: none;
    /* Force interaction */
    position: relative;
    z-index: 3002;
    pointer-events: auto;
}

.modal-content input:focus {
    border-color: var(--accent-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animations */
.fa-spin {
    animation: fa-spin 2s infinite linear;
}

.refresh-icon,
.add-icon {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.refresh-icon:hover,
.add-icon:hover {
    color: var(--accent-secondary);
    transform: rotate(90deg);
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(359deg);
    }
}

.list-item.completing {
    animation: completingOut 0.5s ease forwards;
}

.list-item.completing .details {
    text-decoration: line-through;
    opacity: 0.5;
}

@keyframes completingOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(20px);
        opacity: 0;
    }
}

/* Modal Body & Form */
.modal-body {
    padding: 1rem 0;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-body .command-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    padding: 0.8rem !important;
    border-radius: 8px !important;
    font-family: inherit !important;
    margin-bottom: 1rem;
    pointer-events: auto !important;
    position: relative !important;
}

#calendar-modal .modal-content {
    max-width: 600px;
}

/* Claim Detail Modal - Premium Design */
#claim-detail-modal .modal-content {
    pointer-events: auto;
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.98), rgba(15, 15, 25, 0.98));
}

#claim-detail-modal input,
#claim-detail-modal select,
#claim-detail-modal textarea,
#claim-detail-modal button {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 9999 !important;
}

#claim-detail-modal .tab-pane h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(124, 77, 255, 0.2);
    font-weight: 600;
}

#claim-detail-modal .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

#claim-detail-modal .info-item {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

#claim-detail-modal .info-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(124, 77, 255, 0.3);
}

#claim-detail-modal .info-item:focus-within {
    background: rgba(124, 77, 255, 0.05);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(124, 77, 255, 0.1);
}

#claim-detail-modal .info-item label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

#claim-detail-modal .info-item input,
#claim-detail-modal .info-item select {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.25rem 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    /* Ensure text input works */
    caret-color: var(--accent-primary);
    cursor: text;
    -webkit-user-select: text;
    user-select: text;
}

#claim-detail-modal .info-item input:focus,
#claim-detail-modal .info-item select:focus {
    outline: none;
    caret-color: var(--accent-secondary);
}

#claim-detail-modal .info-item input::placeholder {
    color: rgba(160, 160, 192, 0.4);
    font-weight: 400;
}

/* Ensure inputs are not disabled by any inherited styles */
#claim-detail-modal .info-item input:not([disabled]),
#claim-detail-modal .info-item select:not([disabled]) {
    opacity: 1;
    pointer-events: auto;
}

/* Save button styling */
#claim-detail-modal #save-overview-btn {
    background: linear-gradient(135deg, var(--accent-primary), #9c6dff);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
    transition: all 0.3s ease;
}

#claim-detail-modal #save-overview-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(124, 77, 255, 0.4);
}

/* Note Cards */
.note-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.note-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--accent-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.note-body {
    white-space: pre-wrap;
    line-height: 1.6;
    color: #e2e8f0;
}

.note-edit-btn,
.note-delete-btn {
    opacity: 0;
    transition: all 0.2s;
    cursor: pointer;
    color: var(--text-secondary);
}

.note-card:hover .note-edit-btn,
.note-card:hover .note-delete-btn {
    opacity: 1;
}

.note-edit-btn:hover {
    color: var(--accent-secondary);
}

.note-delete-btn:hover {
    color: #ef4444;
    /* Red color for delete */
}

/* Kanban Board Styling */
.board-container {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 1rem;
    padding-bottom: 2rem;
    height: calc(100vh - 160px);
    /* Adjust based on header/footer */
    /* JobNimbus-like Blue Background for the board area */
    background: linear-gradient(135deg, #1e40af 0%, #172554 100%);
    border-radius: 12px;
    border-radius: 12px;

    /* Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.board-container::-webkit-scrollbar {
    height: 8px;
}

.board-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.board-column {
    flex: 0 0 320px;
    /* Fixed width, no shrink */
    max-width: 320px;
    background: rgba(255, 255, 255, 0.03);
    /* Subtle column bg */
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.board-column-header {
    padding: 0.8rem 1rem;
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.board-column-content {
    padding: 0.5rem;
    overflow-y: auto;
    flex: 1;
    /* Custom Scrollbar for column */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Card Styling - Premium Polish */
.board-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: grab;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: #1e293b;
    position: relative;
    border-left: 4px solid transparent;
    /* Status indicator placeholder */
    overflow: hidden;
}

.board-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
    opacity: 0.8;
}

.board-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.board-card:active {
    cursor: grabbing;
}

/* Status colors can be injected via inline style or classes later, default is accent */


.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-claim-id {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
}

.card-menu-icon {
    color: #94a3b8;
    padding: 2px;
}

.card-body {
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 12px;
    line-height: 1.4;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
    margin-top: 8px;
}

.card-metrics {
    display: flex;
    gap: 12px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    color: #3b82f6;
    /* Blue icons */
    font-weight: 600;
}

.metric-item i {
    font-size: 0.8rem;
    margin-bottom: 2px;
    opacity: 0.8;
}

.card-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Detail Sidebar Tabs */
.detail-tab {
    padding: 0.8rem 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-right: 3px solid transparent;
}

.detail-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.detail-tab.active {
    color: var(--accent-primary);
    border-right-color: var(--accent-primary);
    background: linear-gradient(to right, transparent, rgba(124, 77, 255, 0.1));
}

/* Info Grid Styling */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent-secondary);
    margin-bottom: 0.4rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.info-item span {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Drag and Drop Visuals */
.board-card.dragging {
    opacity: 0.6;
    transform: scale(0.95) rotate(2deg);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3);
}

.board-column {
    transition: background 0.3s, border-color 0.3s;
}

.board-column.drag-over {
    background: rgba(0, 229, 255, 0.1) !important;
    /* Cyan tint */
    border: 2px dashed #00e5ff;
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.2);
}

/* Tab Logic */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Claim Events List Item */
.claim-event-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.claim-event-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.claim-event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.claim-event-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.claim-event-date {
    font-size: 0.8rem;
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 12px;
}

.claim-event-loc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


/* --- FullCalendar Overrides --- */

/* Main Container */
#calendar {
    /* bg handled by main container */
    backdrop-filter: blur(var(--glass-blur));
    color: var(--text-primary);
    height: 100%;
}

/* Toolbar */
.fc-toolbar {
    margin-bottom: 1.5rem !important;
}

.fc-toolbar-title {
    font-size: 1.5rem !important;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}

.fc-button {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    text-transform: capitalize;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
}

.fc-button:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--text-secondary) !important;
}

.fc-button-active {
    background-color: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    color: white !important;
}

/* Grid & Cells */
.fc-theme-standard td,
.fc-theme-standard th {
    border-color: var(--border-color) !important;
}

.fc-col-header-cell-cushion {
    color: var(--text-secondary);
    text-decoration: none !important;
    font-weight: 600;
    padding: 10px 0;
}

.fc-daygrid-day-number {
    color: var(--text-secondary);
    text-decoration: none !important;
    padding: 8px !important;
}

.fc-day-today {
    background-color: rgba(124, 77, 255, 0.05) !important;
}

/* Events */
.fc-event {
    border: none !important;
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fc-daygrid-event {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: var(--accent-primary);
    color: white;
}

/* List View */
.fc-list-event:hover td {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.fc-list-day-cushion {
    background-color: var(--card-bg) !important;
}

/* Light Mode Specifics */
body.light-mode .fc-button:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .fc-day-today {
    background-color: rgba(124, 77, 255, 0.1) !important;
}

/* Account Selector Styles */
.card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.account-selector {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    max-width: 180px;
    outline: none;
}

.account-selector:focus {
    border-color: var(--accent-primary);
}

/* Account List Styles */
.account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.account-item:last-child {
    border-bottom: none;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.provider-badge {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

.provider-badge.google {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
}

.provider-badge.microsoft {
    background: linear-gradient(135deg, #00a4ef, #7fba00);
    color: white;
}

.provider-badge.imap {
    background: linear-gradient(135deg, #6001d2, #410093);
    color: white;
}

.account-email {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.account-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.status-dot.error {
    background: #ef4444;
}

.remove-account-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.remove-account-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Email Preview Modal Styles */
.email-preview-content {
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.email-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.email-preview-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-primary);
    flex: 1;
    padding-right: 1rem;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.email-preview-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.email-preview-meta strong {
    color: var(--text-primary);
}

.email-preview-body {
    flex: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 200px;
    max-height: 400px;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.email-preview-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.email-preview-actions .command-btn {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

.email-preview-actions .command-btn i {
    margin-right: 0.3rem;
}

/* Context Menu for Cards */
.context-menu {
    position: absolute;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    z-index: 9999;
    min-width: 140px;
    display: none;
    overflow: hidden;
}

.context-menu.visible {
    display: block;
    animation: fadeIn 0.15s ease-out;
}

.context-menu-item {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.context-menu-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.context-menu-item.delete {
    color: #ef4444;
}

.context-menu-item.delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Dashboard List Menu Button */
.list-menu-btn {
    opacity: 0;
    transition: opacity 0.2s;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: auto;
}

.list-item:hover .list-menu-btn {
    opacity: 1;
}

.list-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {

    /* Layout Adjustments */
    .sidebar {
        transform: translateX(-100%);
        /* Hide sidebar by default */
        position: fixed;
        z-index: 2500;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar .nav-item {
        font-size: 1.2rem;
        padding: 1.5rem 1rem;
    }

    /* Add overlay when sidebar open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 2400;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .main-content {
        padding: 1rem 1rem 100px 1rem;
        /* Less padding, space for bottom bar */
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    #view-dashboard,
    .view-section {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    /* Force columns to stack */
    #view-dashboard {
        grid-template-columns: 1fr;
    }

    .nav-item {
        padding: 1.2rem;
        /* Larger touch targets */
        font-size: 1.1rem;
    }

    /* Show Hamburger */
    #mobile-menu-toggle {
        display: block !important;
    }

    /* Typography */
    .header h2 {
        font-size: 1.5rem;
    }

    /* Cards */
    .card {
        padding: 1rem;
    }

    /* Board View */
    .board-container {
        flex-direction: column;
        height: auto;
        min-height: 50vh;
        padding-bottom: 20px;
        overflow-x: hidden;
    }

    .board-column {
        max-width: 100%;
        flex: 0 0 auto;
        margin-right: 0;
        margin-bottom: 1.5rem;
    }

    /* Command Bar */
    .command-bar {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        padding: 0.8rem;
    }

    /* Modal Mobile */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .info-grid {
        grid-template-columns: 1fr !important;
        /* Stack info items */
    }

    /* Hide Desktop Menu items that are redundant or too small */
    .menu-item {
        display: none;
        /* Simplify top bar */
    }
}

/* Photo Labeler & Grid Builder */
.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.grid-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

.grid-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-primary);
}

.btn-type-label {
    border-left: 3px solid var(--accent-secondary);
}

.btn-type-desc {
    border-left: 3px solid var(--accent-primary);
}

.sub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

/* Email View Styles */
#view-email {
    padding: 0 !important;
    /* Override default section padding */
}

.email-list-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    background: var(--card-bg);
}

.email-list-item:hover,
.email-list-item.selected {
    background: rgba(124, 77, 255, 0.1);
    border-left: 3px solid var(--accent-primary);
}

.email-list-item .subject {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-list-item .snippet {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.4rem;
}

.email-list-item .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.email-list-item.unread {
    background: rgba(124, 77, 255, 0.05);
}

.email-list-item.unread .subject {
    color: var(--accent-secondary);
    font-weight: 800;
}

.attachment-chip {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.2s;
}

.attachment-chip:hover {
    background: rgba(255, 255, 255, 0.1);
}


/* Contact Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0 1rem;
    width: 300px;
    height: 40px;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(124, 77, 255, 0.2);
}

.search-box i {
    color: var(--text-secondary);
    margin-right: 0.8rem;
    font-size: 0.9rem;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Theme Card Styles */
.theme-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.theme-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.theme-card.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.3);
}

.theme-preview {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* Ocean Theme */
body.ocean-mode {
    --bg-color: #082f49;
    --sidebar-bg: rgba(12, 74, 110, 0.7);
    --card-bg: rgba(14, 116, 144, 0.3);
    --accent-primary: #0ea5e9;
    --accent-secondary: #22d3ee;
    --text-primary: #f0f9ff;
    --text-secondary: #7dd3fc;
    --border-color: rgba(125, 211, 252, 0.2);
    background: radial-gradient(circle at top right, #0c4a6e, #082f49);
}

/* Emerald Theme */
body.emerald-mode {
    --bg-color: #022c22;
    --sidebar-bg: rgba(6, 78, 59, 0.7);
    --card-bg: rgba(16, 185, 129, 0.15);
    --accent-primary: #10b981;
    --accent-secondary: #34d399;
    --text-primary: #ecfdf5;
    --text-secondary: #6ee7b7;
    --border-color: rgba(110, 231, 183, 0.2);
    background: radial-gradient(circle at top right, #064e3b, #022c22);
}

/* Sunset Theme */
body.sunset-mode {
    --bg-color: #431407;
    --sidebar-bg: rgba(124, 45, 18, 0.7);
    --card-bg: rgba(249, 115, 22, 0.15);
    --accent-primary: #f97316;
    --accent-secondary: #fbbf24;
    --text-primary: #fff7ed;
    --text-secondary: #fdba74;
    --border-color: rgba(253, 186, 116, 0.2);
    background: radial-gradient(circle at top right, #7c2d12, #431407);
}

/* Collapsible Card specific adjustments for tighter fit */
.collapsible-card {
    padding: 1rem 1.5rem;
    /* Reduced vertical padding */
}

.collapsible-card .card-title {
    margin-bottom: 0;
    /* No margin by default (for collapsed state) */
}

.collapsible-card .collapsible-content {
    margin-top: 1rem;
    /* Add spacing only when expanded */
}

/* --- Appraisal Detail View Specs --- */

/* Tabs */
.cd-tab {
    padding: 1rem 0;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.2s;
}

.cd-tab:hover {
    color: var(--text-primary);
}

.cd-tab.active {
    color: var(--accent-primary);
    font-weight: 600;
}

.cd-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
    box-shadow: 0 -2px 10px var(--accent-primary);
}

/* Info Rows */
.info-row {
    margin-bottom: 1.2rem;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-row div {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    padding-left: 1.3rem;
    /* Indent under label icon */
}

/* Timeline */
.timeline-step {
    flex: 1;
    position: relative;
    text-align: center;
    padding-top: 1rem;
}

.timeline-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-step::after {
    content: '';
    position: absolute;
    top: 7px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.timeline-step:last-child::after {
    display: none;
}

.timeline-step.completed::before {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

.timeline-step.completed::after {
    background: var(--accent-primary);
}

.timeline-step.active::before {
    background: var(--bg-color);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.2);
}

.step-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.step-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}


/* --- Milestone Tracker --- */
.milestone-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    background: white;
    /* Default light theme as per screenshot */
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

body:not(.light-mode) .milestone-card {
    background: rgba(255, 255, 255, 0.05);
    /* Dark mode fallback */
}

/* Completed State (Green) */
.milestone-card.completed {
    background: #f0fdf4;
    /* Green-50 */
    border: 1px solid #bbf7d0;
    /* Green-200 */
}

body:not(.light-mode) .milestone-card.completed {
    background: rgba(22, 163, 74, 0.1);
    border-color: rgba(22, 163, 74, 0.3);
}

.milestone-icon {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 1.5rem;
}

.milestone-card.completed .milestone-icon {
    color: #16a34a;
    /* Green-600 */
    border: 2px solid #16a34a;
}

.milestone-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.milestone-card.completed .milestone-status-badge {
    background: #dcfce7;
    /* Green-100 */
    color: #166534;
    /* Green-800 */
}

body:not(.light-mode) .milestone-card.completed .milestone-status-badge {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}

/* Pending State (Blue/Grey) */
.milestone-card.pending .milestone-icon {
    color: #2563eb;
    /* Blue-600 */
    border: 2px solid #2563eb;
}

.milestone-card.pending .milestone-status-badge {
    background: #dbeafe;
    /* Blue-100 */
    color: #1e40af;
    /* Blue-800 */
}


/* --- Inspection Tab Details --- */
.inspection-detail-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

body:not(.light-mode) .inspection-detail-card {
    background: rgba(255, 255, 255, 0.05);
}

.scope-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    columns: var(--text-primary);
    font-weight: 600;
    margin-right: 0.5rem;
}

body:not(.light-mode) .scope-tag {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.weather-info {
    font-size: 1.1rem;
    font-weight: 500;
}

.field-notes-box {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

body:not(.light-mode) .field-notes-box {
    background: rgba(0, 0, 0, 0.2);
}


/* --- Documents Tab --- */
.doc-group-header {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 1.5rem 0 0.8rem 0;
}

.file-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #4b5563;
    margin-right: 6px;
    border: 1px solid #e5e7eb;
}

body:not(.light-mode) .file-tag {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}


/* --- Contacts Tab --- */
.contact-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.2s;
}

body:not(.light-mode) .contact-card {
    background: rgba(255, 255, 255, 0.05);
    /* Dark mode fallback */
}

.contact-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.role-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

body:not(.light-mode) .role-badge {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.contact-detail-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.contact-detail-row a {
    color: #3b82f6;
    text-decoration: none;
}

/* Dark Mode Date/Time Picker Styling - High Specificity */
body:not(.light-mode) input[type="datetime-local"],
body:not(.light-mode) input[type="date"],
body:not(.light-mode) input[type="time"] {
    color-scheme: dark;
    color: #ffffff;
}

body:not(.light-mode) input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body:not(.light-mode) input[type="date"]::-webkit-calendar-picker-indicator,
body:not(.light-mode) input[type="time"]::-webkit-calendar-picker-indicator {
    filter: none !important;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48cGF0aCBmaWxsPSIjZmZmZmZmIiBkPSJNMTUyIDI0YzAtMTMuMy0xMC43LTI0LTI0LTI0cy0yNCAxMC43LTI0IDI0VjY0SDY0QzI4LjcgNjQgMCA5Mi43IDAgMTI4djE2IDQ4VjQ0OGMwIDM1LjMgMjguNyA2NCA2NCA2NEgzODRjMzUuMyAwIDY0LTI4LjcgNjQtNjRWMTkyIDE0NCAxMjhjMC0zNS4zLTI4LjctNjQtNjQtNjRIMzQ0VjI0YzAtMTMuMy0xMC43LTI0LTI0LTI0cy0yNCAxMC43LTI0IDI0VjY0SDE1MlYyNHpMNDggMTkySDQwMFY0NDhjMCA4LjgtNy4yIDE2LTE2IDE2SDY0Yy04LjggMC0xNi03LjItMTYtMTZWMTkyeiIvPjwvc3ZnPg==') !important;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    cursor: pointer;
    opacity: 1 !important;
    width: 20px;
    /* Reduced slightly to fit well */
    height: 20px;
    background-color: transparent !important;
}