/* Compact UI Styles for Orchid Platform - Reduced Padding/Whitespace Only */

/* ==============================================
   SITE-WIDE COLOR PALETTE
   ============================================== */

:root {
    /* Primary blue */
    --bs-blue: #0795e2 !important;
    --bs-primary: #0795e2 !important;
    --bs-primary-rgb: 7, 149, 226 !important;
    --bs-link-color: #0795e2 !important;
    --bs-link-hover-color: #0580c4 !important;
    --primary-color: #0795e2;
    --primary-hover: #0580c4;
    --primary-dark: #035688;
    --primary-light: #2da5e8;

    /* Palette */
    --color-navy: #1a2e42;
    --color-maroon: #3d1f20;
    --color-maroon-light: #5c3234;
    --color-gold: #e6cc00;
    --color-bg: #21252b;
    --color-menu: #1c1b22;
    --color-card: #1b1d21;
}

/* Links */
a {
    color: #0795e2;
}

a:hover, a:focus {
    color: #0580c4;
}

/* Rounded corners for all buttons */
.btn {
    border-radius: 0.5rem !important;
}

/* Primary buttons */
.btn-primary {
    background-color: #0795e2 !important;
    border-color: #0795e2 !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: #0580c4 !important;
    border-color: #0580c4 !important;
}

.btn-primary:focus, .btn-primary:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(7, 149, 226, 0.25) !important;
}

/* Outline primary buttons */
.btn-outline-primary {
    color: #0795e2 !important;
    border-color: #0795e2 !important;
}

.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: #0795e2 !important;
    border-color: #0795e2 !important;
    color: white !important;
}

/* Link buttons */
.btn-link {
    color: #0795e2 !important;
}

.btn-link:hover, .btn-link:focus {
    color: #0580c4 !important;
}

/* Info buttons/badges (often blue) */
.btn-info {
    background-color: #0795e2 !important;
    border-color: #0795e2 !important;
}

.btn-info:hover, .btn-info:focus {
    background-color: #0580c4 !important;
    border-color: #0580c4 !important;
}

/* Primary badge */
.badge.bg-primary, .badge.badge-primary {
    background-color: #0795e2 !important;
}

/* Info badge */
.badge.bg-info, .badge.badge-info {
    background-color: #0795e2 !important;
    color: white !important;
}

/* Alerts */
.alert-primary {
    background-color: rgba(7, 149, 226, 0.15) !important;
    border-color: rgba(7, 149, 226, 0.3) !important;
    color: #035688 !important;
}

.alert-info {
    background-color: rgba(7, 149, 226, 0.15) !important;
    border-color: rgba(7, 149, 226, 0.3) !important;
    color: #035688 !important;
}

/* Form focus states */
.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
    border-color: #0795e2 !important;
    box-shadow: 0 0 0 0.25rem rgba(7, 149, 226, 0.25) !important;
}

/* Checkboxes and radios */
.form-check-input:checked {
    background-color: #0795e2 !important;
    border-color: #0795e2 !important;
}

.form-check-input:focus {
    border-color: #0795e2 !important;
    box-shadow: 0 0 0 0.25rem rgba(7, 149, 226, 0.25) !important;
}

/* Switches */
.form-switch .form-check-input:checked {
    background-color: #0795e2 !important;
}

/* Progress bars */
.progress-bar, .bg-primary {
    background-color: #0795e2 !important;
}

/* Nav tabs and pills */
.nav-tabs .nav-link.active {
    color: #0795e2 !important;
    border-bottom-color: #0795e2 !important;
}

.nav-pills .nav-link.active {
    background-color: #0795e2 !important;
}

.nav-link:hover, .nav-link:focus {
    color: #0795e2 !important;
}

/* Pagination */
.page-link {
    color: #0795e2 !important;
}

.page-link:hover, .page-link:focus {
    color: #0580c4 !important;
}

.page-item.active .page-link {
    background-color: #0795e2 !important;
    border-color: #0795e2 !important;
    color: white !important;
}

/* List groups */
.list-group-item.active {
    background-color: #0795e2 !important;
    border-color: #0795e2 !important;
}

.list-group-item-action:hover, .list-group-item-action:focus {
    color: #0795e2 !important;
}

/* Dropdown active/hover */
.dropdown-item.active, .dropdown-item:active {
    background-color: #0795e2 !important;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(7, 149, 226, 0.1) !important;
    color: #0795e2 !important;
}

/* Text utilities */
.text-primary {
    color: #0795e2 !important;
}

.text-info {
    color: #0795e2 !important;
}

/* Border utilities */
.border-primary {
    border-color: #0795e2 !important;
}

.border-info {
    border-color: #0795e2 !important;
}

/* Selection highlight */
::selection {
    background-color: rgba(7, 149, 226, 0.3);
}

::-moz-selection {
    background-color: rgba(7, 149, 226, 0.3);
}

/* Orchid Platform specific */

/* Sidebar active menu item */
.aside .nav-link.active,
.aside-menu .nav-link.active,
aside .nav-link.active {
    color: #0795e2 !important;
    background-color: rgba(7, 149, 226, 0.1) !important;
}

.aside .nav-link:hover,
.aside-menu .nav-link:hover,
aside .nav-link:hover {
    color: #0795e2 !important;
}

/* Orchid icons in active state */
.aside .nav-link.active svg,
.aside-menu .nav-link.active svg {
    color: #0795e2 !important;
}

/* Orchid screen command bar buttons */
.command-bar .btn-link {
    color: #0795e2 !important;
}

.command-bar .btn-link:hover {
    color: #0580c4 !important;
}

/* Orchid table sort icons */
.table th a, table th a {
    color: #0795e2 !important;
}

/* Orchid modals */
.modal-header {
    border-bottom-color: rgba(7, 149, 226, 0.2) !important;
}

/* Loading spinner */
.spinner-border {
    color: #0795e2 !important;
}

/* Orchid turbo progress bar */
.turbo-progress-bar {
    background-color: #0795e2 !important;
}

/* Card header accent */
.card-header.bg-primary {
    background-color: #0795e2 !important;
}

/* Table hover */
.table-hover tbody tr:hover {
    background-color: rgba(7, 149, 226, 0.05) !important;
}

/* Orchid notifications */
.toast-header {
    border-bottom-color: rgba(7, 149, 226, 0.2) !important;
}

/* Accordion */
.accordion-button:not(.collapsed) {
    color: #0795e2 !important;
    background-color: rgba(7, 149, 226, 0.1) !important;
}

.accordion-button:focus {
    border-color: #0795e2 !important;
    box-shadow: 0 0 0 0.25rem rgba(7, 149, 226, 0.25) !important;
}

/* Breadcrumb active */
.breadcrumb-item.active {
    color: #0795e2 !important;
}

/* Card links */
.card a:not(.btn) {
    color: #0795e2 !important;
}

.card a:not(.btn):hover {
    color: #0580c4 !important;
}

/* End Global Blue Override */

/* Reduce line height for tighter text */
html, body {
    line-height: 1.4 !important;
}

/* Reduce container padding */
.container, .container-fluid, .container-lg, .container-md, .container-sm, .container-xl {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

/* Compact main content area */
.wrapper {
    padding: 0.75rem !important;
}

main, .main {
    padding: 0.75rem !important;
}

/* Compact page headers */
.page-header, .screen-header {
    padding: 0.5rem 0 !important;
    margin-bottom: 0.75rem !important;
}

.page-title, h1.mb-3, h1.mb-4 {
    margin-bottom: 0.25rem !important;
}

/* Compact cards */
.card {
    margin-bottom: 0.75rem !important;
}

.card-header {
    padding: 0.5rem 0.75rem !important;
}

.card-body {
    padding: 0.75rem !important;
}

.card-footer {
    padding: 0.5rem 0.75rem !important;
}

/* Compact tables - Reduced padding only */
.table, table {
    margin-bottom: 0.75rem !important;
}

.table thead th, table thead th {
    padding: 0.4rem 0.6rem !important;
    line-height: 1.3 !important;
}

.table tbody td, table tbody td {
    padding: 0.4rem 0.6rem !important;
    line-height: 1.4 !important;
    vertical-align: middle !important;
}

.table tbody tr, table tbody tr {
    height: auto !important;
}

/* Table wrapper spacing */
.table-wrapper, .table-responsive {
    margin-bottom: 0.75rem !important;
}

/* Compact forms - Reduced spacing only */
.row {
    --bs-gutter-y: 0.75rem !important;
}

.mb-3, .my-3 {
    margin-bottom: 0.6rem !important;
}

.mb-4, .my-4 {
    margin-bottom: 0.75rem !important;
}

.form-group, .mb-3.row {
    margin-bottom: 0.6rem !important;
}

.form-label, label {
    margin-bottom: 0.25rem !important;
}

.form-control, .form-select, input, select, textarea {
    padding: 0.4rem 0.75rem !important;
    height: auto !important;
}

textarea.form-control {
    padding: 0.5rem 0.75rem !important;
}

.form-text, .invalid-feedback, .valid-feedback {
    margin-top: 0.25rem !important;
}

/* Compact buttons */
.btn {
    padding: 0.4rem 0.75rem !important;
}

.btn-sm {
    padding: 0.25rem 0.5rem !important;
}

.btn-lg {
    padding: 0.5rem 1rem !important;
}

/* Compact button groups and toolbars */
.btn-group, .btn-toolbar {
    gap: 0.25rem !important;
}

/* Compact badges */
.badge {
    padding: 0.25em 0.5em !important;
}

/* Compact alerts */
.alert {
    padding: 0.6rem 0.75rem !important;
    margin-bottom: 0.75rem !important;
}

/* Compact breadcrumbs */
.breadcrumb {
    padding: 0.5rem 0 !important;
    margin-bottom: 0.75rem !important;
}

.breadcrumb-item + .breadcrumb-item::before {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

/* Compact pagination */
.pagination {
    margin-bottom: 0.5rem !important;
    margin-top: 0.5rem !important;
}

.page-link {
    padding: 0.4rem 0.75rem !important;
}

/* Compact dropdown menus */
.dropdown-menu {
    padding: 0.25rem 0 !important;
}

.dropdown-item {
    padding: 0.4rem 0.75rem !important;
}

.dropdown-divider {
    margin: 0.25rem 0 !important;
}

/* Compact modals */
.modal-header {
    padding: 0.75rem !important;
}

.modal-body {
    padding: 0.75rem !important;
}

.modal-footer {
    padding: 0.6rem 0.75rem !important;
}

/* Compact nav tabs */
.nav-tabs {
    margin-bottom: 0.75rem !important;
}

.nav-tabs .nav-link {
    padding: 0.5rem 0.75rem !important;
}

/* Compact list groups */
.list-group-item {
    padding: 0.6rem 0.75rem !important;
}

/* Compact input groups */
.input-group-text {
    padding: 0.4rem 0.75rem !important;
}

/* Orchid-specific: Compact metrics/legend */
.metrics, .metrics-list {
    gap: 0.75rem !important;
    margin-bottom: 0.75rem !important;
}

.metric {
    padding: 0.75rem !important;
}

.metric-value, .metric h3 {
    margin-bottom: 0.25rem !important;
}

.metric-label, .metric p {
    margin-bottom: 0 !important;
}

/* Orchid legend component */
.orchid-legend, .legend {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
}

.orchid-legend dl, .legend dl {
    margin-bottom: 0 !important;
}

.orchid-legend dt, .legend dt {
    margin-bottom: 0.25rem !important;
}

.orchid-legend dd, .legend dd {
    margin-bottom: 0.5rem !important;
}

/* Compact screen command bar */
.command-bar, .btn-toolbar {
    margin-bottom: -5rem !important;
    gap: 0.5rem !important;
}

/* Reduce padding/margins globally */
.p-3 { padding: 0.6rem !important; }
.p-4 { padding: 0.75rem !important; }
.p-5 { padding: 1rem !important; }

.pt-3, .py-3 { padding-top: 0.6rem !important; }
.pt-4, .py-4 { padding-top: 0.75rem !important; }
.pt-5, .py-5 { padding-top: 1rem !important; }

.pb-3, .py-3 { padding-bottom: 0.6rem !important; }
.pb-4, .py-4 { padding-bottom: 0.75rem !important; }
.pb-5, .py-5 { padding-bottom: 1rem !important; }

.ps-3, .px-3 { padding-left: 0.6rem !important; }
.ps-4, .px-4 { padding-left: 0.75rem !important; }
.ps-5, .px-5 { padding-left: 1rem !important; }

.pe-3, .px-3 { padding-right: 0.6rem !important; }
.pe-4, .px-4 { padding-right: 0.75rem !important; }
.pe-5, .px-5 { padding-right: 1rem !important; }

.m-3 { margin: 0.6rem !important; }
.m-4 { margin: 0.75rem !important; }
.m-5 { margin: 1rem !important; }

.mt-3, .my-3 { margin-top: 0.6rem !important; }
.mt-4, .my-4 { margin-top: 0.75rem !important; }
.mt-5, .my-5 { margin-top: 1rem !important; }

/* Compact sidebar/navigation */
.aside-menu .nav-link, .sidebar .nav-link {
    padding: 0.5rem 0.75rem !important;
}

/* Override Orchid's field layouts */
.form-group.row > label {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
}

/* Compact select2 dropdowns if used */
.select2-container--default .select2-selection--single {
    height: calc(1.5em + 0.8rem + 2px) !important;
    padding: 0.4rem 0.75rem !important;
}

/* Remove excessive whitespace from Orchid screens */
.screen-content {
    margin-bottom: 0.75rem !important;
}

.screen-footer {
    padding-top: 0.75rem !important;
}

/* Reduce spacing between form rows in Orchid edit screens */
.bg-white.rounded.shadow-sm.p-4.mb-3,
.bg-white.rounded.shadow-sm.p-3.mb-3 {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
}

/* Tighter spacing in command bars */
.command-bar .btn {
    margin-right: 0.25rem !important;
}

/* Reduce header padding in tables */
thead {
    border-bottom-width: 1px !important;
}

/* Compact filter controls */
.filter-item {
    margin-bottom: 0.5rem !important;
}

/* Reduce spacing in legends/sights */
.bg-white dl {
    margin-bottom: 0 !important;
}

.bg-white dt {
    margin-bottom: 0.25rem !important;
    padding-top: 0.5rem !important;
}

.bg-white dd {
    margin-bottom: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Hide empty screen headers */
.screen-header:empty,
.page-header:empty {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.bg-white.rounded.shadow-sm.p-4.mb-3 h1:empty,
.bg-white.rounded.shadow-sm.p-4.mb-3 h2:empty,
.bg-white.rounded.shadow-sm.p-4.mb-3 .h1:empty,
.bg-white.rounded.shadow-sm.p-4.mb-3 .h2:empty {
    display: none !important;
}

/* Hide empty title and description in Orchid screens */
.bg-white.rounded.shadow-sm.p-4.mb-3:has(h1:only-child:empty),
.bg-white.rounded.shadow-sm.p-3.mb-3:has(h1:only-child:empty),
div[class*="bg-white"]:has(> h1:only-child:empty),
div[class*="bg-white"]:has(> h2:only-child:empty) {
    display: none !important;
}

/* Target empty header sections */
.bg-white.rounded:empty {
    display: none !important;
}

/* Reduce margin on custom header cards */
.bg-white.rounded.shadow-sm.mb-3,
.bg-white.rounded.shadow-sm.mb-2 {
    margin-bottom: 0.5rem !important;
}

/* Remove top margin/padding from first screen element */
.screen > .bg-white:first-child:empty {
    display: none !important;
}

/* Specific override for Orchid command bar area when empty */
.command-bar:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide entire command bar wrapper when command bar is empty */
.command-bar-wrapper:has(.command-bar:empty) {
    display: none !important;
}

/* Hide command bar wrapper with empty header */
.command-bar-wrapper:has(h1:empty) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Aggressively hide Orchid's auto-generated header wrapper */
.wrapper .screen > div:first-of-type:not(.row):not([id]) {
    display: none !important;
}

/* Target the specific Orchid header container */
.bg-white.rounded.shadow-sm.p-4.mb-3:not(:has(*:not(:empty))) {
    display: none !important;
}

/* When screen title/description is null/empty */
.screen > div:first-child:empty,
.screen > div:first-child:has(> :empty:only-child) {
    display: none !important;
}

/* Hide configure columns button from all table views */
.btn-group.dropup {
    display: none !important;
}

/* Fix table layout issues */
.page-platform-customers-list #post-form,
.page-platform-projects-list #post-form {
    height: auto !important;
    min-height: auto !important;
}

.page-platform-customers-list .workspace,
.page-platform-projects-list .workspace {
    height: auto !important;
}

/* Ensure tables are visible and not pushed down */
form#post-form {
    height: auto !important;
}

.workspace.h-100 {
    height: auto !important;
}

/* Custom Badge Colors - Blue Gradient Theme */
/* Base color: #0795e2 with darker and lighter variations */

/* Projects badge (bg-primary) */
.badge.bg-primary {
    background: linear-gradient(135deg, #0795e2 0%, #035688 100%) !important;
    color: white !important;
    border: none !important;
}

/* Files badge (bg-success) */
.badge.bg-success {
    background: linear-gradient(135deg, #0795e2 0%, #046ba6 100%) !important;
    color: white !important;
    border: none !important;
}

/* Notes badge (bg-info) */
.badge.bg-info {
    background: linear-gradient(135deg, #2da5e8 0%, #0580c4 100%) !important;
    color: white !important;
    border: none !important;
}

/* Security badge (bg-warning) */
.badge.bg-warning {
    background: linear-gradient(135deg, #0795e2 0%, #02416a 100%) !important;
    color: white !important;
    border: none !important;
}

/* Danger badge (keep for other uses) */
.badge.bg-danger {
    background: linear-gradient(135deg, #c23a3a 0%, #7a1f1f 100%) !important;
    color: white !important;
    border: none !important;
}

/* Add subtle shadow for depth */
.badge {
    box-shadow: 0 2px 4px rgba(7, 149, 226, 0.15) !important;
}

/* Custom Metric Card Colors - Blue Gradient Theme (for Dashboard) */
.metrics .metric:nth-child(1) {
    background: linear-gradient(135deg, #0795e2 0%, #035688 100%) !important;
    color: white !important;
}

.metrics .metric:nth-child(2) {
    background: linear-gradient(135deg, #0795e2 0%, #02416a 100%) !important;
    color: white !important;
}

.metrics .metric:nth-child(3) {
    background: linear-gradient(135deg, #2da5e8 0%, #0580c4 100%) !important;
    color: white !important;
}

.metrics .metric:nth-child(4) {
    background: linear-gradient(135deg, #0795e2 0%, #046ba6 100%) !important;
    color: white !important;
}

.metrics .metric:nth-child(5) {
    background: linear-gradient(135deg, #53b5ee 0%, #035688 100%) !important;
    color: white !important;
}

.metrics .metric:nth-child(6) {
    background: linear-gradient(135deg, #0795e2 0%, #012c4c 100%) !important;
    color: white !important;
}

/* Ensure all metric text is white and readable */
.metrics .metric h3,
.metrics .metric p,
.metrics .metric .metric-value,
.metrics .metric .metric-label {
    color: white !important;
}

/* Add subtle shadow for depth */
.metrics .metric {
    box-shadow: 0 4px 6px rgba(7, 149, 226, 0.15) !important;
    border: none !important;
}

/* ==============================================
   SIDEBAR TOGGLE FUNCTIONALITY
   ============================================== */

/* Sidebar toggle button - inside sidebar, top-right */
.sidebar-toggle-btn {
    position: fixed;
    top: 6px;
    left: 193px;
    z-index: 1050;
    background: #3a3f45;
    color: #aaa;
    border: none;
    border-radius: 3px;
    padding: 2px 5px;
    font-size: 0.65rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
    background: #4a4f55;
    color: #ddd;
}

/* When sidebar is hidden */
body.sidebar-collapsed .aside,
body.sidebar-collapsed aside,
body.sidebar-collapsed .aside-menu,
body.sidebar-collapsed nav.aside,
body.sidebar-collapsed .v-md-aside {
    transform: translateX(-100%);
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden;
    opacity: 0;
    padding: 0 !important;
    margin: 0 !important;
}

body.sidebar-collapsed .aside-collapse {
    display: none !important;
}

/* Expand main content when sidebar hidden */
body.sidebar-collapsed .workspace,
body.sidebar-collapsed main,
body.sidebar-collapsed .main-content,
body.sidebar-collapsed .v-md-workspace {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

body.sidebar-collapsed .container-fluid > .row > .col-xxl,
body.sidebar-collapsed .container-fluid > .row > .col-xl-9,
body.sidebar-collapsed .container-fluid > .row > .col-12:not(.aside) {
    margin-left: 0 !important;
}

body.sidebar-collapsed .container-fluid {
    padding-left: 1rem !important;
}

/* When sidebar is collapsed, keep button at top-left corner */
body.sidebar-collapsed .sidebar-toggle-btn {
    left: 6px;
}

/* Smooth transitions */
.aside,
aside,
.aside-menu,
nav.aside,
.v-md-aside,
.workspace,
main,
.main-content,
.v-md-workspace,
.sidebar-toggle-btn {
    transition: all 0.3s ease;
}

/* ==============================================
   FIX: Add padding to content near toggle button
   ============================================== */

/* Add left padding to main content area */
.workspace,
.v-md-workspace,
main.workspace {
    padding-left: 0.25rem !important;
}

/* Ensure content doesn't touch toggle button when sidebar is collapsed */
body.sidebar-collapsed .workspace,
body.sidebar-collapsed main.workspace {
    padding-left: 2rem !important;
}


/* ==============================================
   DARK MODE - Main Content Area
   ============================================== */

/* Sidebar / Menu background */
.aside,
aside,
.aside-menu,
nav.aside,
.v-md-aside {
    background-color: #1c1b22 !important;
}

/* Global dark background */
html,
body {
    background-color: #21252b !important;
}

.container-fluid,
.container-fluid > .row,
.col-xxl,
.col-xl-9,
.col-12,
.mx-auto {
    background-color: #21252b !important;
}

/* Main content background */
.workspace,
main.workspace,
.v-md-workspace {
    background-color: #21252b !important;
}

/* Screen/content area */
.screen,
#post-form {
    background-color: #21252b !important;
    color: #e0e0e0 !important;
}

/* ALL text should be light */
body,
p,
span,
div,
td,
th,
li,
small {
    color: #e0e0e0;
}

/* Cards */
.card {
    background-color: #1b1d21 !important;
    border-color: #343a40 !important;
    color: #e0e0e0 !important;
}

.card-header {
    background-color: #1b1d21 !important;
    border-bottom-color: #343a40 !important;
    color: #e0e0e0 !important;
}

.card-body {
    background-color: #1b1d21 !important;
    color: #e0e0e0 !important;
}

/* List groups */
.list-group-item {
    background-color: #21252b !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

/* Tables */
.table {
    color: #e0e0e0 !important;
    --bs-table-bg: #21252b !important;
    --bs-table-striped-bg: #2c3034 !important;
    --bs-table-hover-bg: #343a40 !important;
    --bs-table-border-color: #404040 !important;
}

.table > thead {
    background-color: #21252b !important;
}

.table > thead th,
.table th {
    background-color: #21252b !important;
    color: #e0e0e0 !important;
    border-color: #404040 !important;
}

.table > tbody > tr > td,
.table td {
    background-color: #21252b !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: #2c3034 !important;
}

.table-hover > tbody > tr:hover > td {
    background-color: #343a40 !important;
}

/* Forms */
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    background-color: #21252b !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

.form-control:focus,
.form-select:focus {
    background-color: #2c3034 !important;
    border-color: #0795e2 !important;
    color: #e0e0e0 !important;
}

.form-control::placeholder {
    color: #888888 !important;
}

.form-label,
label {
    color: #e0e0e0 !important;
}

/* Bg-white overrides for dark mode - AGGRESSIVE */
.bg-white,
.bg-light,
.bg-body,
[class*="bg-white"],
[class*="bg-light"],
div.bg-white,
div.bg-light,
.bg-white.rounded,
.bg-white.rounded.shadow-sm,
.bg-white.rounded.shadow-sm.p-4,
.bg-white.rounded.shadow-sm.p-3,
.bg-white.rounded.shadow-sm.p-4.mb-3,
.bg-white.rounded.shadow-sm.p-3.mb-3,
.screen .bg-white,
.screen div.bg-white,
.screen > div,
.screen > .bg-white,
#post-form > div,
#post-form .bg-white,
.workspace .bg-white,
.layout .bg-white,
fieldset .bg-white,
.d-flex.flex-column .bg-white {
    background-color: #21252b !important;
    background: #21252b !important;
}

/* Target the specific Orchid layout wrappers */
.screen > div.bg-white.rounded.shadow-sm,
.screen > fieldset > div.bg-white,
fieldset > .col-12 > .bg-white,
fieldset .shadow-sm,
.layout-wrapper,
.d-flex.flex-column.layout-wrapper {
    background-color: #21252b !important;
    background: #21252b !important;
}

/* Force all direct children of screen to be dark */
.screen > * {
    background-color: #21252b;
}

/* Override any inline white backgrounds */
[style*="background-color: white"],
[style*="background-color: #fff"],
[style*="background-color: #ffffff"],
[style*="background: white"],
[style*="background: #fff"],
[style*="background: #ffffff"] {
    background-color: #21252b !important;
    background: #21252b !important;
}

/* Text colors */
.text-muted {
    color: #aaaaaa !important;
}

.text-body,
.text-body-emphasis {
    color: #e0e0e0 !important;
}

.text-dark {
    color: #e0e0e0 !important;
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: #e0e0e0 !important;
}

/* Page titles and descriptions */
header h1,
header small,
.command-bar-wrapper h1,
.command-bar-wrapper small {
    color: #e0e0e0 !important;
}

/* Links in dark mode - keep visible */
a {
    color: #4db8ff !important;
}

a:hover {
    color: #80ccff !important;
}

/* White text links stay white */
a.text-white {
    color: #ffffff !important;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent !important;
}

.breadcrumb-item,
.breadcrumb-item a {
    color: #aaaaaa !important;
}

.breadcrumb-item.active {
    color: #e0e0e0 !important;
}

/* Metrics cards */
.bg-white.rounded.shadow-sm {
    background-color: #21252b !important;
}

/* Dropdown menus */
.dropdown-menu {
    background-color: #21252b !important;
    border-color: #404040 !important;
}

.dropdown-item {
    color: #e0e0e0 !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #343a40 !important;
    color: #ffffff !important;
}

/* TomSelect (Orchid select fields) */
.ts-control,
.ts-wrapper .ts-control {
    background-color: #21252b !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

.ts-control input,
.ts-control .item {
    color: #e0e0e0 !important;
}

.ts-control.focus,
.ts-wrapper.focus .ts-control {
    background-color: #2c3034 !important;
    border-color: #0795e2 !important;
    color: #e0e0e0 !important;
}

.ts-dropdown,
.ts-dropdown-content {
    background-color: #21252b !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

.ts-dropdown .option,
.ts-dropdown .optgroup-header,
.ts-dropdown .no-results {
    color: #e0e0e0 !important;
    background-color: #21252b !important;
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
    background-color: #343a40 !important;
    color: #ffffff !important;
}

.ts-dropdown .option.selected {
    background-color: #0795e2 !important;
    color: #ffffff !important;
}

/* Modals */
.modal-content {
    background-color: #21252b !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

.modal-header,
.modal-footer {
    border-color: #404040 !important;
}

/* Pagination */
.page-link {
    background-color: #21252b !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

.page-link:hover {
    background-color: #343a40 !important;
}

.page-item.active .page-link {
    background-color: #0795e2 !important;
    border-color: #0795e2 !important;
}

/* Alerts in dark mode */
.alert {
    background-color: #21252b !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

/* Command bar */
.command-bar-wrapper {
    background-color: #21252b !important;
    color: #e0e0e0 !important;
}

/* Layout wrapper */
.layout-wrapper {
    background-color: #21252b !important;
}

/* Shadow adjustments for dark mode */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.4) !important;
}

/* Borders */
.border {
    border-color: #404040 !important;
}

/* Rounded containers */
.rounded {
    background-color: #21252b !important;
}

/* Remove any white/light borders */
.aside,
aside,
.col-xxl,
.col-xl-9 {
    border: none !important;
}

/* Fix white line between sidebar and content */
.row {
    --bs-gutter-x: 0 !important;
}

.aside + .col-xxl,
.aside + .col-xl-9,
aside + .col-xxl,
aside + .col-xl-9 {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Page title and description */
.fw-light,
h1.fw-light,
h1.m-0,
.h3 {
    color: #e0e0e0 !important;
}

/* Metric/Legend cards */
.legend,
.legend span,
.legend small,
.bg-white span,
.bg-white small,
.rounded span,
.rounded small {
    color: #e0e0e0 !important;
}

/* Month/group header rows in tables */
.table tr.bg-light,
.table tr[class*="bg-"],
.table .bg-light,
.table .text-muted,
tr.bg-light td,
tr.bg-light th {
    background-color: #21252b !important;
    color: #e0e0e0 !important;
}

/* Fieldset legends */
fieldset,
legend {
    color: #e0e0e0 !important;
}

/* Any remaining gray text */
.text-secondary,
.text-gray,
.text-black-50 {
    color: #aaaaaa !important;
}

/* Orchid metrics component */
[class*="metric"],
.metrics span,
.metrics small,
.metrics div {
    color: #e0e0e0 !important;
}

/* ==============================================
   BUTTON OUTLINE STYLES - Dark Mode Visible
   ============================================== */
.btn-outline-warning {
    color: #ffc107 !important;
    border-color: #ffc107 !important;
    background-color: transparent !important;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning:active {
    color: #000 !important;
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
}

.btn-outline-secondary {
    color: #adb5bd !important;
    border-color: #adb5bd !important;
    background-color: transparent !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    color: #000 !important;
    background-color: #adb5bd !important;
}

.btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

/* ==============================================
   PAGE HEADER / COMMAND BAR - Force Dark Background
   ============================================== */
.command-bar,
.command-bar-wrapper,
.d-flex.flex-wrap.mb-2,
.d-sm-flex.align-items-center.justify-content-between,
header.d-sm-flex,
.screen > header,
.screen > div:first-child,
.row.g-0.mb-2,
div[class*="command"],
.mb-md-0,
.order-first,
.order-last {
    background-color: #21252b !important;
    background: #21252b !important;
}

/* Page title area specifically */
.screen > .row:first-child,
.screen > .d-flex:first-child,
.screen > .d-sm-flex:first-child,
.screen > .mb-2:first-child,
.screen > .mb-3:first-child {
    background-color: #21252b !important;
}

/* Title text */
.screen h1,
.screen h2,
.screen .h1,
.screen .h2,
.command-bar h1,
.command-bar-wrapper h1,
header h1 {
    color: #e0e0e0 !important;
    background-color: transparent !important;
}

/* Description text */
.screen small,
.screen p.text-muted,
.command-bar small,
header small {
    color: #aaaaaa !important;
    background-color: transparent !important;
}

/* The actual Orchid header wrapper */
.bg-white.rounded.shadow-sm.mb-2,
.bg-white.rounded.shadow-sm.mb-3 .d-flex,
.p-4.mb-3.d-flex,
.d-flex.flex-wrap {
    background-color: #21252b !important;
    background: #21252b !important;
}

/* Nuclear option - any element with white bg in screen */
.screen *[style*="background"] {
    background-color: #21252b !important;
}

/* Override body if needed */
body,
html {
    background-color: #21252b !important;
}

/* ==============================================
   BOOTSTRAP 5.3 DARK MODE OVERRIDES
   ============================================== */

/* Force dark theme colors */
.text-body-emphasis {
    color: #e0e0e0 !important;
}

.text-body {
    color: #e0e0e0 !important;
}

.link-body-emphasis {
    color: #e0e0e0 !important;
}

/* Specific header area targeting */
.command-bar-wrapper {
    background-color: #21252b !important;
}

.command-bar-wrapper .layout {
    background-color: #21252b !important;
}

.command-bar-wrapper header {
    background-color: #21252b !important;
}

.command-bar-wrapper h1 {
    color: #e0e0e0 !important;
    background: transparent !important;
}

.command-bar-wrapper small {
    color: #aaaaaa !important;
}

/* The main content column */
.col-xxl.col-xl-9,
.col-xxl,
.mx-auto {
    background-color: #21252b !important;
}

/* Workspace area */
.workspace,
.workspace-limit {
    background-color: #21252b !important;
}

/* Container */
.container-fluid,
.container-xl {
    background-color: #21252b !important;
}

/* Row backgrounds */
.row {
    background-color: transparent !important;
}

/* Any div with white background via Bootstrap */
div[class*="bg-body"],
.bg-body,
.bg-body-secondary,
.bg-body-tertiary {
    background-color: #21252b !important;
}

/* ==============================================
   STAT CARDS - Dashboard Wells (Global)
   ============================================== */
.stat-cards-row {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 5px !important;
}

.stat-card {
    background: #2d3238 !important;
    border: 1px solid #3d444c !important;
    border-radius: 4px !important;
    padding: 4px 6px !important;
    text-align: center !important;
}

.stat-card .stat-value {
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #e0e0e0 !important;
}

.stat-card .stat-label {
    font-size: 0.65rem !important;
    color: #aaaaaa !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

.stat-card.highlight {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.stat-card.highlight .stat-value {
    color: white !important;
}

.stat-card.highlight .stat-label {
    color: rgba(255,255,255,0.8) !important;
}

/* Month divider rows in tables */
.month-divider {
    background: #3d444c !important;
    color: #e0e0e0 !important;
}

.month-divider td {
    background: #3d444c !important;
    color: #e0e0e0 !important;
}

.month-divider .month-name {
    color: #e0e0e0 !important;
}

/* Kalshi menu balance - muted style */
.aside-menu a[href*="kalshi"] .badge {
    background: transparent !important;
    color: #888 !important;
    font-weight: normal !important;
    font-size: 0.8rem !important;
}

/* Remove workspace width constraints so content fills available space */
.workspace-limit {
    max-width: none !important;
}
.container-xl {
    max-width: 100% !important;
}

/* Sidebar sizing and full-height flush layout */
.aside,
aside,
.aside-menu,
nav.aside,
.v-md-aside {
    width: 205px !important;
    min-width: 205px !important;
    max-width: 205px !important;
    flex: 0 0 205px !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    margin: 0 !important;
    padding-top: 0 !important;
    overflow-y: auto !important;
    z-index: 1040;
}

/* Offset main content to account for fixed sidebar */
.container-fluid > .row > .col-xxl,
.container-fluid > .row > .col-xl-9,
.container-fluid > .row > .col-12:not(.aside) {
    margin-left: 211px !important;
}

/* Remove container-fluid left padding so sidebar is flush */
.container-fluid {
    padding-left: 0 !important;
}

/* ==============================================
   FLATPICKR DATE PICKER - Dark Mode
   ============================================== */
.flatpickr-calendar {
    background: #1c1b22 !important;
    border: 1px solid #404040 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.flatpickr-months {
    background: #1c1b22 !important;
}

.flatpickr-months .flatpickr-month {
    background: #1c1b22 !important;
    color: #e0e0e0 !important;
    fill: #e0e0e0 !important;
}

.flatpickr-current-month {
    color: #e0e0e0 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: #1c1b22 !important;
    color: #e0e0e0 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: #1c1b22 !important;
    color: #e0e0e0 !important;
}

.flatpickr-current-month input.cur-year {
    color: #e0e0e0 !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: #e0e0e0 !important;
    fill: #e0e0e0 !important;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    fill: #e0e0e0 !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: #ffffff !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: #ffffff !important;
}

.flatpickr-weekdays {
    background: #1c1b22 !important;
}

span.flatpickr-weekday {
    background: #1c1b22 !important;
    color: #888 !important;
    font-weight: 600 !important;
}

.flatpickr-days {
    background: #1c1b22 !important;
    border: none !important;
}

.dayContainer {
    background: #1c1b22 !important;
}

.flatpickr-day {
    color: #e0e0e0 !important;
    border-color: transparent !important;
}

.flatpickr-day:hover {
    background: #2d3238 !important;
    border-color: #404040 !important;
    color: #ffffff !important;
}

.flatpickr-day.today {
    border-color: #0795e2 !important;
}

.flatpickr-day.today:hover {
    background: #0795e2 !important;
    color: #ffffff !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #0795e2 !important;
    border-color: #0795e2 !important;
    color: #ffffff !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #555 !important;
}

.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: #2d3238 !important;
    color: #aaa !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #404040 !important;
}

.numInputWrapper span {
    border-color: #404040 !important;
}

.numInputWrapper span:hover {
    background: #2d3238 !important;
}

.numInputWrapper span svg path {
    fill: #e0e0e0 !important;
}

.flatpickr-time {
    background: #1c1b22 !important;
    border-top: 1px solid #404040 !important;
}

.flatpickr-time input {
    color: #e0e0e0 !important;
    background: #1c1b22 !important;
}

.flatpickr-time .flatpickr-am-pm {
    color: #e0e0e0 !important;
    background: #1c1b22 !important;
}

.flatpickr-time .flatpickr-am-pm:hover {
    background: #2d3238 !important;
}

/* ==============================================
   PRIVACY MODE - Hide financial totals bar
   ============================================== */

body.privacy-blur .fin-summary-row {
    display: none !important;
}
