/* ==========================================================================
   Modern Admin Theme (Funora)
   Overriding SB Admin 2 / Bootstrap 4 defaults for a premium look
   ========================================================================== */

/* --- Fonts & Base --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #6366f1;
    /* Indigo */
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    /* Pink */
    --bg-body: #f3f4f6;
    /* Very light gray */
    --bg-sidebar: #111827;
    /* Dark Gray/Black */
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --card-bg: #ffffff;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);

    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    background-color: var(--bg-body) !important;
    color: var(--text-dark);
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

/* --- Global Cards --- */
.card {
    border: none !important;
    border-left: 6px solid var(--primary-color) !important;
    border-radius: var(--border-radius-lg) !important;
    background-color: var(--card-bg) !important;
    box-shadow: var(--shadow-md) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* --- Sticky Sidebar Fix --- */
.sidebar {
    background: var(--sidebar-bg) !important;
    min-height: 100vh !important;
    position: sticky !important;
    top: 0 !important;
    height: 100vh !important;
    overflow-y: auto !important;
    z-index: 1000 !important;
}

/* Hide scrollbar for sidebar aesthetically */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.card:hover {
    box-shadow: var(--shadow-lg) !important;
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

/* --- Dashboard Metric Cards (Gradients) --- */
.card-stats.bg-gradient-primary {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
    box-shadow: var(--shadow-glow) !important;
}

.card-stats.bg-gradient-info {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%) !important;
    box-shadow: 0 10px 25px -5px rgba(6, 182, 212, 0.4) !important;
}

.card-stats.bg-gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4) !important;
}

.card-stats.bg-gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.4) !important;
}

.card-stats .text-xs {
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.card-stats .icon-circle {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.card-stats:hover .icon-circle {
    transform: scale(1.1) rotate(5deg);
}


/* --- Sidebar Redesign --- */
.sidebar {
    background: var(--bg-sidebar) !important;
    /* Adding subtle gradient overlay */
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%) !important;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
}

/* --- Make Sidebar Sticky (Desktop Only) --- */
@media (min-width: 768px) {
    .sidebar {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        min-height: 100vh !important;
        height: 100vh !important;
        overflow-y: auto !important;
        z-index: 1000 !important;
    }
}

.sidebar .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.6) !important;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 1rem 1.5rem !important;
    margin: 0.2rem 1rem;
    border-radius: var(--border-radius-sm);
    width: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .nav-item.active .nav-link {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(4px);
}

.sidebar .nav-item .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.sidebar .nav-item .nav-link i {
    color: rgba(255, 255, 255, 0.6) !important;
    transition: color 0.2s ease;
    font-size: 1.1rem;
    margin-right: 0.75rem !important;
}

.sidebar .nav-item.active .nav-link i,
.sidebar .nav-item .nav-link:hover i {
    color: var(--primary-color) !important;
    /* Glow text shadow effect for icons */
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.sidebar-heading {
    letter-spacing: 0.15em !important;
    color: rgba(255, 255, 255, 0.4) !important;
    font-weight: 700;
    font-size: 0.7rem !important;
    margin-top: 1.5rem;
}

.sidebar-brand {
    padding: 2rem 1rem !important;
    height: auto !important;
}

.sidebar-brand-text {
    font-weight: 800;
    letter-spacing: 0.05em;
    font-size: 1.3rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand-icon {
    font-size: 2rem;
    color: var(--primary-color);
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
}

/* Sidebar Collapse Menus */
.sidebar .collapse-inner {
    background: #1f2937 !important;
    /* Darker inner menu */
    border-radius: var(--border-radius-md) !important;
    margin: 0 1rem;
}

.sidebar .collapse-item {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.sidebar .collapse-item:hover,
.sidebar .collapse-item.active {
    background-color: transparent !important;
    color: #fff !important;
    transform: translateX(4px);
}

.sidebar .collapse-item.active {
    font-weight: 700;
    color: var(--primary-color) !important;
}

.sidebar .collapse-header {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Shrink sidebar tweak */
.sidebar.toggled .nav-item .nav-link {
    margin: 0;
    padding: 1rem !important;
    text-align: center;
}

/* --- Buttons --- */
.btn {
    border-radius: var(--border-radius-sm) !important;
    font-weight: 600 !important;
    letter-spacing: 0;
    transition: all 0.3s ease;
    border: none !important;
}

.btn-primary {
    background: var(--primary-color) !important;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4) !important;
}

.btn-primary:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.5) !important;
}

.btn-danger {
    background: #ef4444 !important;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.4) !important;
}

.btn-danger:hover {
    background: #dc2626 !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.5) !important;
}

/* Tables */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom-width: 1px !important;
    border-top: none !important;
}

.table td {
    vertical-align: middle !important;
    color: var(--text-dark);
    font-weight: 500;
}

/* Inputs / Forms */
.form-control {
    border-radius: var(--border-radius-sm) !important;
    border: 1px solid #d1d5db !important;
    padding: 0.6rem 1rem !important;
    min-height: 48px !important;
    /* Forces enough height */
    height: auto !important;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

select.form-control {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
    appearance: auto !important;
    /* Lets browser render the down arrow and space correctly */
}

.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

/* Topbar */
.topbar {
    background-color: var(--bg-body) !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Utility classes */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}