/* Muhurtha Builder - Main Styles */

/* ==================== Theme Variables ==================== */
:root {
    --bg-page: #f9fafb;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: #ffffff;
    --bg-hover: #f3f4f6;
    --bg-input: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --accent: #667eea;
    --accent-hover: #5a6fd6;
    --accent-light: #eef0fd;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --chart-bg: #fff;
    --chart-border: #000;
}

html.dark {
    --bg-page: #000000;
    --bg-card: #000000;
    --bg-sidebar: #000000;
    --bg-header: #000000;
    --bg-hover: #1e1e1e;
    --bg-input: #000000;
    --text-primary: #f0f0f0;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --border-color: #333333;
    --border-light: #1e1e1e;
    --accent: #667eea;
    --accent-hover: #7b8ff0;
    --accent-light: #1a1a3e;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --chart-bg: #000000;
    --chart-border: #666666;
}

* {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    color: var(--text-primary);
    background: var(--bg-page);
    scroll-padding-top: 5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Custom scrollbar */
.custom-scroll::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

html.dark .custom-scroll::-webkit-scrollbar-thumb {
    background: #3f3f46;
}

html.dark .custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* Checkbox styles */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.heading-font {
    font-weight: 700;
    letter-spacing: -0.025em;
}

.filter-chip {
    transition: all 0.15s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-chip:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent);
    color: white;
}

.filter-section {
    border-left: 2px solid var(--accent-light);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.filter-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: var(--text-secondary);
    font-weight: 600;
}

.result-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.result-card:hover {
    border-color: var(--text-muted);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.om-symbol {
    filter: drop-shadow(0 2px 6px rgba(102, 126, 234, 0.2));
}

/* ==================== Muhurat Indicator Badges ==================== */
.muhurat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1;
    border: 1px solid;
}
.muhurat-icon { font-size: 0.75rem; font-weight: 700; line-height: 1; }
.muhurat-clear { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.muhurat-warn { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.muhurat-good { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.muhurat-neutral { background: var(--bg-hover); color: var(--text-muted); border-color: var(--border-color); }
html.dark .muhurat-clear { background: #052e16; color: #4ade80; border-color: #166534; }
html.dark .muhurat-warn { background: #450a0a; color: #f87171; border-color: #991b1b; }
html.dark .muhurat-good { background: #172554; color: #60a5fa; border-color: #1e40af; }
html.dark .muhurat-neutral { background: var(--bg-hover); color: var(--text-muted); border-color: var(--border-color); }

/* Filter count badge on mobile filter icon */
.filter-count-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.locres {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0 0 0.5rem 0.5rem;
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}

.locres.active {
    display: block;
}

.locitem {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s ease;
}

.locitem:hover {
    background: var(--bg-hover);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.sidebar-sticky {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}

/* ==================== shadcn App Layout ==================== */

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar: full height, fixed width, scrollable */
.app-sidebar {
    width: 16rem;
    min-width: 16rem;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s ease, min-width 0.3s ease, opacity 0.25s ease;
}

.app-sidebar.sidebar-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden;
    opacity: 0;
    padding: 0 !important;
    border-right: none;
}

/* Sidebar brand */
.sidebar-brand {
    padding: 0 0.75rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 4rem; /* Match content-header height */
    border-bottom: 1px solid var(--border-color);
}


/* Sidebar navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 0.5rem;
    flex-shrink: 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.sidebar-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    font-weight: 600;
}

/* Sidebar divider */
.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0.75rem;
    flex-shrink: 0;
}

/* Sidebar filters area */
.sidebar-filters {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 0.5rem 0.75rem;
}

/* Main content: fills remaining space, scrolls independently */
.app-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    background: var(--bg-page);
    transition: margin 0.3s ease;
}

/* Content-area header - matches RVA v3 h-16 */
.content-header {
    display: flex;
    align-items: center;
    height: 4rem;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-header);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
html.dark .content-header {
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.05);
}

/* Content body - centered max-width matching RVA v3 */
.content-body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Sidebar filter group headers */
.sidebar-group-header {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.75rem 0.25rem 0.25rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border-light);
}
.sidebar-group-header:first-of-type {
    border-top: none;
    margin-top: 0;
}

/* Borderless filter blocks inside sidebar */
.sidebar-filters .filter-block {
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    padding: 0.5rem 0.375rem;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s ease;
}

.sidebar-filters .filter-block:hover {
    background: var(--bg-hover);
}

.sidebar-filters .filter-block:last-child {
    border-bottom: none;
}

/* Mobile: sidebar slides in from left with animation */
@media (max-width: 1023px) {
    .app-layout {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    .app-sidebar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 18rem;
        height: 100vh;
        z-index: 50;
        box-shadow: none;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    }
    .app-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.15);
    }
    .mobile-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0);
        z-index: 49;
        pointer-events: none;
        transition: background 0.3s ease;
    }
    .mobile-overlay.active {
        background: rgba(0, 0, 0, 0.4);
        pointer-events: auto;
        backdrop-filter: blur(2px);
    }
    .app-main {
        overflow: visible;
    }
    .content-body {
        padding: 1rem;
        max-width: none;
    }
}

/* Desktop: remove old sidebar styles */
@media (min-width: 1024px) {
    .filters-sidebar {
        display: none !important; /* old sidebar hidden, replaced by app-sidebar */
    }
}
.sidebar-toggle {
    align-self: flex-start;
    position: sticky;
    top: 0.75rem;
    width: 20px;
    min-width: 20px;
    height: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 10;
    flex-shrink: 0;
    margin-left: -1px;
    transition: background 0.15s ease;
}
.sidebar-toggle:hover {
    background: var(--bg-hover);
}
.sidebar-toggle svg {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}
.sidebar-toggle.collapsed svg {
    transform: rotate(180deg);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.12);
}

.calendar-months-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.month-block {
    min-width: 0;
}

.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.month-score {
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
    position: relative;
}

.calendar-day:hover:not(.empty):not(.disabled) {
    transform: scale(1.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
    border-radius: 6px;
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.disabled {
    pointer-events: none;
    background: var(--border-color);
    color: var(--text-muted);
}

.calendar-day.selected {
    box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(102, 126, 234, 0.25);
    border-radius: 6px;
}

.day-of-week-header {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    padding: 0.25rem 0;
}

/* Birth Chart Styles */
.chart-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.chart-container svg {
    width: 100%;
    max-width: 380px;
    height: auto;
    display: block;
    margin: 0 auto;
    background-color: var(--chart-bg);
    border: 1px solid var(--chart-border);
}

/* Birth Details Summary */
.birth-details-summary {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

.birth-details-summary.visible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.summary-info {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.summary-value {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
}
html.dark .summary-value {
    color: #8b9cf7;
}

.edit-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    font-weight: 500;
    flex-shrink: 0;
}

.edit-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.edit-icon {
    font-size: 1rem;
}

.form-section {
    transition: all 0.3s ease-out;
    overflow: hidden;
}

.form-section.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border: none;
    pointer-events: none;
}

@media (max-width: 768px) {
    .birth-details-summary.visible {
        flex-direction: column;
        align-items: stretch;
    }
    .summary-info {
        gap: 1rem;
    }
    .edit-btn {
        width: 100%;
        justify-content: center;
    }
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.filter-pill:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.filter-pill.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.filter-pill .remove {
    margin-left: 6px;
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Content card with soft shadow */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}
html.dark .content-card {
    box-shadow: 0 1px 2px rgba(255, 255, 255, 0.05);
}

/* Step-based form transitions */
.step-content {
    animation: stepFadeIn 0.25s ease-out;
}

@keyframes stepFadeIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Step wizard indicator */
.step-indicator { padding: 0.5rem 0; }
.step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.step-dot span:first-child {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}
.step-dot.active span:first-child,
.step-dot.completed span:first-child {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent);
}
.step-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}
.step-dot.active .step-label {
    color: var(--accent);
    font-weight: 600;
}
.step-line {
    width: 3rem;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.5rem;
    margin-bottom: 1.25rem;
    transition: background 0.2s ease;
}
.step-line.active {
    background: var(--accent);
}

/* Fix dropdown visibility - ensure parent containers don't clip dropdowns */
#birthDetailsForm,
#birthDetailsForm .bg-gray-50,
#birthDetailsForm .grid,
.step-content {
    overflow: visible !important;
}

/* Increase z-index for location dropdowns */
#eventLocationResults,
#locationResults2,
.locres {
    z-index: 9999 !important;
}

/* ==================== Collapsible Filter Sections ==================== */

.filter-block {
    transition: box-shadow 0.2s, opacity 0.2s, border-color 0.2s;
}

.filter-header {
    padding-bottom: 0;
    margin-bottom: 0;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.filter-block:not(.collapsed) .filter-header {
    margin-bottom: 0.5rem;
}

.filter-body {
    overflow: hidden;
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
}

.filter-block.collapsed .filter-body {
    max-height: 0;
    opacity: 0;
}

.filter-block.collapsed .collapse-chevron {
    transform: rotate(-90deg);
}

.collapse-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* ==================== Drag Handle ==================== */

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1;
    padding: 2px;
    user-select: none;
    transition: color 0.15s;
}

.drag-handle:hover {
    color: var(--accent);
}

.drag-handle:active {
    cursor: grabbing;
}

/* ==================== Drag-and-Drop States ==================== */

.filter-block.dragging {
    opacity: 0.4;
    border-color: var(--accent);
}

.filter-block.drag-over-top {
    box-shadow: 0 -3px 0 0 var(--accent);
}

.filter-block.drag-over-bottom {
    box-shadow: 0 3px 0 0 var(--accent);
}

/* Nakshatra Grid (grouped by lord) */
.nakshatra-grid-wrap {
    max-height: 260px;
    overflow-y: auto;
    margin-top: 8px;
}
.nakshatra-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.nakshatra-grid td {
    padding: 5px 3px;
    vertical-align: middle;
}
.nakshatra-grid .nak-lord {
    font-weight: 700;
    color: black;
    text-align: center;
    width: 28px;
    font-size: 10px;
    border-radius: 3px;
    padding: 2px 4px;
    line-height: 1.4;
}
.nakshatra-grid .nak-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-primary);
    padding: 2px 4px;
    border-radius: 4px;
}
.nakshatra-grid .nak-label:hover {
    color: #667eea;
}
.nakshatra-grid input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

/* Tithi Grid (S.P. / K.P.) */
.tithi-grid-wrap {
    margin-top: 8px;
}
.tithi-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.tithi-grid th {
    font-weight: 700;
    color: var(--text-secondary);
    text-align: left;
    padding: 4px 6px;
    font-size: 11px;
}
.tithi-grid td {
    padding: 3px 2px;
    vertical-align: middle;
}
.tithi-grid .tithi-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-primary);
    padding: 2px 4px;
    border-radius: 4px;
}
.tithi-grid .tithi-label:hover {
    color: #2563eb;
}
.tithi-grid input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #2563eb;
    flex-shrink: 0;
}

/* Slicer Cross-Filtering */
.slicer-unavailable {
    opacity: 0.35;
}
.slicer-count {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: auto;
    font-weight: 400;
    min-width: 16px;
    text-align: right;
}

/* Planet Placement Grid */
.placement-grid {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 11px;
}
.placement-grid th, .placement-grid td {
    text-align: center;
    padding: 2px 1px;
}
.placement-grid thead th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 10px;
    padding-bottom: 4px;
}
.placement-grid tbody td:first-child {
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    padding-right: 4px;
    font-size: 10px;
    white-space: nowrap;
}
.placement-grid input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #2563eb;
}

/* ==================== Dark Mode: Tailwind Utility Overrides ==================== */

html.dark .bg-white { background-color: #000000 !important; }
html.dark .bg-gray-50 { background-color: #000000 !important; }
html.dark .bg-gray-100 { background-color: #1e1e1e !important; }
html.dark .border-gray-200 { border-color: #333333 !important; }
html.dark .border-gray-100 { border-color: #1e1e1e !important; }
html.dark .border-gray-300 { border-color: #333333 !important; }
html.dark .text-gray-900 { color: #f0f0f0 !important; }
html.dark .text-gray-800 { color: #f0f0f0 !important; }
html.dark .text-gray-700 { color: #cccccc !important; }
html.dark .text-gray-600 { color: #cccccc !important; }
html.dark .text-gray-500 { color: #999999 !important; }
html.dark .text-gray-400 { color: #999999 !important; }
html.dark .text-gatsby-900 { color: #f0f0f0 !important; }
html.dark .text-gatsby-800 { color: #e0e0e0 !important; }
html.dark .text-gatsby-700 { color: #cccccc !important; }
html.dark .text-gatsby-500 { color: #8b9cf7 !important; }
html.dark .text-purple-600 { color: #8b9cf7 !important; }
html.dark .bg-purple-600 { background-color: #667eea !important; }
html.dark .hover\:bg-purple-700:hover { background-color: #5a6fd6 !important; }
html.dark .bg-gray-200 { background-color: #333333 !important; }
html.dark .hover\:bg-gray-300:hover { background-color: #4a4a4a !important; }
html.dark .hover\:bg-gray-100:hover { background-color: #1e1e1e !important; }
html.dark .hover\:bg-gray-50:hover { background-color: #1e1e1e !important; }
html.dark input, html.dark select { background-color: #000000 !important; color: #f0f0f0 !important; border-color: #333333 !important; }
html.dark input:focus, html.dark select:focus { background-color: #1e1e1e !important; border-color: #666666 !important; }
html.dark input::placeholder { color: #666666 !important; }
html.dark input::-webkit-calendar-picker-indicator { filter: invert(1); }
html.dark .bg-green-50 { background-color: #003d2b !important; }
html.dark .text-green-700 { color: #10b981 !important; }
html.dark .border-green-200 { border-color: #166534 !important; }
html.dark .bg-blue-50 { background-color: #172554 !important; }
html.dark .text-blue-700 { color: #60a5fa !important; }
html.dark .border-blue-200 { border-color: #1e40af !important; }
html.dark .bg-yellow-50 { background-color: #422006 !important; }
html.dark .text-yellow-700 { color: #fbbf24 !important; }
html.dark .border-yellow-200 { border-color: #92400e !important; }
html.dark .bg-gatsby-50 { background-color: var(--accent-light) !important; }
html.dark .border-gatsby-200 { border-color: #333366 !important; }
html.dark .bg-green-600 { background-color: #059669 !important; }
html.dark .bg-blue-600 { background-color: #2563eb !important; }
html.dark .bg-gatsby-600 { background-color: #667eea !important; }
html.dark .bg-amber-600 { background-color: #d97706 !important; }
html.dark .bg-red-50 { background-color: #450a0a !important; }
html.dark .text-red-500 { color: #f87171 !important; }
html.dark .hover\:text-red-700:hover { color: #fca5a5 !important; }
html.dark .hover\:bg-red-50:hover { background-color: #450a0a !important; }

/* Dark mode: buttons */
html.dark button:not(.btn-primary):not([type="submit"]) {
    border-color: #333333 !important;
}

/* Dark mode: shadows */
html.dark .shadow-sm { box-shadow: 0 1px 2px 0 rgba(255, 255, 255, 0.05) !important; }
html.dark .shadow-md { box-shadow: 0 4px 6px -1px rgba(255, 255, 255, 0.07) !important; }
html.dark .shadow-lg { box-shadow: 0 10px 15px -3px rgba(255, 255, 255, 0.1) !important; }

/* Dark mode: scrollbars */
html.dark::-webkit-scrollbar { width: 8px; height: 8px; }
html.dark::-webkit-scrollbar-track { background: #000000; }
html.dark::-webkit-scrollbar-thumb { background: #333333; border-radius: 4px; }
html.dark::-webkit-scrollbar-thumb:hover { background: #666666; }

/* Dark mode: Chart colors handled in js/charts.js */

/* Logo switching for dark mode */
.logo-light { display: block; }
.logo-dark { display: none; }
html.dark .logo-light { display: none; }
html.dark .logo-dark { display: block; }
