@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* --- PALETTE --- */
    --primary-color: #FF6A00;
    --primary-hover: #E65A00;
    --primary-soft: rgba(255, 106, 0, 0.1);

    /* Neutrals - Light Mode */
    --bg-body: #F8F9FA;
    --bg-card: #FFFFFF;
    --bg-input: #FFFFFF;

    /* Text Colors */
    --text-title: #1E293B;
    --text-body: #475569;
    --text-muted: #94A3B8;
    --text-input: #1E293B;
    --text-input-placeholder: #94A3B8;

    /* Sidebar - Light Mode */
    --bg-sidebar: #FFFFFF;
    --sidebar-text: #64748B;
    --sidebar-text-hover: #FF6A00;
    --sidebar-bg-hover: rgba(255, 106, 0, 0.05);
    --sidebar-text-active: #FF6A00;
    --sidebar-bg-active: rgba(255, 106, 0, 0.1);
    --sidebar-brand-color: #1E293B;
    --sidebar-border-color: #E2E8F0;
    --sidebar-icon-color: #94A3B8;

    /* Borders */
    --border-color: #E2E8F0;
    --input-border-color: #E2E8F0;
    --input-border-focus: #FF6A00;

    /* --- DIMENSIONS --- */
    --sidebar-width: 280px;
    --header-height: 70px;
    --input-height: 48px;
    --input-radius: 12px;

    /* --- EFFECTS --- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
    --shadow-input-focus: 0 0 0 4px var(--primary-soft);

    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-speed: 0.2s;

    /* BOOTSTRAP OVERRIDES */
    --bs-primary: var(--primary-color);
    --bs-body-bg: var(--bg-body);
}

[data-bs-theme="dark"] {
    /* --- DARK PALETTE --- */
    --bg-body: #0f1115;
    --bg-card: #181b21;
    --bg-input: #232730;
    /* Slightly lighter than card */

    /* Text Colors */
    --text-title: #ffffff;
    --text-body: #9ca3af;
    --text-muted: #6b7280;
    --text-input: #ffffff;
    --text-input-placeholder: #6b7280;

    /* Sidebar - Dark Mode */
    --bg-sidebar: #0f1115;
    --sidebar-text: #9CA3AF;
    --sidebar-text-hover: #FFFFFF;
    --sidebar-bg-hover: rgba(255, 255, 255, 0.03);
    --sidebar-text-active: #000000;
    --sidebar-bg-active: var(--primary-color);
    --sidebar-brand-color: #FFFFFF;
    --sidebar-border-color: rgba(255, 255, 255, 0.03);
    --sidebar-icon-color: #6B7280;

    /* Borders */
    --border-color: #2d3342;
    --input-border-color: #2d3342;
    --input-border-focus: #FF6A00;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);

    --primary-soft: rgba(255, 106, 0, 0.15);

    /* Bootstrap Variable Overrides */
    --bs-body-bg: var(--bg-body);
    --bs-body-color: var(--text-body);
    --bs-border-color: var(--border-color);
}

/* --- TYPOGRAPHY --- */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-body);
    font-size: 0.925rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-title);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* --- LAYOUT --- */
.main-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-body);
    transition: margin-left var(--transition-speed), width var(--transition-speed);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1042;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.content-area {
    padding: 2rem 3rem;
    flex-grow: 1;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    min-height: calc(100vh - var(--header-height) - 60px);
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
    display: flex;
    flex-direction: column;
}

/* .content-area::-webkit-scrollbar {
    display: none;
} */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- SIDEBAR --- */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--bg-sidebar);
    color: var(--sidebar-text);
    z-index: 1045;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border-color);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sidebar-brand-color);
    letter-spacing: -0.02em;
}

.sidebar-menu {
    padding: 2rem 1rem;
    overflow-y: auto;
    scrollbar-width: none;
}

/* .sidebar-menu::-webkit-scrollbar {
    display: none;
} */

.sidebar-menu .nav-link {
    color: var(--sidebar-text);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    transition: all var(--transition-speed);
}

.sidebar-menu .nav-link i {
    font-size: 1.25rem;
    margin-right: 1rem;
    width: 24px;
    text-align: center;
    color: var(--sidebar-icon-color);
    transition: color var(--transition-speed);
}

.sidebar-menu .nav-link:hover {
    background-color: var(--sidebar-bg-hover);
    color: var(--sidebar-text-hover);
}

.sidebar-menu .nav-link:hover i {
    color: var(--sidebar-text-hover);
}

.sidebar-menu .nav-link.active {
    background-color: var(--sidebar-bg-active);
    color: var(--sidebar-text-active);
    box-shadow: none;
}

.sidebar-menu .nav-link.active i {
    color: var(--sidebar-text-active);
}

/* --- NAVBAR --- */
.navbar {
    height: var(--header-height);
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0 3rem;
    position: sticky;
    top: 0;
    z-index: 1040;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

/* --- FOOTER --- */
.footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1rem 3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    height: 60px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--primary-color);
}

/* --- COMPONENTS --- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

/* --- UNIFIED FORM STYLES --- */
.form-control,
.form-select,
.input-group-text,
textarea {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--input-border-color) !important;
    color: var(--text-input) !important;
    border-radius: var(--input-radius) !important;
    padding: 0.625rem 1rem;
    /* approx 10px 16px */
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
    box-shadow: none;
}

/* Adjust height for text inputs but not textareas */
.form-control:not(textarea),
.form-select {
    height: var(--input-height);
}

.form-control::placeholder {
    color: var(--text-input-placeholder) !important;
    opacity: 1;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-input) !important;
    border-color: var(--input-border-focus) !important;
    box-shadow: var(--shadow-input-focus) !important;
    color: var(--text-input) !important;
}

.input-group-text {
    border-right: none !important;
    color: var(--text-muted) !important;
}

/* Fix input group connecting borders */
.input-group .input-group-text+.form-control {
    border-left: none !important;
}

/* Unify File Input */
.form-control[type="file"] {
    line-height: inherit;
    padding-left: 0.75rem;
}

.form-control[type="file"]::file-selector-button {
    background-color: var(--bg-body);
    color: var(--text-title);
    border: none;
    border-right: 1px solid var(--input-border-color);
    padding: 0.375rem 0.75rem;
    margin-right: 0.75rem;
    margin-inline-start: -1rem;
    margin-block-start: -0.625rem;
    margin-block-end: -0.625rem;
    height: var(--input-height);
    transition: all 0.2s;
    cursor: pointer;
}

[data-bs-theme="dark"] .form-control[type="file"]::file-selector-button {
    background-color: rgba(255, 255, 255, 0.05);
}

.form-control[type="file"]:hover:not(:disabled)::file-selector-button {
    background-color: var(--border-color);
}

/* Unify Color Input */
.form-control-color {
    max-width: 3rem;
    padding: 0.375rem;
}

/* Checkbox & Radio */
.form-check-input {
    width: 1.25em;
    height: 1.25em;
    background-color: var(--bg-input) !important;
    border: 1px solid var(--input-border-color) !important;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.form-check-input:focus {
    border-color: var(--input-border-focus) !important;
    box-shadow: var(--shadow-input-focus) !important;
}

/* Range Input */
.form-range::-webkit-slider-thumb {
    background: var(--primary-color);
}

.form-range::-moz-range-thumb {
    background: var(--primary-color);
}

.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 0.25rem var(--primary-soft);
}

.form-range:focus::-moz-range-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 0.25rem var(--primary-soft);
}

/* --- BUTTONS --- */
.btn {
    padding: 0.625rem 1.5rem;
    border-radius: var(--input-radius);
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.2s;
    height: var(--input-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.btn-sm {
    height: 36px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-light {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-title);
}

.btn-light:hover {
    background-color: var(--border-color);
    color: var(--text-title);
}

.btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-color);
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--bg-input);
    color: var(--text-title);
    border-color: var(--text-muted);
}

/* --- TABLE UTILITIES --- */
.table {
    --bs-table-color: var(--text-body);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    --bs-table-striped-bg: rgba(0, 0, 0, 0.02);
    --bs-table-active-bg: rgba(0, 0, 0, 0.05);
    --bs-table-hover-bg: rgba(0, 0, 0, 0.03);
}

[data-bs-theme="dark"] .table {
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-active-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
}

.table thead th {
    background-color: var(--bg-card);
    color: var(--text-title);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* --- UTILITIES --- */
.text-dark {
    color: var(--text-title) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.bg-light {
    background-color: var(--bg-body) !important;
}

/* Borders */
.border,
.border-top,
.border-bottom,
.border-end,
.border-start {
    border-color: var(--border-color) !important;
}

/* Scrollbar Hide */
/* ::-webkit-scrollbar {
    display: none !important;
} */

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

html {
    overflow-x: hidden;
    overflow-y: auto;
}