/* ==========================================================================
   MYMOTO SYSTEM STYLING - DESIGN SYSTEM
   ========================================================================== */

/* Theme Variables definition */
:root[data-theme="dark"] {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-glass: rgba(17, 24, 39, 0.75);
    --border-color: rgba(255, 255, 255, 0.06);
    
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.12);
    
    --accent: #0ea5e9;
    --accent-light: rgba(14, 165, 233, 0.12);
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1), 0 10px 20px -5px rgba(0, 0, 0, 0.2);
    --glass-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.2);
    
    --sidebar-width: 280px;
    --border-radius: 12px;
    
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-info: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

:root[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.05);
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.08);
    
    --accent: #0ea5e9;
    --accent-light: rgba(14, 165, 233, 0.08);
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.08);
    
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.08);
    
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.08);
    
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05), 0 4px 6px -1px rgba(0, 0, 0, 0.03);
    --glass-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.04);
    
    --sidebar-width: 280px;
    --border-radius: 12px;
    
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-info: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: 'Outfit', 'Sarabun', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: 14px;
}

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

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

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

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

.logo-icon {
    font-size: 26px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(79, 70, 229, 0.35));
    flex-shrink: 0;
}

#system-logo-img {
    max-height: 34px;
    max-width: 38px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-text .highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Active Motorcycle Selector */
.active-moto-container {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.selector-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.selector-label i {
    margin-right: 4px;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 11px;
}

.moto-select {
    width: 100%;
    padding: 12px 35px 12px 16px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    appearance: none;
    cursor: pointer;
    outline: none;
}

.moto-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Mobile Vehicle Selector Sub-Bar (Hidden on desktop/tablet) */
.mobile-vehicle-bar {
    display: none;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transform: scale(1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-item:hover a {
    background-color: var(--primary-light);
    color: var(--primary);
    padding-left: 20px;
}

.nav-item.active a {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px -3px rgba(79, 70, 229, 0.35);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

.theme-toggle {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
}

:root[data-theme="dark"] .icon-light,
:root[data-theme="light"] .icon-dark {
    display: none;
}

/* Main Content Styling */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-title .subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quick-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status-dot.offline {
    background-color: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.content-body {
    padding: 40px;
    flex: 1;
}

/* ==========================================================================
   TAB CONTENT SYSTEMS
   ========================================================================== */
.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-pane.active {
    display: block;
}

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

/* ==========================================================================
   DASHBOARD STAT CARDS
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--card-shadow);
    transform: translateY(0);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px -5px rgba(0,0,0,0.2);
}

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

.stat-icon-wrapper.odometer {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon-wrapper.cost {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-icon-wrapper.trips {
    background-color: var(--accent-light);
    color: var(--accent);
}

.stat-icon-wrapper.distance {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-icon-wrapper.refuel {
    background-color: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.stat-icon-wrapper.total-exp {
    background-color: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-icon-wrapper.cpk {
    background-color: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.stat-icon-wrapper.fuel-cpk {
    background-color: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.stat-subtext {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ==========================================================================
   SERVICE INTERVAL CONFIGURATION & ALERTS UI
   ========================================================================== */
.service-interval-settings-box {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.service-interval-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 12px;
}

.service-interval-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-interval-title i {
    color: var(--primary);
    font-size: 14px;
    background: var(--primary-light);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.service-interval-presets {
    display: flex;
    gap: 6px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.preset-pill-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.preset-pill-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.preset-pill-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.service-interval-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.service-interval-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.service-interval-card:hover {
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: var(--card-shadow);
}

.service-interval-card.disabled {
    opacity: 0.5;
    background: var(--bg-primary);
    border-style: dashed;
}

.service-interval-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.service-item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.service-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.service-item-icon.oil { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.service-item-icon.gear { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.service-item-icon.filter { background: rgba(14, 165, 233, 0.12); color: #0ea5e9; }
.service-item-icon.spark { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.service-item-icon.trans { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.service-item-icon.custom { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }

/* Custom Parts Section */
.custom-intervals-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

.custom-intervals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-parts-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.quick-part-chip {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quick-part-chip:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.custom-interval-row {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    transition: all 0.2s;
}

.custom-interval-row.disabled {
    opacity: 0.5;
    background: var(--bg-primary);
    border-style: dashed;
}

.custom-interval-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 180px;
}

.custom-interval-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon-danger {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-icon-danger:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* Modern Toggle Switch */
.switch-control {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    margin: 0;
    flex-shrink: 0;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    border: 1px solid rgba(156, 163, 175, 0.3);
    transition: .25s ease;
    border-radius: 22px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .25s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

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

.switch-control input:checked + .switch-slider:before {
    transform: translateX(16px);
}

.interval-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.interval-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.interval-input-group input {
    border: none !important;
    background: transparent !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    flex: 1;
    width: 100%;
}

.interval-unit-badge {
    padding: 0 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    height: 38px;
    display: flex;
    align-items: center;
}

.service-card-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Service Alerts Banner */
.service-alerts-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: var(--card-shadow);
    border-left: 5px solid var(--warning);
}

.service-alerts-box.has-overdue {
    border-left-color: var(--danger);
}

.service-alerts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.service-alerts-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 10px;
    transition: transform 0.15s ease;
}

.service-alert-item:hover {
    transform: translateY(-1px);
}

.service-alert-item:last-child {
    margin-bottom: 0;
}

.service-alert-item.overdue {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.service-alert-item.due-soon {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #d97706;
}

.service-alert-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 250px;
}

.service-alert-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-alert-btn {
    border: none;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.service-alert-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

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

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    margin-top: 4px;
}

.stat-value .unit {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Dashboard Panel Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.6fr 1.2fr;
    gap: 32px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

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

.card-panel {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.panel-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h3 i {
    color: var(--primary);
}

.chart-wrapper {
    position: relative;
    height: 320px;
    width: 100%;
}

.chart-range-select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Sarabun', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 100px;
}

.chart-range-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Recent Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-icon.maint {
    background-color: var(--primary-light);
    color: var(--primary);
}

.activity-icon.trip {
    background-color: var(--success-light);
    color: var(--success);
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.activity-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

.activity-notes {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    background-color: var(--bg-primary);
    padding: 6px 10px;
    border-radius: 6px;
    border-left: 2px solid var(--border-color);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px -3px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px -3px rgba(79, 70, 229, 0.5);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--text-muted);
    color: #ffffff;
}

.btn-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

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

.tab-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tab-action-bar h2 {
    font-size: 22px;
    font-weight: 700;
}

/* ==========================================================================
   MOTORCYCLES GRID AND CARDS
   ========================================================================== */
.motos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.moto-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
}

.moto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
}

.moto-card:hover {
    transform: scale(1.02) translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.moto-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.moto-card-icon {
    font-size: 36px;
    color: var(--primary);
    background-color: var(--primary-light);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.moto-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.moto-delete-btn:hover {
    color: var(--danger);
    background-color: var(--danger-light);
}

.moto-card-title h3 {
    font-size: 18px;
    font-weight: 700;
}

.moto-card-title p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

.moto-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.moto-card-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.moto-card-row .label {
    color: var(--text-muted);
}

.moto-card-row .value {
    font-weight: 600;
}

.plate-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.plate-badge.plate-white {
    background-color: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

.plate-badge.plate-yellow {
    background-color: #facc15;
    color: #1e293b;
    border: 1px solid #ca8a04;
}

.plate-badge.plate-red {
    background-color: #ef4444;
    color: #ffffff;
    border: 1px solid #b91c1c;
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-panel {
    padding: 0;
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.data-table th {
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 600;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

:root[data-theme="light"] .data-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

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

.text-center {
    text-align: center;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.action-btn.delete:hover {
    color: var(--danger);
    background-color: var(--danger-light);
}

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: var(--text-muted);
    font-size: 14px;
}

.empty-state-large {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state-large i {
    font-size: 60px;
    margin-bottom: 16px;
    color: var(--border-color);
}

.empty-state-large p {
    font-size: 15px;
    font-weight: 500;
}

/* ==========================================================================
   MODALS (POPUP SYSTEMS)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-overlay.open .modal-box {
    transform: scale(1) translateY(0);
}

@keyframes modal-shake {
    0%, 100% { transform: scale(1) translateY(0); }
    20%, 60% { transform: scale(1.02) translateX(-6px); }
    40%, 80% { transform: scale(1.02) translateX(6px); }
}

.modal-box.modal-shake {
    animation: modal-shake 0.35s ease-in-out !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(79, 70, 229, 0.45) !important;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
}

.modal-form, 
.modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

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

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

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group label .required {
    color: var(--danger);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-primary);
    outline: none;
    width: 100%;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
}

/* ==========================================================================
   TOAST NOTIFICATION TOASTS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10001;
}

.toast {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 20px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateX(120%);
    animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideIn {
    to { transform: translateX(0); }
}

.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

.toast i {
    font-size: 18px;
}

.toast.success {
    border-left: 4px solid var(--success);
}
.toast.success i {
    color: var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}
.toast.error i {
    color: var(--danger);
}

.toast-msg {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ==========================================================================
   RESPONSIVE LAYOUTS (MOBILE ADAPTIVITY)
   ========================================================================== */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar-header {
        padding: 16px 20px;
    }
    
    .active-moto-container {
        padding: 12px 20px;
    }
    
    .sidebar-nav {
        padding: 12px;
    }
    
    .sidebar-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .nav-item {
        flex: 1;
        min-width: 130px;
    }
    
    .nav-item a {
        padding: 10px;
        justify-content: center;
        font-size: 12px;
        gap: 8px;
    }
    
    .nav-item a i {
        font-size: 14px;
    }
    
    .nav-item:hover a {
        padding-left: 10px;
    }
    
    .sidebar-footer {
        display: none; /* Hide toggle text, make small or auto */
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .quick-status {
        width: 100%;
        justify-content: center;
    }
    
    .content-body {
        padding: 20px;
    }
    
    .stats-grid {
        gap: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Transform Table to Cards on mobile */
    .table-responsive {
        overflow-x: visible !important;
        border: none !important;
    }

    .data-table, 
    .data-table thead, 
    .data-table tbody, 
    .data-table tr, 
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 20px;
        padding: 16px 20px;
        box-shadow: var(--shadow-sm);
        position: relative;
    }

    .data-table td {
        text-align: right;
        padding: 12px 0;
        border-bottom: 1px dashed var(--border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
    }

    .data-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-top: 12px;
        justify-content: flex-end;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        text-align: left;
        padding-right: 10px;
    }
}

/* ==========================================================================
   USER PROFILE BAR & AUTH SCREEN STYLES
   ========================================================================== */
.user-profile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin: 8px 16px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: auto; /* Push it down */
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.username-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.user-name-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.logout-icon-btn:hover {
    color: var(--danger);
    background-color: var(--danger-light);
}

/* Fullscreen Auth Screen */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.auth-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.auth-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo-icon {
    font-size: 40px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 10px rgba(139, 92, 246, 0.3));
}

#auth-system-logo-img {
    max-height: 52px;
    max-width: 120px;
    object-fit: contain;
    margin: 0 auto 12px auto;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
}

.auth-header h2 .highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    font-family: 'Sarabun', sans-serif;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: flex;
    flex-direction: column;
    animation: authFadeIn 0.3s ease-in-out;
}

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

.auth-form h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-form h3 i {
    color: var(--primary);
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    margin-top: 10px;
}

.auth-switch-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
    font-family: 'Sarabun', sans-serif;
}

.auth-switch-text a {
    color: var(--primary);
    font-weight: 600;
    transition: color 0.2s;
}

.auth-switch-text a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Hide main app contents if authentication screen is active */
.app-container.blur-bg {
    filter: blur(8px);
    pointer-events: none;
}

/* Mobile responsive fixes for Auth Card */
@media (max-width: 480px) {
    .auth-card {
        max-width: 90%;
        padding: 24px;
    }
}

/* Custom Toggle Switch (Slider) */
.switch-slider {
    background-color: var(--danger);
    border: 1px solid var(--danger);
}

.switch-toggle input:checked + .switch-slider {
    background-color: var(--success);
    border-color: var(--success);
}

.switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.role-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.role-badge.admin {
    background-color: var(--danger-light);
    color: var(--danger);
}

.role-badge.user {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Motorcycle Card Premium Image Styles */
.moto-card-photo-wrapper {
    margin: -24px -24px 16px -24px;
    height: 160px;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.moto-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.moto-card:hover .moto-card-photo {
    transform: scale(1.06);
}

.moto-card-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.moto-card-photo-placeholder i {
    font-size: 32px;
}

.moto-card-photo-placeholder span {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.moto-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.moto-card-btn {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f3f4f6;
    cursor: pointer;
    font-size: 13px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.moto-card-btn:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: scale(1.1);
}

.moto-card-btn.edit-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Specs collapse layout inside Card Body */
.moto-card-specs-toggle {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 4px 0;
}

.moto-card-specs-toggle:hover {
    text-decoration: underline;
}

.moto-card-specs-panel {
    display: none;
    flex-direction: column;
    gap: 8px;
    background-color: var(--bg-primary);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 8px;
    animation: slideDown 0.25s ease-out;
}

.moto-card-specs-panel.open {
    display: flex;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Trip Details Modal Premium Styling */
.trip-details-modal-box {
    max-width: 650px !important;
}

.trip-details-container {
    padding: 10px 8px;
}

.trip-summary-card {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(79, 70, 229, 0.02) 100%);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.trip-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 24px;
    margin-top: 20px;
}

@media (max-width: 480px) {
    .trip-details-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

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

.trip-details-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.trip-details-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.trip-details-notes-container {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

@media (max-width: 480px) {
    .trip-details-notes-container {
        grid-column: span 1;
    }
}

.trip-details-notes-box {
    background-color: var(--bg-primary);
    border-left: 4px solid var(--primary);
    border-radius: 4px 12px 12px 4px;
    padding: 14px 18px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.modal-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 32px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.refuel-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.refuel-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-primary);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.refuel-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-light);
}

.refuel-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.refuel-item-loc {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
}

.refuel-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.delete-refuel-btn {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.delete-refuel-btn:hover {
    color: var(--danger);
    background-color: var(--danger-light);
}

/* Trip Details Two-Column Split Layout styling */
.trip-details-split-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 28px;
    align-items: start;
}

.trip-details-modal-box {
    max-width: 900px !important;
    width: 90% !important;
}

.trip-details-left-col {
    display: flex;
    flex-direction: column;
}

.trip-details-right-col {
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .trip-details-split-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .trip-details-modal-box {
        max-width: 600px !important;
    }
}

/* ==========================================================================
   MOBILE & TABLET UX/UI OPTIMIZATION
   ========================================================================== */

/* Hamburger Button - visible only on mobile */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.hamburger-btn:hover {
    background-color: var(--primary-light);
}

/* Mobile Theme Toggle in header */
.mobile-theme-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.mobile-theme-btn:hover {
    background-color: var(--primary-light);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Bottom Navigation Bar */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 500;
    padding: 4px 8px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
}
.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    min-width: 56px;
    min-height: 48px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 10px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s, background-color 0.2s;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item i {
    font-size: 20px;
    transition: transform 0.2s;
}
.bottom-nav-item.active {
    color: var(--primary);
}
.bottom-nav-item.active i {
    transform: scale(1.1);
}
.bottom-nav-item:active {
    background-color: var(--primary-light);
}

.bottom-nav-item.admin-only[style*="display: block"] {
    display: flex !important;
}

/* ==========================================================================
   TABLET BREAKPOINT (769px - 1024px)
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    :root[data-theme="dark"], :root[data-theme="light"] {
        --sidebar-width: 240px;
    }
    .sidebar {
        width: 240px;
    }
    .sidebar-header {
        padding: 16px;
    }
    .logo-text {
        font-size: 18px;
    }
    .active-moto-container {
        padding: 14px 16px;
    }
    .sidebar-nav .nav-item {
        padding: 10px 16px;
        font-size: 13px;
    }
    .content-body {
        padding: 24px;
    }
    .main-header {
        padding: 16px 24px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .motos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   MOBILE BREAKPOINT OVERRIDE (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* -- Hamburger & Mobile Header Controls -- */
    .hamburger-btn {
        display: flex;
    }
    .mobile-theme-btn {
        display: flex;
    }

    /* -- Off-Canvas Sidebar -- */
    .sidebar {
        position: fixed;
        width: 300px;
        height: 100vh;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .sidebar-nav {
        flex-direction: column;
        overflow-y: auto;
        flex: 1;
    }
    .sidebar-nav .nav-item {
        min-width: auto;
        flex: none;
        padding: 14px 24px;
        font-size: 15px;
        border-bottom: 1px solid var(--border-color);
    }
    .sidebar-nav .nav-item i {
        width: 24px;
        text-align: center;
    }
    .sidebar-footer {
        display: none !important;
    }

    /* -- Main Content: make room for bottom nav -- */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding-bottom: 70px;
    }
    .main-header {
        padding: 12px 16px;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    .main-header .header-left {
        flex: 1;
        min-width: 0;
    }
    .main-header .view-title {
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .main-header .view-subtitle {
        font-size: 12px;
        display: none;
    }

    /* -- Mobile Vehicle Selector Sub-Bar (Option A) -- */
    .mobile-vehicle-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        background-color: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
        position: sticky;
        top: 0;
        z-index: 95;
    }

    .mobile-vehicle-icon-box {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: var(--primary-light);
        border: 1px solid var(--primary);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--primary);
        font-size: 13px;
        flex-shrink: 0;
        transition: all 0.2s ease;
    }

    .mobile-vehicle-select-wrapper {
        position: relative;
        flex: 1;
        min-width: 0;
    }

    .mobile-vehicle-select-wrapper::after {
        content: '\f078';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        pointer-events: none;
        font-size: 10px;
    }

    .mobile-moto-select {
        width: 100%;
        background-color: var(--bg-primary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 7px 26px 7px 10px;
        font-size: 13px;
        font-weight: 600;
        font-family: inherit;
        appearance: none;
        -webkit-appearance: none;
        cursor: pointer;
        outline: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .mobile-moto-select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 2px var(--primary-light);
    }

    .mobile-vehicle-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background-color: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 6px 8px;
        font-size: 11px;
        font-weight: 600;
        color: var(--text-primary);
        white-space: nowrap;
        flex-shrink: 0;
    }

    .mobile-vehicle-badge i {
        color: var(--primary);
        font-size: 10px;
    }

    /* Hide clock and DB status text on mobile to keep header clean and spacious */
    .header-actions .quick-status {
        display: none !important;
    }

    .content-body {
        padding: 16px;
    }

    /* -- Bottom Nav visible -- */
    .bottom-nav {
        display: block;
    }

    /* -- Status Bar compact -- */
    .status-bar {
        flex-direction: row;
        gap: 8px;
        padding: 6px 10px;
        font-size: 11px;
    }

    /* -- Form improvements -- */
    .form-row {
        gap: 12px;
    }
    .form-group {
        margin-bottom: 14px;
    }
    .form-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px;
    }

    /* -- Buttons touch-friendly -- */
    .btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 14px;
    }
    .action-btn {
        padding: 10px 14px;
        min-height: 44px;
        min-width: 44px;
        font-size: 13px;
    }
    .moto-card-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
    .moto-delete-btn {
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
    }

    /* -- Modal fullscreen on mobile -- */
    .modal-box {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0 !important;
        margin: 0;
        display: flex;
        flex-direction: column;
    }
    .modal-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background-color: var(--bg-secondary);
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }
    .modal-close-btn {
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px;
    }
    .modal-footer, .form-actions {
        position: sticky;
        bottom: 0;
        z-index: 10;
        background-color: var(--bg-secondary);
        padding: 12px 20px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border-color);
        flex-shrink: 0;
        display: flex;
        gap: 8px;
    }
    .modal-footer .btn, .form-actions .btn {
        flex: 1;
    }

    /* -- Stats grid compact -- */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-card {
        padding: 14px;
    }
    .stat-card .stat-value {
        font-size: 22px;
    }
    .stat-card .stat-label {
        font-size: 11px;
    }

    /* -- Motorcycle cards -- */
    .motos-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* -- Table card improvements -- */
    .table-responsive table tr {
        padding: 14px 16px;
        margin-bottom: 12px;
    }
    .table-responsive table td {
        padding: 6px 0;
        font-size: 13px;
    }
    .table-responsive table td::before {
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        min-width: 100px;
    }
    .table-responsive table td:last-child {
        padding-top: 10px;
        margin-top: 6px;
        border-top: 1px solid var(--border-color);
    }

    /* -- Admin Panel mobile -- */
    .admin-settings-section {
        padding: 16px;
    }
    .admin-settings-section h3 {
        font-size: 16px;
    }

    /* -- User profile bar in sidebar compact -- */
    .user-profile-bar {
        padding: 16px 20px;
    }
    .user-profile-bar .profile-info .user-fullname {
        font-size: 14px;
    }

    /* -- Auth screen mobile -- */
    .auth-card {
        width: 100%;
        max-width: 100%;
        min-height: 100dvh;
        border-radius: 0;
        padding: 24px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .auth-logo {
        margin-bottom: 24px;
    }
    .auth-submit-btn {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
    }
    .auth-input {
        padding: 14px;
        font-size: 16px;
    }

    /* -- Trip details mobile -- */
    .trip-details-split-layout {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   SMALL MOBILE BREAKPOINT (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
    .main-header .view-title {
        font-size: 16px;
    }
    .content-body {
        padding: 12px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stat-card {
        padding: 12px;
    }
    .stat-card .stat-value {
        font-size: 20px;
    }
    .stat-card .stat-icon {
        font-size: 18px;
        width: 36px;
        height: 36px;
    }
    .bottom-nav-item {
        font-size: 9px;
        min-width: 48px;
    }
    .bottom-nav-item i {
        font-size: 18px;
    }
    .modal-body {
        padding: 16px;
    }
    .table-responsive table tr {
        padding: 12px;
    }
}

/* ==========================================================================
   SAFE AREA & NOTCH SUPPORT
   ========================================================================== */
@supports (padding: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(4px + env(safe-area-inset-bottom));
    }
    .modal-footer, .form-actions {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    .auth-card {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* Password Input Show/Hide Toggle Styling */
.password-input-wrapper {
    position: relative;
    width: 100%;
}
.password-input-wrapper input {
    padding-right: 44px !important;
}
.password-toggle-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 12px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s, background-color 0.2s;
}
.password-toggle-btn:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
}
.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.btn-spinner {
    margin-left: 8px;
    font-size: 14px;
}

/* ==========================================================================
   TRIP DETAILS MODAL - SEGMENTED TABS STYLING
   ========================================================================== */
.trip-tab-btn {
    background-color: transparent;
    color: var(--text-muted);
}
.trip-tab-btn:hover {
    color: var(--text-primary);
}
.trip-tab-btn.active {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ==========================================================================
   TRIP PLANNER & LEAFLET MAP STYLING (APPROACH A+B)
   ========================================================================== */
.trip-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.plan-filter-btn {
    padding: 7px 14px;
    border-radius: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary);
}

.plan-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* Plan Card */
.trip-plan-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.trip-plan-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
    border-color: rgba(79, 70, 229, 0.4);
}

.plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.plan-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.plan-status-badge {
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.plan-status-badge.planned {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.plan-status-badge.in_progress {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.plan-status-badge.completed {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.plan-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.plan-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.plan-stops-summary {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-stops-preview-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.plan-stop-chip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.plan-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

/* Timeline in modal */
.plan-timeline-stop {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: border-color 0.15s, background-color 0.15s;
}

.plan-timeline-stop:hover {
    border-color: var(--primary);
}

.plan-timeline-stop.visited {
    opacity: 0.7;
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

.stop-order-pill {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.stop-cat-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Leaflet Overrides */
.leaflet-container {
    font-family: inherit !important;
}

:root[data-theme="dark"] .leaflet-layer,
:root[data-theme="dark"] .leaflet-control-zoom-in,
:root[data-theme="dark"] .leaflet-control-zoom-out,
:root[data-theme="dark"] .leaflet-control-attribution {
    filter: brightness(0.85) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7);
}

:root[data-theme="dark"] .leaflet-marker-icon,
:root[data-theme="dark"] .leaflet-marker-shadow {
    filter: none !important;
}

/* Search results item */
.search-result-item {
    padding: 8px 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
}

.search-result-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Responsive adjustment for in-page map workspace */
@media (max-width: 960px) {
    .plan-workspace-grid {
        flex-direction: column !important;
    }
    .plan-stops-column {
        max-width: 100% !important;
    }
    #plan-leaflet-map {
        min-height: 420px !important;
    }
}

@media (max-width: 768px) {
    .trip-plans-grid {
        grid-template-columns: 1fr;
    }
    .plan-workspace-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }
}

/* ==========================================================================
   SHARE TRIP MODAL - MODERN UI ENHANCEMENTS
   ========================================================================== */
.share-hero-badge {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
}

:root[data-theme="dark"] .share-hero-badge {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
}

.share-public-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: all 0.2s ease;
}

.share-public-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.share-link-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-link-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 4px 6px 4px 12px;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.share-link-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.share-link-input-field {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    padding: 6px 0;
}

.share-link-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 9px;
    border: none;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

.share-link-copy-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.45);
}

.share-link-copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.share-qr-card {
    background: #ffffff;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 128px;
    height: 128px;
    transition: transform 0.2s ease;
}

.share-qr-card:hover {
    transform: scale(1.02);
}

.share-action-btn-line {
    background: #06c755;
    color: #ffffff;
    border: none;
    border-radius: 11px;
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(6, 199, 85, 0.25);
    width: 100%;
}

.share-action-btn-line:hover:not(:disabled) {
    background: #05b34c;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(6, 199, 85, 0.35);
}

.share-action-btn-line:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.share-action-btn-preview {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 11px;
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
}

.share-action-btn-preview:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

/* ==========================================================================
   PLAN STOPS DRAG & DROP REORDERING
   ========================================================================== */
.plan-timeline-stop {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    user-select: none;
    cursor: default;
}

.plan-timeline-stop .drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.plan-timeline-stop .drag-handle:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.plan-timeline-stop.sortable-chosen {
    background: var(--primary-light) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25) !important;
    transform: scale(1.02);
    cursor: grabbing !important;
}

.plan-timeline-stop.sortable-ghost {
    opacity: 0.35;
    background: rgba(59, 130, 246, 0.1) !important;
    border: 2px dashed var(--primary) !important;
}

/* ==========================================================================
   MODERN MAP SEARCH BAR & AUTOCOMPLETE
   ========================================================================== */
.modern-map-search-container {
    position: relative;
    width: 100%;
    margin-bottom: 4px;
}

.modern-map-search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 6px 8px 6px 16px;
    gap: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.modern-map-search-bar:focus-within {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.18), 0 0 0 3px var(--primary-light);
    transform: translateY(-1px);
}

.modern-map-search-icon {
    font-size: 16px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modern-map-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    padding: 8px 0;
}

.modern-map-search-input::placeholder {
    color: var(--text-muted);
    font-size: 13.5px;
}

.modern-map-search-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.modern-map-search-clear:hover {
    color: var(--text-primary);
    background: var(--border-color);
}

.modern-map-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

.modern-map-search-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.45);
}

.modern-map-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modern-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    display: none;
    animation: fadeInDropdown 0.2s ease;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.modern-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s ease;
}

.modern-search-item:last-child {
    border-bottom: none;
}

.modern-search-item:hover {
    background: var(--primary-light);
}

.modern-search-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* ==========================================================================
   BACK TO MAIN SITE (CHAIYO.IN.TH) LINKS
   ========================================================================== */
.auth-back-home-wrap {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.auth-back-home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.auth-back-home-link i {
    color: var(--primary);
    transition: transform 0.2s ease;
}

.auth-back-home-link:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.auth-back-home-link:hover i {
    transform: translateX(-3px);
}

/* Header Back Link */
.header-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-home-btn i.fa-globe,
.header-home-btn i.fa-house {
    color: var(--primary);
    font-size: 13px;
}

.header-home-btn .external-icon {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.header-home-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.15);
}

.header-home-btn:hover .external-icon {
    transform: translate(1px, -1px);
    opacity: 1;
}

@media (max-width: 640px) {
    .header-home-btn .header-home-text {
        display: none;
    }
    .header-home-btn {
        padding: 7px 10px;
        border-radius: 10px;
    }
    .header-home-btn .external-icon {
        display: none;
    }
}

/* Sidebar External Link */
.sidebar-external-item {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
    list-style: none;
}

.sidebar-external-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.25s ease;
}

.sidebar-external-link i.fa-globe {
    font-size: 16px;
    color: var(--primary);
}

.sidebar-external-link .external-link-icon {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.sidebar-external-link:hover {
    color: var(--text-primary);
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateX(3px);
}

.sidebar-external-link:hover .external-link-icon {
    transform: translate(2px, -2px);
    opacity: 1;
    color: var(--primary);
}

/* Dashboard Site Banner */
.dashboard-site-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: 14px;
    padding: 14px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    animation: fadeInBanner 0.3s ease;
}

@keyframes fadeInBanner {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.site-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 260px;
}

.site-banner-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.site-banner-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-banner-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.site-banner-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.site-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.site-banner-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

@media (max-width: 768px) {
    .dashboard-site-banner {
        flex-direction: column;
        align-items: stretch;
    }
    .site-banner-btn {
        justify-content: center;
    }
}



