/* assets/css/style.css - Executive Field Appointment Route Tracking CMS */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #ffffff;
    --bg-muted: #f8fafc;
    
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
    --sidebar-text: #94a3b8;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --danger: #ef4444;
    --slate: #64748b;
    
    --border-color: #e2e8f0;
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --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-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8fafc;
    color: var(--text-body);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* App Shell Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
    z-index: 40;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.35rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.sidebar-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.sidebar-menu {
    list-style: none;
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
}

.menu-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.25rem;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    border-radius: var(--radius-md);
    font-size: 0.925rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Main Content Area */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header Navbar */
.top-navbar {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 30;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-muted);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
}

.user-role {
    font-size: 0.725rem;
    color: var(--text-muted);
}

/* Content Area */
.content-body {
    padding: 2rem;
    flex-grow: 1;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-title {
    font-size: 0.825rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.primary { background-color: #eff6ff; color: #2563eb; }
.stat-icon.success { background-color: #ecfdf5; color: #10b981; }
.stat-icon.warning { background-color: #fffbeb; color: #f59e0b; }
.stat-icon.slate { background-color: #f1f5f9; color: #64748b; }

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.775rem;
    font-weight: 700;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-slate {
    background-color: #f1f5f9;
    color: #475569;
}

.badge-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Pulsing GPS Beacon Effect */
.pulse-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.pulse-indicator.active {
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-beacon 1.8s infinite;
}

.pulse-indicator.idle {
    background-color: #94a3b8;
}

@keyframes pulse-beacon {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.btn-success {
    background-color: #10b981;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: #ffffff;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-body);
}

.btn-outline:hover {
    background-color: var(--bg-muted);
}

.pulse-btn {
    animation: btn-glow 1.5s infinite alternate;
}

@keyframes btn-glow {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6); }
    100% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
}

/* Employee Dashboard Card */
.tracking-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    position: relative;
}

.tracking-card.active-state {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.toggle-info h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-heading);
}

.status-toggle-btn {
    padding: 0.85rem 1.75rem;
    font-size: 0.95rem;
    border-radius: var(--radius-full);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.status-toggle-btn.off {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.status-toggle-btn.on {
    background-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

/* Live Map Container */
.map-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
}

.map-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: #ffffff;
}

#map {
    height: 560px;
    width: 100%;
    z-index: 10;
}

/* Floating Live Appointment Panel on Map */
.appointment-floating-panel {
    position: absolute;
    top: 90px;
    right: 20px;
    width: 330px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.9);
    z-index: 20;
    transition: all 0.3s ease;
}

.appointment-floating-panel.collapsed {
    display: none !important;
}

.panel-minimize-btn {
    background: #f1f5f9;
    border: none;
    font-size: 0.85rem;
    font-weight: 800;
    color: #64748b;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.panel-minimize-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.eta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.eta-badge-large {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stepper Progress Bar */
.delivery-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.25rem 0;
    position: relative;
}

.stepper-line-bg {
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 4px;
    background: #e2e8f0;
    transform: translateY(-50%);
    z-index: 1;
}

.stepper-line-fill {
    position: absolute;
    top: 50%; left: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #10b981);
    transform: translateY(-50%);
    z-index: 2;
    transition: width 0.4s ease;
}

.stepper-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #cbd5e1;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    transition: var(--transition);
}

.stepper-step.completed {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.stepper-step.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.25);
}

.delivery-agent-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
}

.agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2563eb;
}

/* Custom Vehicle / Agent Leaflet Marker */
.delivery-bike-marker {
    background: transparent;
    border: none;
    transition: transform 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) !important;
    will-change: transform;
}

.swiggy-bike-marker-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.swiggy-eta-callout {
    background: #0f172a;
    color: #ffffff;
    font-size: 0.725rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.4);
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: absolute;
    top: -42px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.swiggy-eta-callout::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #0f172a;
}

.bike-pin-container {
    width: 52px;
    height: 52px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bike-pulse-halo {
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.35);
    animation: halo-expand 1.5s infinite;
}

@keyframes halo-expand {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

.bike-icon-bubble {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: 3px solid #2563eb;
    border-radius: 50%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
    transition: transform 0.4s ease;
}

.bike-icon-bubble img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.bike-badge-icon {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #fc8019;
    color: #ffffff;
    font-size: 0.8rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

/* Swiggy Destination House Pin */
.swiggy-dest-marker {
    background: transparent;
    border: none;
}

.swiggy-dest-pin {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.swiggy-dest-icon {
    width: 36px;
    height: 36px;
    background: #0f172a;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.4);
    font-size: 1.1rem;
}

.swiggy-dest-icon span {
    transform: rotate(45deg);
    display: block;
}

.swiggy-dest-label {
    background: #ffffff;
    color: #0f172a;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    margin-top: 4px;
    white-space: nowrap;
}

/* Animated Path Dash Polyline */
.leaflet-interactive.delivery-dash-line {
    stroke-dasharray: 12, 12;
    animation: dash-move 2s linear infinite;
}

@keyframes dash-move {
    from { stroke-dashoffset: 24; }
    to { stroke-dashoffset: 0; }
}

/* Custom Popup */
.map-popup-card {
    padding: 0.75rem;
    min-width: 240px;
}

/* Modal Overlay & Consent Banner */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
}

.modal-body {
    color: var(--text-body);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Tables */
.table-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-heading);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background-color: var(--bg-muted);
    padding: 0.85rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-body);
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover td {
    background-color: #f8fafc;
}

/* Login Page Specific Styling */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-heading);
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.925rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.demo-account-pills {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.demo-pills-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-align: center;
}

.pills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.pill-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.775rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    background-color: var(--bg-muted);
    border: 1px solid var(--border-color);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.pill-btn:hover {
    background-color: #e2e8f0;
}

/* Mobile Responsive Design System */
.mobile-sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-heading);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-md);
}

.mobile-sidebar-toggle:hover {
    background: #f1f5f9;
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 35;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 992px) {
    .mobile-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        left: -270px;
        top: 0; bottom: 0;
        z-index: 45;
        box-shadow: var(--shadow-xl);
    }
    .sidebar.open {
        left: 0;
    }

    .top-navbar {
        padding: 0 1rem;
        height: 64px;
    }

    .page-title {
        font-size: 1.05rem;
    }

    .content-body {
        padding: 1rem;
    }

    .appointment-floating-panel {
        width: calc(100% - 30px);
        right: 15px;
        top: 15px;
    }
}

@media (max-width: 768px) {
    /* Responsive Grids & Cards */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }

    .tracking-card {
        padding: 1.25rem !important;
    }

    .toggle-switch-wrapper {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }

    .toggle-switch-wrapper > div:last-child {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.65rem !important;
    }

    .toggle-switch-wrapper button {
        width: 100%;
        justify-content: center;
        padding: 0.85rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .form-grid-2col {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Map responsive adjustments */
    #employeeMap, #map {
        height: 380px !important;
    }

    .map-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .map-controls {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .map-controls button {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.775rem !important;
    }

    /* Floating panel mobile placement */
    .appointment-floating-panel {
        position: relative !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        margin-top: 1rem;
        box-shadow: var(--shadow-md) !important;
    }

    /* Table responsive scrolling */
    .table-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .custom-table {
        min-width: 680px;
    }

    .user-profile-btn {
        padding: 0.3rem 0.6rem;
    }
    
    .user-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 0.95rem;
    }

    .pill-btn {
        font-size: 0.725rem;
        padding: 0.45rem 0.6rem;
    }
}
