/* SD2HS Shared Design System & Application Stylesheet */

:root {
    --primary-orange: #FF6B00;
    --primary-orange-hover: #E05E00;
    --primary-orange-light: #FFF0E6;
    --primary-orange-rgb: 255, 107, 0;
    --text-dark: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --bg-glass: rgba(255, 255, 255, 0.85);
    
    /* Dashboard specific */
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    --hover-shadow: 0 15px 35px rgba(255, 107, 0, 0.08);
}

/* Base Body Styles for Login & Dashboard */
html.login-html {
    overscroll-behavior: none;
    overflow: hidden;
    height: 100%;
}

body.login-page {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #FAFAFA;
    color: var(--text-dark);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0;
    padding: 20px;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: none;
}

body.dashboard-page {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #F8F9FA;
    color: var(--text-dark);
    min-height: 100vh;
    margin: 0;
    padding-bottom: 70px; /* Leave space for bottom navbar on mobile */
    overflow-x: hidden;
}

/* Abstract Background Blobs */
.bg-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--primary-orange-rgb), 0.12) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    filter: blur(40px);
}
.blob-top-right {
    top: -10%;
    right: -10%;
}
.blob-bottom-left {
    bottom: -10%;
    left: -10%;
    background: radial-gradient(circle, rgba(var(--primary-orange-rgb), 0.08) 0%, rgba(255,255,255,0) 70%);
}

/* Login Card Container */
.login-card-wrapper {
    width: 100%;
    max-width: 480px;
    z-index: 10;
}

.login-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 28px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.04), 
                0 8px 16px rgba(var(--primary-orange-rgb), 0.02);
    padding: 40px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.login-card:hover {
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.06), 
                0 12px 24px rgba(var(--primary-orange-rgb), 0.04);
    border-color: rgba(var(--primary-orange-rgb), 0.15);
}

/* Logo Brand Style */
.brand-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.brand-logo-img {
    max-height: 110px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.04));
    transition: transform 0.3s ease;
}

.brand-logo-img:hover {
    transform: scale(1.04);
}

/* Sliding Steps Layout */
.slider-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.slider-track {
    display: flex;
    width: 200%;
    min-width: 200%;
    max-width: 200%;
    flex-shrink: 0;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-pane {
    width: 50%;
    flex: 0 0 50%;
    padding: 5px;
    box-sizing: border-box;
}

/* Headings */
.form-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Form inputs & custom styling */
.form-label {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.input-group-custom {
    position: relative;
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
}

.input-group-custom:focus-within {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 4px rgba(var(--primary-orange-rgb), 0.15);
}

.country-select {
    border: none;
    background: transparent;
    padding: 14px 10px 14px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    outline: none;
    cursor: pointer;
    border-right: 1.5px solid var(--border-color);
}

.form-control-custom {
    border: none;
    background: transparent;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    color: var(--text-dark);
    outline: none;
}

.form-control-custom::placeholder {
    color: #9CA3AF;
}

/* Verification Code Inputs */
.digit-inputs-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
}

.digit-input {
    width: 56px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    outline: none;
    transition: all 0.2s ease;
}

.digit-input:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 4px rgba(var(--primary-orange-rgb), 0.15);
    background-color: #FFFDFB;
}

.digit-input.filled {
    border-color: rgba(var(--primary-orange-rgb), 0.55);
    color: var(--primary-orange);
    font-size: 28px;
}

/* Orange Buttons */
.btn-orange {
    background-color: var(--primary-orange);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 15px;
    padding: 14px 24px;
    border-radius: 14px;
    border: none;
    width: 100%;
    box-shadow: 0 8px 20px rgba(var(--primary-orange-rgb), 0.25);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-orange:hover, .btn-orange:focus {
    background-color: var(--primary-orange-hover);
    box-shadow: 0 10px 24px rgba(var(--primary-orange-rgb), 0.35);
    transform: translateY(-1px);
    color: #FFFFFF;
}

.btn-orange:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(var(--primary-orange-rgb), 0.25);
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
}

.btn-back:hover {
    color: var(--primary-orange);
}

/* Utility styles */
.text-orange {
    color: var(--primary-orange) !important;
}
.text-orange:hover {
    color: var(--primary-orange-hover) !important;
}

.text-link {
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
}

.form-check-input:checked {
    background-color: var(--primary-orange);
    border-color: var(--primary-orange);
}

.form-check-label {
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}

.spinner-border-sm {
    display: none;
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Custom Toasts styling */
.toast-container-custom {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
}
.toast-custom {
    background: #FFFFFF;
    border-left: 4px solid var(--primary-orange);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    animation: slideDown 0.3s ease forwards;
}

/* ========================================================
   DASHBOARD SPECIFIC PREMIUM STYLES
   ======================================================== */

/* Desktop Navbar */
.navbar-custom {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.nav-link-custom {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link-custom:hover, .nav-link-custom.active {
    color: var(--primary-orange) !important;
    background-color: var(--primary-orange-light);
}

/* Mobile Sidebar (Off-canvas Drawer) */
.sidebar-custom {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #FFFFFF;
    border-right: 1px solid var(--border-color);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
    z-index: 1060;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.sidebar-open {
    overflow: hidden !important;
}

.sidebar-custom.open {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

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

.sidebar-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--primary-orange);
    background-color: var(--primary-orange-light);
}

/* Mobile Bottom Navigation Bar */
.bottom-nav-custom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #FFFFFF;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    flex-grow: 1;
    height: 100%;
    transition: color 0.2s ease;
}

.bottom-nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.bottom-nav-item:hover, .bottom-nav-item.active {
    color: var(--primary-orange);
}

/* Premium Hero Slider Styling */
.hero-slider-container {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
}

.hero-slider-slide {
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    color: #FFFFFF;
}

.hero-slider-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(17, 24, 39, 0.85) 0%, rgba(17, 24, 39, 0.3) 100%);
    z-index: 1;
}

.hero-slider-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    padding: 40px;
}

.hero-slider-title {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero-slider-text {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Stats Count Section */
.stat-card {
    background: #FFFFFF;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(var(--primary-orange-rgb), 0.15);
}

.stat-icon-container {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.stat-val {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.1;
}

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

/* App-style grid buttons/cards */
.quick-actions-row {
    align-items: stretch;
}

.quick-actions-row > div {
    display: flex;
}

.app-card {
    background: #FFFFFF;
    border-radius: 22px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    padding: 28px;
    text-align: center;
    height: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 180px;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(var(--primary-orange-rgb), 0.1);
    border-color: var(--primary-orange);
}

.app-card-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background-color: var(--primary-orange-light);
    color: var(--primary-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s ease;
}

.app-card:hover .app-card-icon {
    background-color: var(--primary-orange);
    color: #FFFFFF;
    transform: scale(1.1);
}

.app-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.app-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* Premium Role Switcher Widget (Floating Simulator console) */
.role-badge-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    text-transform: uppercase;
}

.role-badge-admin {
    background-color: #FEE2E2;
    color: #EF4444;
}

.role-badge-dealer {
    background-color: #DBEAFE;
    color: #3B82F6;
}

.role-badge-customer {
    background-color: #D1FAE5;
    color: #10B981;
}

.role-badge-technician {
    background-color: #E0F2FE;
    color: #0369A1;
}

.role-badge-delivery_boy {
    background-color: #F3E8FF;
    color: #6B21A8;
}

@media (max-width: 768px) {
    /* Hide top nav items on mobile, sidebar takes care of them */
    .desktop-nav-items {
        display: none !important;
    }
    
    .hero-slider-slide {
        height: 220px;
    }
    .hero-slider-title {
        font-size: 26px;
    }
    .hero-slider-text {
        font-size: 14px;
    }
    .hero-slider-content {
        padding: 24px;
    }

    /* Mobile Inline Stats adjustments */
    .stat-card {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 8px !important;
        padding: 12px 6px !important;
        border-radius: 14px !important;
    }
    .stat-icon-container {
        width: 38px !important;
        height: 38px !important;
        border-radius: 10px !important;
        font-size: 18px !important;
    }
    .stat-val {
        font-size: 15px !important;
    }
    .stat-lbl {
        font-size: 9px !important;
        line-height: 1.2 !important;
    }

    /* Mobile Inline Quick Action cards adjustments */
    .app-card {
        padding: 16px 8px !important;
        min-height: 110px !important;
        border-radius: 16px !important;
        gap: 8px !important;
        justify-content: flex-start !important;
    }
    .app-card-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
    }
    .app-card-title {
        font-size: 12px !important;
    }
    .app-card-desc {
        display: none !important;
    }
}

@media (min-width: 769px) {
    /* Hide bottom navbar and sidebar toggle trigger on desktop */
    .bottom-nav-custom {
        display: none !important;
    }
    
    .mobile-menu-trigger {
        display: none !important;
    }
}

/* Mobile responsive padding and alignment */
@media (max-width: 576px) {
    body.login-page {
        padding: 12px;
    }
    body.login-page {
        align-items: flex-start !important;
        padding: 24px 16px 16px 16px !important;
    }
    .login-card-wrapper {
        margin-top: 10px;
    }
    .login-card {
        padding: 20px 16px !important;
        border-radius: 20px !important;
    }
    .brand-logo-container {
        margin-bottom: 12px !important;
    }
    .brand-logo-img {
        max-height: 75px !important;
    }
    .form-title {
        font-size: 19px !important;
        margin-bottom: 4px !important;
    }
    .form-subtitle {
        font-size: 12px !important;
        margin-bottom: 16px !important;
    }
    .digit-inputs-container {
        margin: 16px 0 !important;
        gap: 8px !important;
    }
    .digit-input {
        width: 48px !important;
        height: 48px !important;
        font-size: 20px !important;
        border-radius: 12px !important;
    }
    .btn-orange {
        padding: 12px 16px !important;
        font-size: 14px !important;
        border-radius: 12px !important;
    }
    .input-group-custom {
        border-radius: 12px !important;
    }
    .country-select {
        padding: 10px 8px 10px 12px !important;
        font-size: 16px !important;
    }
    .form-control-custom {
        padding: 10px 12px !important;
        font-size: 16px !important;
    }
}

/* Dynamic Role Switcher Floating Simulator Widget */
.sim-control-badge {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 107, 0, 0.2);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    z-index: 1040;
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
}
.sim-control-badge:hover {
    box-shadow: 0 15px 35px rgba(255, 107, 0, 0.15);
    background: #FFFFFF;
}
.sim-control-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 4px;
}
.sim-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.sim-status-active {
    background-color: #10B981;
    box-shadow: 0 0 8px #10B981;
}
.sim-radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.sim-radio-option:hover {
    background-color: var(--primary-orange-light);
    color: var(--primary-orange);
}
.sim-radio-option input[type="radio"] {
    accent-color: var(--primary-orange);
}
.sim-info-text {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 4px;
}

/* Global Table & Order Card Responsiveness Overrides */
.table-responsive-custom {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}
@media (max-width: 768px) {
    .table-responsive-custom table {
        min-width: 800px;
    }
}

@media (max-width: 767.98px) {
    .order-card-item .col-md-3, 
    .order-card-item .col-md-2 {
        border-bottom: 1px dashed #F3F4F6;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    .order-card-item .col-md-2:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
}

