:root {
    --glass-bg: rgba(15, 23, 42, 0.7);
    /* Deeper Slate Glass */
    --glass-bg-hover: rgba(30, 41, 59, 0.5);
    --glass-border: rgba(255, 255, 255, 0.08);
    /* Subtle light border for dark bg */
    --glass-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.4);
    --primary-gradient: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    /* Vibrant Blue */
    --accent-gradient: linear-gradient(135deg, #93c5fd 0%, #3b82f6 100%);
    --card-radius: 24px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    background: #0a0f18 !important;
    /* Deeper, richer dark background */
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(37, 99, 235, 0.12) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(29, 78, 216, 0.1) 0, transparent 50%),
        radial-gradient(at 0% 100%, rgba(59, 130, 246, 0.1) 0, transparent 50%) !important;
    background-attachment: fixed !important;
    font-family: var(--font-body) !important;
    font-size: 16px !important;
    color: #f8fafc !important;
    /* High contrast light text */
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.01em;
}

/* Organic Noise Texture Overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.03;
    /* Slightly reduced for cleaner dark feel */
    pointer-events: none;
    z-index: 10000;
}

/* Glass Panels */
.glass-panel,
.card,
.modal-content,
.bg-white,
.bg-light,
.btn-white,
.btn-light,
.toast,
.alert,
.dropdown-menu,
.popover,
.card-header,
.card-footer,
.navbar-header,
.site-footer,
.footer-inner {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(25px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(200%) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow) !important;
    color: #f8fafc !important;
    border-radius: 16px !important;
}

section,
main,
.right-panel,
.content,
#right-panel {
    background: transparent !important;
}

/* Header */
.header {
    background: rgba(2, 6, 23, 0.8) !important;
    /* Darker header */
    backdrop-filter: blur(25px) !important;
    border-bottom: none !important;
    height: 85px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: sticky !important;
    top: 0;
    z-index: 1000;
}

/* Layout */
/* Full Width Header & Footer */
.header,
.site-footer {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(2, 6, 23, 0.8) !important;
    backdrop-filter: blur(25px) saturate(200%) !important;
    border: none !important;
    border-top: 1px solid var(--glass-border) !important;
}

.header {
    border-top: none !important;
    border-bottom: 1px solid var(--glass-border) !important;
    position: sticky !important;
    top: 0;
    z-index: 1000;
}

.footer-inner {
    background: transparent !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 5% !important;
    padding-right: 5% !important;
}

.hover-white:hover {
    color: #ffffff !important;
    transition: color 0.3s ease;
}

.mini-text {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Fix Nested Borders in Selects */
.bootstrap-select>.btn,
.bootstrap-select .dropdown-toggle {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.bootstrap-select {
    border: 1px solid var(--glass-border) !important;
    border-radius: 14px !important;
    background: rgba(15, 23, 42, 0.8) !important;
}

/* Ensure right panel has no top margin */
.right-panel {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#right-panel {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 !important;
}

.content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 30px 5% !important;
    /* Symmetric 5% padding for equal visual width */
    box-sizing: border-box !important;
}

.container,
.container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.row {
    margin-left: -15px !important;
    margin-right: -15px !important;
    width: auto !important;
}

/* Typography Visibility */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #ffffff !important;
    font-family: var(--font-heading) !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
}

.text-muted {
    color: #94a3b8 !important;
    /* Slate 400 for better visibility in dark mode */
}

.text-primary,
.text-success {
    background: var(--primary-gradient);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    font-weight: 700;
}

/* Calendar Day Box */
.calendar .day-box {
    min-height: 12rem !important;
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    margin: 0 !important;
    overflow: hidden;
}

.calendar .day-box:hover {
    background: rgba(51, 65, 85, 0.5) !important;
    transform: scale(1.02) !important;
    z-index: 10;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 0 20px rgba(59, 130, 246, 0.2);
}

.calendar .active-today {
    background: var(--primary-gradient) !important;
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.15), 0 0 40px rgba(59, 130, 246, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.calendar .active-today * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
}

.calendar .is-holiday .h2 {
    color: #f87171 !important;
    /* Softer red for dark mode */
}

.tithi-text {
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    opacity: 0.8;
    text-transform: capitalize;
    color: #cbd5e1 !important;
}

.day-names li {
    background: rgba(15, 23, 42, 0.6) !important;
    padding: 10px !important;
    margin: 2px !important;
    border: 1px solid var(--glass-border) !important;
    color: #94a3b8 !important;
    font-weight: 600;
}

/* Home Widgets */
.home-widget {
    min-height: 250px;
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 28px !important;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1) !important;
}

.home-widget:hover {
    background: rgba(51, 65, 85, 0.5) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    transform: translateY(-8px) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5) !important;
}

.home-widget i {
    color: #60a5fa !important;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.4));
}

/* Forms & Selects */
.form-control,
select {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid var(--glass-border) !important;
    color: #f8fafc !important;
    border-radius: 14px !important;
    padding: 0 20px !important;
    height: 50px !important;
    line-height: normal !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.3s ease;
    font-size: 15px !important;
}

/* Remove nested borders from bootstrap-select inner elements */
.bootstrap-select>.btn,
.bootstrap-select .dropdown-toggle {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    height: 48px !important;
    /* Slightly less than 50px to stay within parent border */
    background: transparent !important;
}

.form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

/* Buttons */
.btn {
    height: 50px !important;
    padding: 0 30px !important;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1) !important;
    border: none !important;
}

.btn-primary {
    background: var(--primary-gradient) !important;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3) !important;
    color: white !important;
}

.btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.4) !important;
}

/* Footer & Info Centering */
.site-footer,
.footer-inner {
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
    width: 100% !important;
    color: #94a3b8 !important;
}

.site-footer .col-sm-6 {
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    flex: 0 0 100%;
}

/* Ensure Logo/SVG colors work on dark */
svg path[style*="fill:#606161"],
svg rect[style*="fill:#606161"],
svg circle[style*="fill:#606161"],
svg rect[fill="#606161"],
svg path[fill="#606161"] {
    fill: #f8fafc !important;
}

/* Fix for standard white backgrounds that might bleed through */
.bg-white,
.white-color,
.color-white,
.bg-light {
    background-color: transparent !important;
    color: #f8fafc !important;
}

.table {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(15px) saturate(180%) !important;
    color: #ffffff !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

.table thead th,
.table thead td {
    background: rgba(255, 255, 255, 0.08) !important;
    border-bottom: 2px solid var(--glass-border) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.table tbody td {
    border-top: 1px solid var(--glass-border) !important;
    padding: 12px 15px !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}