/* === Modern Medical Blue Theme === */
:root {
    /* Core Palette - Professional Blue & Medical Teal */
    --primary-color: #272f7a;
    /* Deep Royal Blue (Brand Match) */
    --primary-light: #4361ee;
    /* Vibrant Blue */
    --primary-dark: #1a2052;

    --accent-color: #00b4d8;
    /* Bright Cyan */
    --success-color: #2ec4b6;
    /* Medical Teal */
    --warning-color: #ff9f1c;
    --danger-color: #e71d36;

    /* Backgrounds */
    --bg-body: #f8faff;
    /* Very cool white/blue tint */
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;

    /* Typography */
    --text-main: #2b2d42;
    --text-muted: #8d99ae;
    --text-inverse: #ffffff;

    /* Spacing & Borders */
    --border-radius-xl: 20px;
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --border-radius-sm: 4px;

    /* Shadows - Soft & Modern */
    --shadow-sm: 0 2px 8px rgba(39, 47, 122, 0.05);
    --shadow-md: 0 8px 24px rgba(39, 47, 122, 0.08);
    --shadow-lg: 0 16px 40px rgba(39, 47, 122, 0.12);
    --shadow-hover: 0 20px 45px rgba(39, 47, 122, 0.15);
}

/* === Global Defaults === */
body {
    background-color: var(--bg-body);
    /* Global Background Image */
    background: url('../img/login-bg-v2.png') no-repeat center center fixed;
    background-size: cover;

    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    /* Force Plus Jakarta Sans for premium modern look */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}


/* Global Content Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Heavy overlay for readability on main pages */
    background: rgba(248, 250, 255, 0.94);
    z-index: -1;
    pointer-events: none;
}

/* === Header === */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(230, 235, 250, 0.9);
    box-shadow: var(--shadow-sm);
    height: 70px;
}

.header .logo span {
    color: var(--primary-color) !important;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* === Sidebar === */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: none;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    padding-top: 25px;
    z-index: 1000;
}

/* Override default sidebar link styles heavily */
.sidebar-nav .nav-link {
    background: transparent;
    color: var(--text-muted) !important;
    font-weight: 500;
    padding: 12px 15px;
    margin: 4px 15px;
    border-radius: var(--border-radius-lg);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
}

.sidebar-nav .nav-link i {
    color: var(--primary-color) !important;
    /* Changed from text-muted to match dashboard */
    font-size: 1.1rem !important;
    margin-right: 12px;
    transition: all 0.3s ease;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* Hover State */
.sidebar-nav .nav-link:hover {
    background-color: rgba(67, 97, 238, 0.08) !important;
    /* Extremely light blue */
    color: var(--primary-light) !important;
    transform: translateX(3px);
}

.sidebar-nav .nav-link:hover i {
    color: var(--primary-light) !important;
    transform: scale(1.1);
}

/* Active State (The "Cool" Part) */
.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    color: var(--text-inverse) !important;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    border: none;
}

.sidebar-nav .nav-link.active i {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Sub-menu items */
.sidebar-nav .nav-content a {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-left: 55px;
    border-left: 2px solid transparent;
    transition: all 0.2s;
    margin-left: 15px;
    /* Indent visual */
}

.sidebar-nav .nav-content a:hover,
.sidebar-nav .nav-content a.active {
    color: var(--primary-light);
    border-left-color: var(--primary-light);
    background: transparent;
}

.sidebar-nav .nav-content a.active {
    font-weight: 700;
    color: var(--primary-color);
}

.sidebar-nav .nav-content a i {
    display: inline-block;
    /* Show the icon */
    font-size: 0.9rem;
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    transition: all 0.3s;
}

.sidebar-nav .nav-content a:hover i,
.sidebar-nav .nav-content a.active i {
    color: var(--primary-light);
}


/* === Cards === */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    margin-bottom: 25px;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 20px 25px;
}

.card-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.15rem;
    margin: 0;
    padding: 0;
}

.pagetitle h1 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 15px;
    position: relative;
    padding-left: 15px;
}

.pagetitle h1::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    width: 5px;
    background: var(--accent-color);
    border-radius: 4px;
}



/* === Buttons === */
.btn {
    border-radius: var(--border-radius-md);
    font-weight: 500;
    padding: 10px 22px;
    text-transform: capitalize;
    /* Cleaner look */
    letter-spacing: 0.3px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

/* === Inputs === */
.form-control,
.form-select {
    background-color: #f9fbfd;
    border: 1px solid #e1e7ec;
    border-radius: var(--border-radius-md);
    padding: 12px 15px;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    background-color: #ffffff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

/* === Scrollbars === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-light);
}

/* === Breadcrumb === */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* === Global Search Bar (Ultra Modern & Wide) === */
/* === Global Search Bar (Ultra Modern & Wide) === */
.search-bar {
    flex-grow: 1;
    max-width: 700px;
    /* Slightly wider than 600 user set, for balance */
    padding: 0 40px;
    position: relative;
    z-index: 1001;
}

.search-form {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.search-form input {
    border: 2px solid #e3e8ee;
    /* Distinct rounded border */
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    padding: 10px 60px 10px 30px;
    border-radius: 100px;
    /* Maximum Roundness */
    transition: all 0.3s ease;
    width: 100%;
    background: #f8fbff;
    height: 50px;
    /* Reduced slightly to create space */
    margin: 5px 0;
    /* Top and Bottom Space */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
}

.search-form input::placeholder {
    color: #94a3b8;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.search-form input:focus {
    background: #ffffff;
    border-color: var(--primary-light);
    box-shadow:
        0 8px 20px rgba(67, 97, 238, 0.15),
        0 0 0 4px rgba(67, 97, 238, 0.05);
    transform: translateY(-1px);
}

.search-form button {
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    position: absolute;
    right: 10px;
    /* Floating inside */
    top: 50%;
    transform: translateY(-50%);
    color: white !important;
    border-radius: 50%;
    width: 30px;
    /* Adjusted for 50px input */
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(39, 47, 122, 0.25);
    z-index: 10;
}

.search-form button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 12px rgba(67, 97, 238, 0.35);
}

/* Restore Search Icon */
.search-form button i {
    font-size: 0.8rem;
    font-weight: bold;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* === Modern Loader === */
/* === Modern Loader (Premium & Attractive) === */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.8);
    /* Glassy White */
    backdrop-filter: blur(8px);
    /* Strong blur for focus */
    z-index: 999999;
    /* Ensure on top of everything */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.modern-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Removed card styles */
    animation: floatUp 0.5s ease-out;
}

.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--primary-color);
    border-right-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    /* Elastic spin */
}

/* Second inner ring for complexity */
.spinner-ring::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 4px solid transparent;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

.centered-icon {
    font-size: 2rem;
    color: var(--primary-color);
    animation: heartbeat 1.5s ease-in-out infinite;
}

.loader-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes floatUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Highlight Effect for Search */
.highlight-text {
    color: var(--primary-color) !important;
    font-weight: 700 !important;
    background: rgba(46, 196, 182, 0.1);
    /* Teal tint */
    border-radius: 4px;
    padding: 2px 5px;
}

/* Dashboard Match Animation */
.search-match {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Search */
@media (max-width: 768px) {
    .search-bar {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        padding: 15px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
        display: none;
        /* Toggle via JS if needed */
        z-index: 999;
    }

    .search-bar.active {
        display: block;
    }
}

/* === Login Page Styling === */
/* Background is already applied globally to body, handled there */

/* Override overlay opacity specifically for Login page to show more image */
body:has(.section.register)::before {
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(4px);
}

.section.register .card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* === Responsive Kendo Grid Popups (Global) === */
.k-column-menu, 
.k-filter-menu-container {
    width: auto !important;
    max-width: min(320px, 90vw) !important;
    box-sizing: border-box;
}

.k-animation-container {
    max-width: 100vw !important;
}

/* Bootstrap-like shadow for Kendo popups */
.k-popup {
    border-radius: 8px !important;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

/* === Kendo Color Customization (Blue Theme) === */
/* Override the default orange (#FF6358) with deep blue (#004170) */

/* Selected items in lists and menus */
.k-list-item.k-selected,
.k-selected,
.k-state-selected,
.k-column-menu-item.k-selected {
    background-color: #004170 !important;
    color: #ffffff !important;
}

/* Primary buttons (Apply, etc.) */
.k-button-solid-primary,
.k-primary {
    background-color: #004170 !important;
    border-color: #004170 !important;
    color: #ffffff !important;
}

.k-button-solid-primary:hover,
.k-primary:hover {
    background-color: #003358 !important;
    border-color: #003358 !important;
}

/* Checkbox and Radio focus/selected state */
.k-checkbox:checked,
.k-checkbox:indeterminate {
    background-color: #004170 !important;
    border-color: #004170 !important;
}