/* Modern Dashboard Styles */

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.6s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-brand i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-right: 0.75rem;
}

.login-brand h1 {
    color: var(--dark);
    font-weight: 700;
    margin: 0;
    font-size: var(--font-size-2xl);
}

.login-subtitle {
    color: var(--secondary);
    margin: 0;
    font-size: var(--font-size-sm);
}

.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: var(--font-size-sm);
}

.form-label i {
    color: var(--primary);
    width: 16px;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.login-footer {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.login-footer p {
    color: var(--secondary);
    font-size: var(--font-size-xs);
    margin: 0;
}

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.alert-danger {
    background-color: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.2);
    color: var(--danger);
}

.alert i {
    margin-right: 0.5rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 575.98px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .login-brand {
        flex-direction: column;
        text-align: center;
    }
    
    .login-brand i {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}


/* Dashboard Styles */


:root {
    /* Font Variables */
    --font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 0.9375rem;
    --font-size-lg: 1.0625rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    
    /* Color Variables - Back to Original Blue Theme */
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #818cf8;
    --secondary: #718096;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --info: #4299e1;
    --light: #f7fafc;
    --dark: #2d3748;
    --white: #ffffff;
    
    /* Background Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #edf2f7;
    --bg-card: #ffffff;
    --navbar-bg: #334155;
    
    /* Border & Shadow */
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    
    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --navbar-height: 60px;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    background-color: var(--bg-primary);
    color: var(--dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Typography */
h1, .h1 { font-size: var(--font-size-3xl); font-weight: 700; margin-bottom: 0.5rem; }
h2, .h2 { font-size: var(--font-size-2xl); font-weight: 600; margin-bottom: 0.5rem; }
h3, .h3 { font-size: var(--font-size-xl); font-weight: 600; margin-bottom: 0.5rem; }
h4, .h4 { font-size: var(--font-size-lg); font-weight: 600; margin-bottom: 0.5rem; }
h5, .h5 { font-size: var(--font-size-base); font-weight: 600; margin-bottom: 0.5rem; }
h6, .h6 { font-size: var(--font-size-sm); font-weight: 600; margin-bottom: 0.5rem; }

/* Navigation - Split Color Design */
.navbar {
    height: var(--navbar-height);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1030;
    padding: 0;
    background: transparent;
}

.navbar .container-fluid {
    padding: 0;
    height: 100%;
    display: flex;
}

/* Left section with sidebar gradient */
.navbar-left-section {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    position: fixed;
    left: 0;
    top: 0;
    height: var(--navbar-height);
    z-index: 1031;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar.collapsed ~ .dashboard-layout .navbar-left-section {
    width: var(--sidebar-collapsed-width);
}

/* Right section with light background */
.navbar-right-section {
    flex: 1;
    margin-left: var(--sidebar-width);
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sidebar.collapsed ~ .dashboard-layout .navbar-right-section {
    margin-left: var(--sidebar-collapsed-width);
}

.navbar-left {
    display: flex;
    align-items: center;
    width: 100%;
}

.navbar-home-icon {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.navbar-home-icon:hover {
    color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

.navbar-brand {
    color: white !important;
    font-weight: 700;
    font-size: var(--font-size-lg);
    text-decoration: none;
    margin: 0;
}

.navbar-brand:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Search Bar Styling */
.navbar-search {
    position: relative;
    width: 300px;
    max-width: 100%;
}

.search-icon {
    position: absolute;
    left: 17rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary);
    font-size: 0.875rem;
    z-index: 3;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--dark);
    font-size: var(--font-size-sm);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input:focus + .search-icon {
    color: var(--primary);
}

.search-input::placeholder {
    color: var(--secondary);
    opacity: 0.7;
}

/* Profile Button */
.btn-nav-profile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    padding: 0.5rem 0.8rem;
    min-width: auto;
}

.btn-nav-profile:hover {
    background: var(--light);
    border-color: var(--primary);
    color: var(--primary);
}

.profile-text {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.profile-subtitle {
    font-size: var(--font-size-xs);
    opacity: 0.7;
    display: block !important; /* Force display on all screens */
}

/* Mobile adjustments */
@media (max-width: 767.98px) {
    .btn-nav-profile {
        padding: 0.4rem 0.6rem;
        min-width: 60px;
    }
    
    .profile-text {
        font-size: var(--font-size-xs);
    }
    
    .profile-subtitle {
        font-size: 0.6rem;
    }
}

@media (max-width: 575.98px) {
    .btn-nav-profile {
        flex-direction: row;
        align-items: center;
        gap: 0.3rem;
    }
    
    .profile-text {
        display: none; /* Hide text on very small screens, show only icon */
    }
    
    .profile-subtitle {
        display: none !important;
    }
    
    /* Show icon only on very small screens */
    .btn-nav-profile::before {
        content: "\f007"; /* Font Awesome user icon */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size: var(--font-size-base);
    }
    
    .btn-nav-profile .profile-text,
    .btn-nav-profile .profile-subtitle,
    .btn-nav-profile .dropdown-toggle::after {
        display: none;
    }
}


/* Mobile Sidebar Toggle */
#mobileSidebarToggle {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
}

#mobileSidebarToggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--navbar-height);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1020;
    box-shadow: var(--shadow-md);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-nav {
    padding: 1.5rem 0 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.nav-item-wrapper {
    display: flex;
    align-items: center;
    margin: 0.25rem 1rem;
    border-radius: var(--border-radius);
}

.nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(4px);
}

.nav-item i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
}

.nav-action {
    margin-left: 0.5rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.nav-item-wrapper:hover .nav-action {
    opacity: 1;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-xs);
    border-radius: 6px;
}

/* Collapsed sidebar styles */
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar.collapsed .nav-item i {
    margin: 0;
}

.sidebar.collapsed .nav-action {
    display: none;
}

.sidebar.collapsed #sidebarToggle i {
    transform: rotate(180deg);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-width: 0;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.content-wrapper {
    padding: 2rem;
    max-width: 100%;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    color: var(--dark);
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
}

.page-subtitle {
    color: var(--secondary);
    font-size: var(--font-size-sm);
    margin: 0;
}

/* Status Cards */
.status-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
    transition: all 0.3s ease;
}

.status-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-color);
}

.temp-card::before { background: var(--danger); }
.humidity-card::before { background: var(--info); }
.door-card::before { background: var(--primary); }
.ac-card::before { background: var(--success); }

.card-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    opacity: 0.1;
    transition: all 0.3s ease;
}

.status-card:hover .card-icon {
    opacity: 0.2;
    transform: scale(1.1);
}

.temp-card .card-icon { color: var(--danger); }
.humidity-card .card-icon { color: var(--info); }
.door-card .card-icon { color: var(--primary); }
.ac-card .card-icon { color: var(--success); }

.card-content {
    position: relative;
    z-index: 1;
}

.card-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.card-label {
    font-size: var(--font-size-sm);
    color: var(--secondary);
    margin: 0;
    font-weight: 500;
}

.card-timestamp {
    font-size: var(--font-size-xs);
    color: var(--secondary);
    opacity: 0.8;
}

/* Data Table Card */
.data-table-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.card-title {
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

/* Table Styles */
.table {
    font-size: var(--font-size-sm);
    margin: 0;
}

.table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* Empty State */
.empty-state {
    padding: 2rem;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    color: var(--secondary);
    margin: 0;
    font-size: var(--font-size-base);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: var(--font-size-xs);
}

/* Form Elements */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: var(--font-size-sm);
    transition: all 0.3s ease;
    background-color: var(--bg-card);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: var(--font-size-sm);
}

/* Input Group */
.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-sm);
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.btn-outline-warning {
    border: 1px solid var(--warning);
    color: var(--warning);
}

.btn-outline-warning:hover {
    background: var(--warning);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-xs);
}

/* Modal */
.modal-content {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom: none;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-title {
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    background: var(--light);
}

/* Pagination */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
    color: white;
}

.page-link:hover {
    background: var(--light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Dropdown */
.dropdown-menu {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    font-size: var(--font-size-sm);
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--light);
    color: var(--primary);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--primary);
}

/* Toast Notifications */
.toast {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    font-size: var(--font-size-sm);
}

.toast-body {
    padding: 1rem;
    font-weight: 500;
}

/* Animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Mobile Responsiveness - Updated */
@media (max-width: 991.98px) {
    /* Mobile navbar layout */
    .navbar-left-section {
        width: auto;
        position: static;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
        flex-shrink: 0;
    }
    
    /* Keep navbar-right-section visible on mobile */
    .navbar-right-section {
        display: flex !important;
        margin-left: 0;
        padding: 0 1rem;
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        flex: 1;
        min-width: 0; /* Allow shrinking */
    }
    
    /* Adjust navbar layout for mobile */
    .navbar .container-fluid {
        flex-wrap: nowrap;
        overflow: hidden;
    }
    
    /* Search bar adjustments for mobile */
    .navbar-search {
        width: 100%;
        max-width: 180px;
        flex-shrink: 1;
        min-width: 120px;
    }
    
    .search-input {
        padding: 0.6rem 0.8rem 0.6rem 2.2rem;
        font-size: 0.8rem;
    }
    
    .search-icon {
        left: 0.8rem;
        font-size: 0.8rem;
    }
    
    /* Profile button mobile adjustments */
    .btn-nav-profile {
        padding: 0.6rem 0.8rem;
        min-width: auto;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .profile-text {
        font-size: 0.8rem;
        display: block !important;
    }
    
    .profile-subtitle {
        font-size: 0.7rem;
        display: block !important;
    }
    
    /* Ensure right section content is properly spaced */
    .navbar-right-section > .d-flex {
        gap: 0.5rem !important;
        min-width: 0;
        flex: 1;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .page-header {
        margin-bottom: 1.5rem;
    }
    
    .status-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 767.98px) {
    .navbar-right-section {
        padding: 0 0.75rem;
    }
    
    .navbar-search {
        max-width: 140px;
        min-width: 100px;
    }
    
    .search-input {
        padding: 0.5rem 0.7rem 0.5rem 2rem;
        font-size: 0.75rem;
    }
    
    .btn-nav-profile {
        padding: 0.5rem 0.7rem;
    }
    
    .profile-text {
        font-size: 0.75rem;
    }
    
    .profile-subtitle {
        font-size: 0.65rem;
    }
}

@media (max-width: 575.98px) {
    .navbar-right-section {
        padding: 0 0.5rem;
        justify-content: space-between;
    }
    
    .navbar-search {
        max-width: 120px;
        min-width: 80px;
        order: 1;
    }
    
    .search-input {
        padding: 0.4rem 0.6rem 0.4rem 1.8rem;
        font-size: 0.7rem;
    }
    
    .search-icon {
        left: 0.6rem;
        font-size: 0.7rem;
    }
    
    /* Profile section - keep visible but compact */
    .btn-nav-profile {
        padding: 0.4rem 0.6rem;
        order: 2;
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 0.3rem;
    }
    
    /* Show abbreviated text on very small screens */
    .profile-text {
        font-size: 0.7rem;
        display: block !important;
    }
    
    .profile-subtitle {
        display: none !important;
    }
    
    /* Adjust dropdown positioning for small screens */
    .dropdown-menu {
        right: 0 !important;
        left: auto !important;
        min-width: 160px;
        transform: translateX(0) !important;
    }
}

@media (max-width: 480px) {
    .navbar-search {
        max-width: 100px;
        min-width: 70px;
    }
    
    .search-input::placeholder {
        content: "Search";
        font-size: 0.7rem;
    }
    
    /* Ultra compact profile for very small screens */
    .btn-nav-profile {
        padding: 0.4rem 0.5rem;
        min-width: 60px;
    }
    
    .profile-text {
        font-size: 0.65rem;
    }
}

/* Ensure profile dropdown is visible and works on mobile */
@media (max-width: 991.98px) {
    .dropdown {
        position: relative;
    }
    
    .dropdown-menu {
        position: absolute !important;
        right: 0;
        left: auto;
        z-index: 1050;
        margin-top: 0.25rem;
    }
    
    /* Ensure dropdown stays within viewport */
    .dropdown-menu-end {
        transform: none !important;
    }
}

/* Fix for navbar container overflow */
.navbar .container-fluid {
    min-width: 0;
    overflow: visible;
}

/* Ensure search form doesn't break layout */
.navbar-right-section form {
    min-width: 0;
    flex-shrink: 1;
}

/* Mobile sidebar toggle visibility */
@media (min-width: 992px) {
    #mobileSidebarToggle {
        display: none !important;
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--navbar-height));
    background: rgba(0, 0, 0, 0.5);
    z-index: 1010;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Utility Classes */
.text-xs { font-size: var(--font-size-xs) !important; }
.text-sm { font-size: var(--font-size-sm) !important; }
.text-base { font-size: var(--font-size-base) !important; }
.text-lg { font-size: var(--font-size-lg) !important; }
.text-xl { font-size: var(--font-size-xl) !important; }

.fw-300 { font-weight: 300 !important; }
.fw-400 { font-weight: 400 !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Card Footer */
.card-footer {
    background: var(--light);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}