/* 
   MobileFlow CRM - Dashboard Stylesheet
   Design Paradigm: Premium Dark Mode, Emerald Highlights, & Glassmorphic Modules
*/

/* --- Design Variables --- */
:root {
    --bg-main: #060913;
    --bg-sidebar: #090d1a;
    --bg-card: rgba(18, 25, 41, 0.6);
    --bg-card-hover: rgba(26, 36, 59, 0.75);
    --border-color: rgba(255, 255, 255, 0.06);
    
    --color-primary: #10b981;      /* Emerald */
    --color-primary-hover: #059669;
    --color-text-main: #f8fafc;
    --color-text-muted: #64748b;
    --color-slate-dark: #0f172a;
    --color-slate-light: #1e293b;
    
    --color-blue: #0284c7;
    --color-amber: #d97706;
    --color-red: #ef4444;
    
    --font-main: 'Outfit', sans-serif;
    --transition-speed: 0.25s;
    --border-radius: 16px;
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* --- Reset & Core --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--color-text-main);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--color-slate-light);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* --- Layout Wrapper --- */
.dashboard-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow-x: hidden;
}

/* --- Sidebar Style --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
}

.brand-text {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
}

.brand-text span {
    color: var(--color-primary);
}

.logo-icon {
    font-size: 1.6rem;
    color: var(--color-primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text-muted);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 550;
    text-align: left;
    padding: 14px 18px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition-speed) ease;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.nav-item.active {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-primary);
    border-left: 3px solid var(--color-primary);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(16, 185, 129, 0.2);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

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

.logout-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color var(--transition-speed) ease;
}

.logout-link:hover {
    color: var(--color-red);
}

/* --- Main Panel --- */
.main-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    background-color: var(--bg-main);
}

/* Topbar */
.topbar {
    position: relative;
    z-index: 100;
    padding: 24px 40px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(6, 9, 19, 0.8);
    backdrop-filter: blur(8px);
}

.topbar-left h2 {
    font-size: 1.6rem;
    color: #ffffff;
}

.topbar-left p {
    font-size: 0.9rem;
    margin-top: 2px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 100px;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary);
}

.indicator-text {
    color: var(--color-text-main);
}

/* --- Tab Content Visibility --- */
.tab-content {
    display: none;
    padding: 40px;
    flex-grow: 1;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* --- Glassmorphic Containers --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* --- Tab 1: Today's Route (Overview) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.stat-box {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-icon-wrapper.blue {
    background: rgba(2, 132, 199, 0.1);
    color: var(--color-blue);
    border: 1px solid rgba(2, 132, 199, 0.2);
}

.stat-icon-wrapper.emerald {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.stat-icon-wrapper.amber {
    background: rgba(217, 119, 6, 0.1);
    color: var(--color-amber);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
}

.overview-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
}

.stops-card, .map-card {
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-header h3 {
    font-size: 1.25rem;
    color: #ffffff;
}

/* Dynamic Stop Sequence List */
.stops-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    max-height: 420px;
    padding-right: 6px;
}

.timeline-stop-item {
    display: grid;
    grid-template-columns: 80px 12px 1fr 130px;
    gap: 20px;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    position: relative;
}

.timeline-stop-item.completed {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.02);
}

.stop-time-col {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: right;
}

.timeline-stop-item.completed .stop-time-col {
    color: var(--color-primary);
}

.stop-marker-col {
    position: relative;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stop-marker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-slate-light);
    border: 2px solid var(--bg-main);
    z-index: 2;
}

.timeline-stop-item.completed .stop-marker-dot {
    background-color: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary);
}

.stop-details-col h4 {
    font-size: 1rem;
    color: #ffffff;
}

.stop-details-col p {
    font-size: 0.8rem;
    margin-top: 2px;
}

.stop-actions-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

/* Driving Map Simulated graphic */
.map-placeholder {
    width: 100%;
    height: 380px;
    border-radius: 12px;
    background: #0f1624;
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.map-graphic {
    width: 100%;
    height: 100%;
}

.map-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 10px;
    background: rgba(9, 13, 26, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    backdrop-filter: blur(4px);
    text-align: center;
}

.map-overlay-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
}

/* --- Tab 2: Clients Ledger & Search --- */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-box input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px 12px 44px;
    font-family: var(--font-main);
    color: #ffffff;
    outline: none;
}

.search-box input:focus {
    border-color: var(--color-primary);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

/* Custom Table Layout grid style */
.clients-table-card {
    display: flex;
    flex-direction: column;
}

.clients-list-header {
    display: grid;
    grid-template-columns: 180px 220px 1.2fr 1.2fr 110px;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.clients-list-body {
    display: flex;
    flex-direction: column;
    max-height: 480px;
    overflow-y: auto;
}

.client-row {
    display: grid;
    grid-template-columns: 180px 220px 1.2fr 1.2fr 110px;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: background var(--transition-speed) ease;
}

.client-row:hover {
    background: rgba(255, 255, 255, 0.01);
}

.client-name-cell h4 {
    font-size: 0.95rem;
    color: #ffffff;
}

.client-name-cell span {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.client-contact-cell, .client-address-cell {
    font-size: 0.85rem;
}

.client-pets-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.pet-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pet-pill.matted {
    border-color: rgba(217, 119, 6, 0.3);
    color: var(--color-amber);
    background: rgba(217, 119, 6, 0.05);
}

.btn-add-pet-small {
    background: transparent;
    border: 1px dashed var(--color-primary);
    color: var(--color-primary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all var(--transition-speed) ease;
}

.btn-add-pet-small:hover {
    background: var(--color-primary);
    color: #000;
}

.client-actions-cell {
    display: flex;
    gap: 8px;
}

/* Button UI Elements */
.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-icon-danger {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-red);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon-danger:hover {
    background: var(--color-red);
    color: #ffffff;
}

/* --- Tab 3: Scheduler --- */
.scheduler-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
}

.scheduler-form-card, .booking-preview-card {
    padding: 30px;
}

.scheduler-form-card h3 {
    margin-bottom: 4px;
}

.scheduler-form-card p {
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.dashboard-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.form-group select, .form-group input, .form-group textarea {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    color: #ffffff;
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: border 0.2s ease;
}

.form-group select:focus, .form-group input:focus, .form-group textarea:focus {
    border-color: var(--color-primary);
}

.form-group select option {
    background-color: var(--bg-sidebar);
    color: #ffffff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.price-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-prefix {
    position: absolute;
    left: 14px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.price-input-wrapper input {
    padding-left: 28px !important;
    width: 100%;
}

/* Booking Preview Details */
.preview-metric-row {
    margin: 20px 0;
}

.preview-metric {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-val {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-primary);
    margin: 8px 0;
}

.metric-sub {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.geopath-route-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.geopath-route-card.success-state {
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.04);
}

.geopath-route-card.success-state .route-status-icon i {
    color: var(--color-primary);
}

.geopath-route-card.warning-state {
    border-color: rgba(217, 119, 6, 0.25);
    background: rgba(217, 119, 6, 0.04);
}

.geopath-route-card.warning-state .route-status-icon i {
    color: var(--color-amber);
}

.route-status-icon i {
    font-size: 1.5rem;
    color: var(--color-text-muted);
}

.route-status-content h5 {
    font-size: 0.95rem;
    color: #ffffff;
}

.route-status-content p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Route visual representation (SVG Nodes) */
.route-cluster-preview {
    width: 100%;
    height: 180px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.cluster-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 5;
    border: 2px solid var(--bg-main);
}

.cluster-dot.origin {
    bottom: 20%;
    left: 20%;
    background-color: var(--color-slate-light);
}

.cluster-dot.existing {
    top: 30%;
    left: 50%;
    background-color: var(--color-blue);
}

.cluster-dot.existing-2 {
    top: 50%;
    left: 70%;
    background-color: var(--color-blue);
}

.cluster-dot.proposed {
    bottom: 40%;
    left: 40%;
    background-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
}

.cluster-label {
    position: absolute;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-text-muted);
}

.label-origin { bottom: 12%; left: 16%; }
.label-confirmed { top: 22%; left: 54%; }
.label-proposed { bottom: 32%; left: 42%; color: var(--color-primary); }

.cluster-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* --- Tab 4: Settings Grid --- */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.settings-card {
    padding: 30px;
}

.settings-card h3 {
    margin-bottom: 4px;
}

.settings-card p {
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* Custom Settings Billing Box */
.billing-status-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.billing-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-badge {
    font-size: 0.7rem;
    font-weight: 800;
    background: rgba(2, 132, 199, 0.15);
    color: var(--color-blue);
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
}

.plan-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
}

.billing-renewal {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.billing-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-primary);
}

/* Stripe/Square Settings Switch */
.deposit-toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 10px;
}

.toggle-info h5 {
    font-size: 0.95rem;
    color: #ffffff;
}

.toggle-info p {
    font-size: 0.75rem;
    margin-top: 2px;
    margin-bottom: 0;
}

/* Switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-slate-light);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--color-primary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--color-primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* --- Modal Overlays & Animation --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(4, 6, 12, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    max-width: 460px;
    width: 100%;
    padding: 30px;
    transform: scale(0.9);
    transition: transform var(--transition-speed) ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #ffffff;
}

/* --- Badge & Custom Helper UI --- */
.badge-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
}

.badge-status.pending {
    background: rgba(217, 119, 6, 0.1);
    color: var(--color-amber);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* --- Premium Empty State Cards --- */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
    background: rgba(18, 25, 41, 0.3);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
    max-width: 500px;
    margin: 40px auto;
}

.empty-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.empty-state-card h3 {
    font-size: 1.25rem;
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 10px;
}

.empty-state-card p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
    max-width: 400px;
}

.empty-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.mobile-only-btn {
    display: none !important;
}
.sidebar-close-btn {
    display: none !important;
}
.mobile-view-toggle-fab {
    display: none !important;
}

/* --- Responsive Layout Rules --- */
@media (max-width: 1024px) {
    .overview-layout {
        grid-template-columns: 1fr;
    }
    .scheduler-layout {
        grid-template-columns: 1fr;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
    }
    
    /* Mobile-only menu triggers */
    .mobile-only-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        border: 1.5px solid var(--color-primary) !important;
        box-shadow: 0 0 8px var(--border-glow);
        z-index: 2;
    }
    
    .sidebar-close-btn {
        display: block !important;
    }
    
    .status-indicator {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        padding: 0;
        margin: 0;
        border: none;
        background: transparent;
        z-index: 2;
    }
    
    .status-indicator .indicator-text {
        display: none !important;
    }
    
    #tab-subtitle {
        display: none !important;
    }
    
    .topbar {
        padding: 12px 16px;
        height: 64px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    
    .topbar-left {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        z-index: 1;
        pointer-events: none;
        display: block !important;
    }
    
    #tab-title {
        font-size: 1.15rem !important;
        font-weight: 700;
        letter-spacing: -0.02em;
        margin: 0 !important;
    }
    
    .topbar-right {
        display: flex;
        align-items: center;
        gap: 12px;
        z-index: 2;
    }
    
    /* Mobile View Toggle FAB (Floating Action Button) */
    .mobile-view-toggle-fab {
        display: flex !important;
        align-items: center;
        gap: 8px;
        position: fixed;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%);
        background-color: var(--color-primary);
        color: #ffffff;
        border: none;
        padding: 12px 20px;
        border-radius: 50px;
        font-size: 0.95rem;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
        cursor: pointer;
        z-index: 1500;
        transition: all 0.25s ease;
    }
    
    .mobile-view-toggle-fab:hover {
        background-color: var(--color-primary-hover);
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
        transform: translateX(-50%) translateY(-2px);
    }
    
    /* Overview Layout - Toggle View States on Mobile */
    .overview-layout {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }
    
    .overview-layout .map-card {
        display: none !important; /* Hide map by default on mobile */
        height: calc(100vh - 120px) !important;
        margin-bottom: 0 !important;
    }
    
    .overview-layout .stops-card {
        display: block !important;
        height: auto !important;
        margin-bottom: 0 !important;
    }
    
    /* Show Map View state */
    .overview-layout.show-map .map-card {
        display: block !important;
    }
    
    .overview-layout.show-map .stops-card {
        display: none !important;
    }
    
    /* Overlay background when mobile menu is active */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(4, 6, 12, 0.7);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1999;
        display: none;
    }
    
    .mobile-overlay.active {
        display: block;
    }

    /* Transform Sidebar into Slide-out Drawer Panel */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Hidden offscreen by default */
        width: 280px;
        height: 100vh;
        z-index: 2000;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease;
        box-shadow: 10px 0 30px rgba(0,0,0,0.6);
        background: var(--bg-sidebar);
        padding: 24px 20px;
        visibility: hidden;
    }
    
    .sidebar.active {
        left: 0; /* Slide in! */
        visibility: visible;
    }

    .sidebar-brand {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        width: 100%;
    }
    
    .sidebar-nav {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100%;
    }
    
    .nav-item {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .nav-item.active {
        border-left: 3px solid var(--color-primary);
        border-bottom: none;
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        background: rgba(16, 185, 129, 0.05);
    }
    
    .sidebar-footer {
        display: block !important; /* Keep profile and public booking page link visible! */
        margin-top: auto;
        border-top: 1px solid var(--border-color);
        padding-top: 20px;
        width: 100%;
    }
    
    .topbar {
        padding: 16px 20px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .client-row, .clients-list-header {
        grid-template-columns: 1.2fr 1.2fr 100px;
    }
    
    .clients-list-header {
        display: none !important; /* Hide table headers on mobile */
    }
    
    /* Expandable Client Cards on Mobile viewports */
    .client-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        padding: 16px !important;
        margin-bottom: 12px;
        gap: 12px !important;
        cursor: pointer;
        transition: all 0.25s ease;
    }
    
    .client-row:hover {
        background: var(--bg-card-hover) !important;
    }
    
    .client-name-cell {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
    
    .client-name-cell h4 {
        font-size: 1.05rem !important;
        color: #ffffff;
    }
    
    .client-expand-indicator {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-color);
        color: var(--color-text-muted);
        transition: transform 0.3s ease, color 0.3s ease;
    }
    
    .client-row.expanded .client-expand-indicator {
        transform: rotate(180deg);
        color: var(--color-primary);
        background: rgba(16, 185, 129, 0.1);
        border-color: rgba(16, 185, 129, 0.2);
    }
    
    /* Hidden details on card closed state */
    .client-row .client-contact-cell,
    .client-row .client-address-cell,
    .client-row .client-pets-cell,
    .client-row .client-actions-cell {
        display: none !important;
        padding: 0 !important;
        border: none !important;
    }
    
    /* Expanded details on card open state */
    .client-row.expanded .client-contact-cell {
        display: block !important;
        border-top: 1px solid var(--border-color) !important;
        padding-top: 12px !important;
    }
    
    .client-row.expanded .client-address-cell {
        display: block !important;
        font-size: 0.85rem !important;
    }
    
    .client-row.expanded .client-pets-cell {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        align-items: center !important;
    }
    
    .client-row.expanded .client-actions-cell {
        display: flex !important;
        justify-content: flex-end !important;
        border-top: 1px solid var(--border-color) !important;
        padding-top: 12px !important;
    }
    
    .timeline-stop-item {
        grid-template-columns: 70px 12px 1fr;
    }
    
    .stop-actions-col {
        grid-column: 3;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        margin-top: 8px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Touch Target & Glowing Focus Overrides for Mobile Form Fields */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        height: 48px !important;
        font-size: 1rem !important; /* Prevents auto-zoom on iOS */
        padding: 12px 16px !important;
        border-radius: var(--border-radius) !important;
        background: rgba(255, 255, 255, 0.04) !important;
        border: 1.5px solid var(--border-color) !important;
        color: #ffffff !important;
        outline: none !important;
        transition: all 0.2s ease !important;
        width: 100% !important;
    }
    
    textarea {
        height: auto !important;
        min-height: 100px !important;
    }
    
    input:focus, select:focus, textarea:focus {
        border-color: var(--color-primary) !important;
        box-shadow: 0 0 10px var(--border-glow) !important;
        background: rgba(255, 255, 255, 0.07) !important;
    }
    
    /* Responsive Button Padding Overrides */
    .btn {
        min-height: 48px !important;
        padding: 12px 24px !important;
        font-size: 1rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        border-radius: 12px !important;
    }
    
    .btn-sm {
        min-height: 38px !important;
        padding: 8px 16px !important;
        font-size: 0.85rem !important;
    }
}

/* --- Notification Bell & Dropdown Styles --- */
.notification-bell-container {
    position: relative;
    margin-right: 15px;
}

.topbar-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--color-text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all var(--transition-speed) ease;
}

.topbar-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--color-red);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-sidebar);
}

.bell-badge.hidden {
    display: none !important;
}

/* Sliding Dropdown panel */
.notification-panel {
    position: absolute;
    top: 55px;
    right: 0;
    width: 320px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    padding: 16px;
    border-color: var(--border-color);
}

.notification-panel.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.panel-header h4 {
    font-size: 0.95rem;
    color: #ffffff;
}

.btn-clear-all {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-clear-all:hover {
    color: var(--color-red);
}

.panel-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 300px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    line-height: 1.4;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notification-item i {
    font-size: 1rem;
    margin-top: 2px;
}

.notification-item i.blue { color: var(--color-blue); }
.notification-item i.emerald { color: var(--color-primary); }
.notification-item i.amber { color: var(--color-amber); }
.notification-item i.red { color: var(--color-red); }

.notification-item .time {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* SMS Toast Preview Popups */
.sms-toast-overlay {
    position: fixed;
    bottom: 30px;
    right: -400px; /* Hidden offscreen by default */
    width: 340px;
    z-index: 10000;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease, visibility 0.4s ease;
    opacity: 0;
    visibility: hidden;
}

.sms-toast-overlay.active {
    right: 30px;
    opacity: 1;
    visibility: visible;
}

.sms-bubble {
    background: rgba(21, 27, 43, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.sms-bubble-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.sms-bubble-header i {
    font-size: 0.9rem;
}

.sms-sender {
    color: #ffffff;
    flex-grow: 1;
}

.sms-time {
    color: var(--color-text-muted);
    font-weight: 500;
}

.sms-bubble-body {
    font-size: 0.85rem;
    color: #f8fafc;
    line-height: 1.4;
    word-wrap: break-word;
}

/* --- Leaflet Custom Map Pins --- */
.custom-map-marker {
    background: none !important;
    border: none !important;
}

.marker-pin {
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    background: var(--color-primary);
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -14px 0 0 -14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    border: 2px solid #0b111e;
    transition: all 0.2s ease;
}

.marker-pin:hover {
    transform: rotate(-45deg) scale(1.1);
}

.marker-pin i, .marker-pin span {
    transform: rotate(45deg);
    color: #0b111e;
    font-weight: 800;
    font-size: 0.8rem;
    display: block;
}

.marker-pin.depot {
    background: #64748b;
    border-color: #0b111e;
}

.marker-pin.depot i {
    color: #ffffff;
    font-size: 0.7rem;
}

.marker-pin.stop {
    background: var(--color-primary);
}

/* Home pin icon styles */
.marker-pin.home {
    background: #10b981;
}

.marker-pin.home i {
    color: #0b111e;
    font-size: 0.7rem;
}

/* Van pin icon styles */
.marker-pin.van {
    background: #0ea5e9;
}

.marker-pin.van i {
    color: #ffffff;
    font-size: 0.75rem;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(14, 165, 233, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    }
}

/* --- SMS Simulator Modal Phone Frame --- */
.sms-phone-wrapper {
    width: 330px;
    height: 600px;
    background: #0f172a;
    border-radius: 40px;
    border: 12px solid #1e293b;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.05);
    overflow: hidden;
    position: relative;
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
}

.phone-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.phone-status-bar {
    height: 28px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    font-weight: 600;
}

.phone-notifs {
    display: flex;
    gap: 6px;
}

.phone-header {
    height: 56px;
    background: #1e293b;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    padding: 0 12px;
    justify-content: space-between;
}

.phone-back-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    font-family: var(--font-main);
}

.phone-header .contact-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    margin-left: 12px;
}

.contact-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.contact-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
}

.contact-status {
    font-size: 0.6rem;
    color: var(--color-primary);
    font-weight: 500;
}

.phone-header-icon {
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    cursor: pointer;
}

.phone-chat-body {
    flex-grow: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0b0f19;
}

.chat-bubble-row {
    display: flex;
    width: 100%;
}

.chat-bubble-row.sent {
    justify-content: flex-end;
}

.chat-bubble-row.received {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    font-size: 0.8rem;
    line-height: 1.4;
    position: relative;
    animation: popBubble 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popBubble {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-bubble.sent {
    background: #0284c7;
    color: #ffffff;
    border-radius: 16px 16px 4px 16px;
    text-align: right;
}

.chat-bubble.received {
    background: #334155;
    color: #ffffff;
    border-radius: 16px 16px 16px 4px;
    text-align: left;
}

.chat-bubble.assistant {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #f8fafc;
    border-radius: 16px 16px 16px 4px;
    text-align: left;
}

.chat-bubble.assistant strong {
    color: var(--color-primary);
}

.phone-choices-area {
    background: #1e293b;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.choice-btn {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-main);
    text-align: center;
    transition: all 0.2s ease;
}

.choice-btn:hover {
    background: var(--color-primary);
    color: #0b0f19;
}

.phone-keyboard-area {
    background: #1e293b;
    padding: 8px 12px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.phone-keyboard-area .input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.5);
    font-size: 1.1rem;
}

.message-input-mock {
    flex-grow: 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    text-align: left;
}

.sending-arrow {
    background: rgba(255,255,255,0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #0f172a;
}

.phone-home-indicator {
    width: 110px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin: 4px auto 0 auto;
}

/* --- Groomer Dashboard Authentication Gate --- */
.auth-gate-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 50%, #0f172a, #020617);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    overflow-y: auto;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.01) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
    text-align: left;
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), #34d399);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.auth-logo-icon {
    animation: authLogoGlow 3s infinite ease-in-out;
}

@keyframes authLogoGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
    }
    50% {
        text-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
        transform: scale(1.05);
    }
}



