:root {
    --primary-red: #E63946;
    /* Softer, more professional red */
    --bg-dark: #1A1A1A;
    /* Semi-dark background (Charcoal) */
    --card-bg: #242424;
    /* Slightly lighter card background */
    --input-bg: #2E2E2E;
    --border-color: #404040;
    --text-primary: #F1F1F1;
    /* Soft white */
    --text-secondary: #B3B3B3;
    /* Muted grey */
    --white: #ffffff;
}

.text-primary-red {
    color: var(--primary-red) !important;
}

body {
    background-color: #000;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    /* Premium Red-White-Black Gradient */
    background-image:
        radial-gradient(circle at 0% 0%, rgba(230, 57, 70, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Brand Logo Styling */
.su-brand {
    font-size: 5rem;
    line-height: 0.8;
    font-weight: 700;
    color: var(--primary-red);
    letter-spacing: -3px;
}

.studio-brand {
    font-family: 'Times New Roman', Times, serif;
    font-size: 2.2rem;
    line-height: 1;
    color: var(--white) !important;
    font-weight: 500;
    letter-spacing: 1px;
}

.brand-divider {
    height: 3px;
    background-color: var(--primary-red);
    width: 100%;
    margin-top: 4px;
    margin-bottom: 6px;
}

.brand-taglines p {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: #cccccc;
    letter-spacing: 0.5px;
    line-height: 1.3;
    text-transform: uppercase;
}

/* Card Styling */
.card {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px !important;
}

/* --- Dashboard Styles (Dark Glass Premium) --- */

/* Wrapper & Sidebar */
:root {
    /* Lighter Gradient: Gunmetal to Soft Slate to reduce "heaviness" */
    --main-bg: linear-gradient(135deg, #222831 0%, #393E46 100%);
    --sidebar-width: 220px;
    --header-height: 65px;
    /* Lighter Glass: Less transparent, slightly lighter grey base */
    --glass-bg: rgba(50, 55, 60, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.12);
    /* Crisper border */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    /* Softer shadow */
    --text-light: #EEEEEE;
    --text-muted: #ADB5BD;
}

.dashboard-body {
    background: var(--main-bg);
    /* Full gradient background */
    overflow-x: hidden;
    color: var(--text-light);
    font-size: 0.9rem;
    min-height: 100vh;
}

#wrapper {
    display: flex;
    width: 100%;
    overflow-x: hidden;
}

/* Sidebar remains the same Black Gradient */
#sidebar-wrapper {
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #000000 0%, #1a1a1a 100%);
    width: 240px;
    border-right: 1px solid #333;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: all 0.25s ease-out;
}

#page-content-wrapper {
    flex: 1;
    min-width: 0;
    width: 100%;
    margin-left: 240px;
    /* Offset for fixed sidebar */
    transition: all 0.25s ease-out;
}

#wrapper.toggled #sidebar-wrapper {
    left: -240px;
}

#wrapper.toggled #page-content-wrapper {
    margin-left: 0;
}

@media (max-width: 768px) {
    #sidebar-wrapper {
        left: -240px;
    }

    #page-content-wrapper {
        margin-left: 0;
    }

    #wrapper.toggled #sidebar-wrapper {
        left: 0;
    }
}

/* Sidebar Branding (Scaled Down from Login) */
.su-brand-sidebar {
    font-size: 2.5rem;
    /* ~50% of login size */
    line-height: 0.8;
    font-weight: 700;
    color: var(--primary-red);
    letter-spacing: -1px;
    margin-right: 10px;
}

.studio-brand-sidebar {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.1rem;
    /* Scaled down */
    line-height: 1;
    color: var(--white);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.brand-divider-sidebar {
    height: 2px;
    background-color: var(--primary-red);
    width: 100%;
    margin-top: 2px;
    margin-bottom: 3px;
}

.brand-taglines-sidebar p {
    font-family: 'Outfit', sans-serif;
    font-size: 0.45rem;
    /* Scaled down tagline */
    font-weight: 700;
    color: #cccccc;
    letter-spacing: 0.5px;
    line-height: 1.2;
    text-transform: uppercase;
    text-align: left;
}

/* Sidebar Branding */
.su-brand-sm {
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    color: var(--primary-red);
    text-shadow: 0 0 10px rgba(230, 57, 70, 0.3);
}

.studio-brand-sm {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 500;
    color: var(--white);
    letter-spacing: 0.5px;
}

/* Sidebar Links */
.list-group-item {
    border: none;
    padding: 12px 15px;
    /* Reduced side padding (was 25px) to move left */
    font-size: 0.95rem;
    background-color: transparent !important;
    color: #a0a0a0;
    /* Muted white */
    font-weight: 400;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

/* High specificity fix for sidebar hover */
#sidebar-wrapper .list-group-item:hover,
#sidebar-wrapper .list-group-item[data-bs-toggle="collapse"]:hover,
#sidebar-wrapper a.list-group-item:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
    padding-left: 20px;
    opacity: 1 !important;
    visibility: visible !important;
}

.list-group-item.active {
    color: var(--white);
    background-color: rgba(230, 57, 70, 0.15) !important;
    /* Red Tint */
    border-left: 4px solid var(--primary-red);
    font-weight: 600;
}

.list-group-item i {
    width: 25px;
    text-align: center;
    margin-right: 10px;
}

/* Submenu Styling */
.collapse .list-group-item {
    font-size: 0.85rem;
    padding-left: 45px !important;
    color: #b0b0b0;
    /* Brightened from #888 to fix "disappearance" */
}

.collapse .list-group-item:hover,
.collapse .list-group-item.active {
    color: var(--white) !important;
    background-color: rgba(230, 57, 70, 0.1) !important;
    padding-left: 50px !important;
}

/* Logout specific */
.text-logout {
    color: #ff6b6b !important;
}

.text-logout:hover {
    color: #ff4d4d !important;
    background-color: rgba(255, 77, 77, 0.1) !important;
}

/* Navbar - Transparent on Dark */
.navbar {
    height: var(--header-height);
    background-color: transparent !important;
    /* Transparent to show gradient */
    box-shadow: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.page-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    /* Slightly larger */
    font-weight: 700;
    color: var(--text-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Breadcrumb override */
.breadcrumb-item a {
    color: var(--text-muted) !important;
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.5) !important;
}

.breadcrumb-item+.breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.3);
}

/* User Text */
.text-welcome-light {
    color: var(--text-muted);
}

.text-user-light {
    color: var(--white);
}

/* Glass Cards */
.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 12px;
    color: var(--text-light);
}

.alert-glass {
    background: rgba(13, 110, 253, 0.25) !important;
    border: 1px solid rgba(13, 110, 253, 0.5) !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px !important;
    font-size: 0.9rem;
    padding: 15px;
}

.alert-glass strong {
    color: #ffd166 !important;
    /* Changed to high-contrast yellow/gold for readability */
    font-weight: 700 !important;
}

/* Filter Section */
.filter-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

/* Inputs on Dark */
.form-control-dark,
.form-select-dark {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-control-dark:focus,
.form-select-dark:focus {
    background-color: rgba(0, 0, 0, 0.5);
    border-color: var(--primary-red);
    color: var(--white);
    box-shadow: none;
}

.form-control-dark::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Fix Select Option Contrast */
.form-select-dark option {
    background-color: #333;
    /* Dark background for options */
    color: var(--text-light);
    padding: 10px;
}

/* Fix Bootstrap Dropdown Menus */
.dropdown-menu-dark {
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-item {
    color: var(--text-light);
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

/* Buttons */
.btn-studio-primary {
    background: linear-gradient(135deg, var(--primary-red) 0%, #c92a2a 100%);
    color: var(--white);
    border: none;
    padding: 6px 16px;
    /* Reduced padding for compact look */
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
}

.btn-studio-text {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 12px;
    transition: all 0.2s;
}

.btn-studio-text:hover {
    color: var(--white);
    text-decoration: underline;
}

.btn-studio-primary:hover {
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.6);
    color: white;
    transform: translateY(-1px);
}

.btn-studio-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    transition: all 0.3s;
}

.btn-studio-glass:hover,
.btn-studio-glass.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--white);
}

/* Table Design - Transparent Dark */
.table-glass {
    color: var(--text-light);
    margin-bottom: 0;
    background-color: transparent !important;
    /* Force transparency */
}

.table-glass thead th {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 15px 20px;
}

.table-glass tbody,
.table-glass tbody tr,
.table-glass tbody td {
    background-color: transparent !important;
    /* Fix for white background issue */
    color: var(--text-light);
}

.table-glass tbody td {
    padding: 15px 20px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.table-glass tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    /* Subtle highlight */
    color: var(--white);
}

/* Badges - Slightly glowing */
.badge-glass-success {
    background: rgba(40, 167, 69, 0.2);
    color: #4cd964;
    border: 1px solid rgba(40, 167, 69, 0.3);
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.1);
    white-space: nowrap;
}

.badge-glass-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffcc00;
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-glass-secondary {
    background: rgba(108, 117, 125, 0.2);
    color: #adb5bd;
    border: 1px solid rgba(108, 117, 125, 0.3);
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
    white-space: nowrap;
}

/* Glass Alerts */
/* Glass Alerts Styles Consolidated Above */

.alert-glass-success {
    background: rgba(40, 167, 69, 0.15);
    border-color: rgba(40, 167, 69, 0.3);
    color: #4cd964;
}

.alert-glass-danger {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
}

.alert-glass .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Pagination Dark */
.studio-pagination .pagination {
    margin-bottom: 0;
}

.studio-pagination .page-link {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    margin: 0 2px;
}

.studio-pagination .page-item.active .page-link {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
    box-shadow: 0 0 10px rgba(230, 57, 70, 0.4);
}

.studio-pagination .page-item.disabled .page-link {
    background: transparent;
    border-color: transparent;
    color: rgba(255, 255, 255, 0.2);
}

.studio-pagination .page-link:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

/* Compact Table */
.studio-table {
    font-size: 0.85rem;
}

.studio-table thead th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.studio-table tbody tr {
    transition: background-color 0.2s;
}

.studio-table tbody tr:hover {
    background-color: rgba(230, 57, 70, 0.02);
}

.studio-table tbody td {
    vertical-align: middle;
    color: #444;
}

.table-hover tbody tr:hover {
    background-color: #fafafa;
}

.studio-table td {
    padding-top: 15px;
    padding-bottom: 15px;
    color: #555;
    font-size: 0.95rem;
}

/* Pagination */
.page-link {
    color: var(--bg-dark);
    box-shadow: none !important;
}

.page-link {
    font-size: 0.8rem;
    color: #555;
    box-shadow: none !important;
}

.page-item.active .page-link {
    background-color: var(--primary-red) !important;
    border-color: var(--primary-red) !important;
}

.page-item.active .page-link {
    color: var(--primary-red) !important;
    background: transparent !important;
    border-color: transparent !important;
}

.page-item.disabled .page-link {
    background-color: transparent;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-secondary) !important;
}

.small.text-uppercase {
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Form Styling */
.form-label,
.col-form-label {
    color: var(--white) !important;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.form-control {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px !important;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    background-color: var(--input-bg);
    border-color: var(--primary-red);
    color: var(--white);
    box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.2);
}

.form-control::placeholder {
    color: #666;
}

/* Consistent heights for inputs and selects */
.form-control:not(textarea),
.form-select {
    height: calc(1.5em + 1.5rem + 2px);
    /* Standardize height */
}

.form-control-sm,
.form-select-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
}

/* Remove Arrows/Spinners from Number Inputs */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Buttons and Links */
.btn-white {
    background-color: var(--primary-red);
    /* Changed to Red primary button */
    color: var(--white);
    border: none;
    padding: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 4px !important;
    /* Less rounded than pill for professional look */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-white:hover {
    background-color: #c92a35;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 57, 70, 0.4);
    color: var(--white);
}

.alert-glass strong {
    color: var(--primary-red) !important;
    font-weight: 700 !important;
}

.guide-glass {
    background: rgba(13, 110, 253, 0.1) !important;
    border: 1px solid rgba(13, 110, 253, 0.2) !important;
    color: #ffffff !important;
    border-radius: 8px;
    padding: 20px;
}

.text-danger {
    color: var(--primary-red) !important;
    font-weight: 500;
    transition: color 0.3s;
}

.text-danger:hover {
    text-decoration: none !important;
    color: #ff6b76 !important;
}

.btn-outline-dark {
    border-color: var(--border-color);
    color: var(--text-primary);
    border-radius: 4px !important;
}

.btn-outline-dark:hover {
    background-color: var(--border-color);
    color: var(--white);
    border-color: var(--border-color);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.card {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Tom Select Custom Styling */
.ts-wrapper.form-control-dark,
.ts-wrapper.form-select-dark {
    padding: 0 !important;
    background-color: transparent !important;
    border: none !important;
}

.ts-control {
    background-color: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-light) !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    min-height: 38px !important;
    transition: all 0.3s ease !important;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--primary-red) !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.2) !important;
}

.ts-dropdown {
    background: rgba(36, 36, 36, 0.95) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-light) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    border-radius: 8px !important;
    margin-top: 5px !important;
    z-index: 2000 !important;
    /* Ensure it stays above everything */
}

.ts-wrapper {
    z-index: 1050;
    /* Above bootstrap sticky/static elements but below dropdown */
}

.ts-dropdown .option {
    padding: 10px 15px !important;
    transition: background 0.2s !important;
}

.ts-dropdown .active {
    background-color: rgba(230, 57, 70, 0.2) !important;
    color: var(--white) !important;
}

.ts-dropdown .option:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.ts-control input {
    color: var(--white) !important;
}

/* Sticky Settings Info */
.settings-info-sticky {
    position: sticky;
    top: 20px;
    z-index: 100;
}

/* Fix for searchable input in dropdown */
.ts-wrapper .ts-control input::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}