/* =========================================
   1. Design System Variables & Reset
   ========================================= */
:root {
    /* Core Palette */
    --primary-color: #003366;
    /* Dark Blue */
    --accent-color: #FFD700;
    /* Electric Yellow */

    /* Text Colors */
    --text-dark: #333333;
    --text-light: #f4f4f4;
    --text-muted: #666666;

    /* Backgrounds */
    --bg-light: #f8f9fa;
    /* Light Gray / Body */
    --bg-white: #ffffff;
    /* Cards / Modals */

    /* UI Systems */
    --radius: 12px;
    --boundary-padding: 5px;
    /* Mobile safe area */
    --header-height: 70px;

    /* Shadows */
    --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-sticky: 0 4px 15px rgba(0, 0, 0, 0.1);

    /* Functional Colors */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --drawer-width: 280px;
    --drawer-width: 280px;

    /* Rounded Design System */
    --radius-sm: 8px;
    /* Badges, Tags */
    --radius-md: 16px;
    /* Cards, Inputs */
    --radius-lg: 24px;
    /* Modals, Containers */
    --radius-pill: 9999px;
    /* Buttons */
}

html {
    scroll-behavior: smooth;
}

/* Global Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    /* Remove blue highlight on mobile */
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    padding-top: var(--header-height);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.25rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #002244;
    /* Darker blue */
}

/* Main Container Defaults */
main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* =========================================
   2. UI Components (Buttons & Forms)
   ========================================= */

/* Buttons */
.btn,
.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    /* Rounded Pill Shape */
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    gap: 8px;
}

.btn-primary,
.button {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.btn-primary:hover,
.button:hover {
    background-color: #002244;
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 51, 102, 0.3);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.btn-accent:hover {
    background-color: #e6c200;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #e1e1e1;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-white);
}

/* Hero Specific Inputs (Rounded Pill) */
.dashboard-hero input[type="text"],
.dashboard-hero input[type="number"],
.dashboard-hero select {
    border-radius: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.dashboard-hero input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

/* =========================================
   3. Global Layout (Header/Footer)
   ========================================= */
/* =========================================
   3. Global Layout (Header/Footer)
   ========================================= */
header {
    height: var(--header-height);
    background: rgba(0, 31, 63, 0.95);
    /* Deep Navy Blue */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(0, 31, 63, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

/* Logo Area */
.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--bg-white);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo i {
    color: var(--accent-color);
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

/* Header Actions Group */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Navigation Links */
.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Search Bar */
.search-container {
    position: relative;
    margin-right: 10px;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 6px 16px;
    transition: all 0.3s ease;
    width: 240px;
}

.search-input-group:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
    width: 280px;
}

.search-input-group input {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    width: 100%;
    padding: 0;
    outline: none;
}

.search-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input-group button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.search-input-group button:hover {
    color: var(--accent-color);
}

/* Location Button in Header */
.header-location-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.header-location-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.header-location-btn i {
    color: var(--accent-color);
}

/* Icon Actions (Bell, Cart, User) */
.icon-action-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
    padding: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.icon-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.icon-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--primary-color);
}

/* User Menu Container */
.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* User Menu Trigger */
.user-menu-btn {
    padding: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
    cursor: pointer;
}

.user-menu-btn:hover,
.user-menu-btn.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

.user-menu-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu-btn-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* User Menu Dropdown */
.user-menu-container {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.user-menu-container:hover .user-dropdown,
.user-menu-container.active .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.dropdown-header strong {
    color: #333;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.dropdown-header small {
    color: #666;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-links {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.dropdown-links li a,
.dropdown-links li button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #444;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.dropdown-links li a:hover,
.dropdown-links li button:hover {
    background: #f0f7ff;
    color: var(--primary-color);
}

.dropdown-links li.divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

.dropdown-links li a.text-danger {
    color: #dc3545;
}

.dropdown-links li a.text-danger:hover {
    background: #fff5f5;
}

/* Mobile Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    margin-left: 8px;
}

/* Utility: Hidden on Desktop/Mobile classes */
.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .search-input-group {
        width: 180px;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-links a {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
}

@media (max-width: 860px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header-container {
        padding: 0 16px;
    }

    .logo span {
        font-size: 1.4rem;
    }
}

/* =========================================
   3a. Page Hero Component
   ========================================= */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #001f3f 100%);
    position: relative;
    padding: 120px 20px 60px;
    /* Top padding accounts for fixed header */
    color: white;
    text-align: center;
    border-radius: 0 0 20px 20px;
    margin-bottom: 40px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Optional: Overlay texture or image if needed later */
.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/images/circuit-pattern.svg') center/cover;
    /* Placeholder/Fallback */
    opacity: 0.05;
    pointer-events: none;
}

.page-header h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.breadcrumbs {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    z-index: 1;
}

.breadcrumbs a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.breadcrumbs a:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.breadcrumbs span {
    margin: 0 8px;
    opacity: 0.5;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .page-header {
        padding: 100px 15px 40px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }
}


.header-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bg-white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Mobile Nav Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--bg-white);
    font-size: 1.8rem;
    cursor: pointer;
}

/* Icons & Badges */
.nav-icon {
    color: var(--bg-white);
    font-size: 1.2rem;
    position: relative;
}

.nav-icon:hover {
    color: var(--accent-color);
}

.badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* =========================================
   3a. Home Page Dashboard (Utility Tools)
   ========================================= */
.dashboard-hero {
    background: linear-gradient(135deg, #001f3f 0%, #003366 100%);
    padding: 20px 0 100px;
    /* Extended padding for overlap */
    color: white;
    border-radius: 0 0 50px 50px;
    /* Curved Bottom */
    box-shadow: 0 10px 30px -10px rgba(0, 51, 102, 0.3);
    position: relative;
    z-index: 1;
}

.overlap-grid-container {
    margin-top: -60px;
    /* Negative Margin Trick */
    position: relative;
    z-index: 2;
    padding-bottom: 40px;
}

.dashboard-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

.tool-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: 0 10px 40px -10px rgba(0, 51, 102, 0.15);
    /* Soft Shadow */
    color: var(--text-dark);
    height: 100%;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tool-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.tool-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
}

/* Inputs */
.range-group {
    margin-bottom: 20px;
}

.range-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type=range] {
    width: 100%;
    height: 8px;
    /* Thicker track */
    background: #e9ecef;
    border-radius: 10px;
    outline: none;
    appearance: none;
}

input[type=range]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.counter-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.counter-btn {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-val {
    font-weight: 700;
    font-size: 1.1rem;
}

.toggle-group {
    display: flex;
    background: #f1f3f5;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}

.toggle-opt {
    flex: 1;
    text-align: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.toggle-opt.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-weight: 700;
}

.price-display {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 20px 0;
}

/* Grid Load Calc */
.appliance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.appliance-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.appliance-item:hover {
    background: #e9ecef;
}

.appliance-item.active {
    border-color: var(--accent-color);
    background: #fffbe6;
}

/* Pale Yellow */
.appliance-icon {
    font-size: 1.5rem;
    color: #555;
    margin-bottom: 5px;
}

.appliance-item.active .appliance-icon {
    color: var(--primary-color);
}

.appliance-name {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
}

.load-bar-container {
    height: 12px;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
    margin: 15px 0 5px;
}

.load-bar {
    height: 100%;
    width: 0%;
    background: var(--success);
    transition: width 0.3s, background 0.3s;
}

.load-status {
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.load-status.danger {
    color: var(--danger);
}

/* Emergency Block */
.emergency-grid {
    display: grid;
    gap: 10px;
}

.btn-emergency {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s;
}

.btn-fire {
    background: #ffebee;
    color: #c62828;
}

.btn-off {
    background: #263238;
    color: #fff;
}

.btn-spark {
    background: #fff8e1;
    color: #f57f17;
}

.btn-emergency:hover {
    transform: scale(1.02);
}

/* Emergency Modal */
.emer-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.emer-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.emer-modal {
    background: white;
    width: 90%;
    max-width: 400px;
    width: 90%;
    max-width: 400px;
    padding: 30px;
    border-radius: var(--radius-lg);
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.emer-modal-overlay.active .emer-modal {
    transform: translateY(0);
}

.emer-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.emer-title {
    font-size: 1.5rem;
    color: var(--danger);
    margin-bottom: 10px;
}

.emer-btn-call {
    display: block;
    width: 100%;
    background: var(--danger);
    color: white;
    padding: 15px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 20px;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Section Title decoration */
.section-marker {
    color: var(--accent-color);
    font-weight: 800;
    margin-right: 8px;
}


footer {
    background: #1a1a1a;
    color: #fff;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

/* =========================================
   3b. Advanced Header (Mobile Drawer)
   ========================================= */
/* Mobile Drawer Overlay */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Side Drawer */
.side-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--drawer-width);
    background: var(--bg-white);
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.side-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #eee;
    background: var(--bg-light);
}

.drawer-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.drawer-nav-links {
    list-style: none;
}

.drawer-nav-links a {
    display: block;
    padding: 12px 25px;
    color: var(--text-dark);
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: background 0.2s;
}

.drawer-nav-links a:hover,
.drawer-nav-links a.active {
    background: #f0f4f8;
    border-left-color: var(--accent-color);
    color: var(--primary-color);
}

.drawer-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

/* =========================================
   3c. Advanced Footer
   ========================================= */
.main-footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 60px 20px 20px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h4 {
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.footer-col p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s;
    display: inline-block;
    padding: 5px 0;
    /* Touch target */
}

.footer-links a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s;
}

.social-btn:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* =========================================
   4. Services Page & Cards
   ========================================= */
.services-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.services-header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
    position: relative;
    z-index: 10;
}

.services-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    /* Fallback */
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.services-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 500;
}

/* Decorative Underline */
.services-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Sticky Control Panel */
.sticky-service-header {
    position: sticky;
    top: calc(var(--header-height) + 10px);
    /* Add spacing from top */
    z-index: 95;
    background: rgba(0, 51, 102, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    margin: 0 0 20px 0;
    /* Remove negative margins to fit inside container */
    border-radius: var(--radius-md);
    /* Rounded corners */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    /* Softer shadow */
}

/* Search */
.search-container {
    margin-bottom: 15px;
}

.search-input-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper input {
    border-radius: 30px;
    padding-left: 45px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* Pill Filters */
.category-filters-wrapper {
    position: relative;
    overflow: hidden;
}

.category-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
}

.category-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.15);
    color: var(--bg-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 18px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-color);
    color: var(--primary-color);
    /* Contrast on yellow */
    font-weight: 700;
    border-color: var(--accent-color);
}

.filter-fade-edge {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    background: linear-gradient(to right, transparent, rgba(0, 51, 102, 0.95));
    pointer-events: none;
}

/* Service Grid & Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 10px 0;
}

.service-card,
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.service-icon {
    width: 50px;
    height: 50px;
    background: #e6efff;
    /* Very light blue */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.service-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.service-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.service-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

.service-price {
    font-weight: 800;
    color: var(--text-dark);
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.service-price::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: -2px;
    right: -2px;
    height: 6px;
    background: var(--accent-color);
    opacity: 0.4;
    z-index: -1;
    border-radius: 2px;
}

/* Quantity Controls */
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    width: 30px;
    height: 30px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-dark);
}

.qty-btn:hover {
    background: #e9ecef;
}

.qty-input {
    width: 35px;
    height: 30px;
    border: none;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    text-align: center;
    padding: 0;
    border-radius: 0;
}

/* Action Buttons */
.add-to-cart-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.add-to-cart-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
}

.add-to-cart-btn.added {
    background: var(--success);
    color: white;
}

.edit-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #eee;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

/* =========================================
   5. Mobile Responsiveness (The 5px Rule)
   ========================================= */
@media (max-width: 768px) {

    /* Global Container Override */
    main,
    .services-page-container,
    .header-container {
        padding-left: var(--boundary-padding) !important;
        padding-right: var(--boundary-padding) !important;
    }

    /* Header */
    .desktop-nav {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    /* Sticky Header Edge Bleed */
    .sticky-service-header {
        margin-left: -5px;
        margin-right: -5px;
        padding-left: 10px;
        padding-right: 10px;
        top: 60px;
        /* Smaller header height logic if needed, but keeping 70px usually safe */
    }

    /* Cards */
    .services-grid {
        grid-template-columns: 1fr;
        /* Stack */
        gap: 15px;
    }

    /* Typography Scaling */
    h1 {
        font-size: 1.75rem;
    }

    /* Mobile Menu */
    .mobile-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-white);
        border-bottom: 2px solid var(--primary-color);
        padding: 10px 0;
        transform: translateY(-100%);
        transition: transform 0.3s;
        z-index: 990;
        opacity: 0;
        pointer-events: none;
    }

    .mobile-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-nav-links a {
        display: block;
        padding: 12px 20px;
        color: var(--text-dark);
        border-left: 4px solid transparent;
    }

    .mobile-nav-links a:hover {
        background: #f0f0f0;
        border-left-color: var(--accent-color);
    }
}

/* =========================================
   6. Utilities & Extras
   ========================================= */
/* =========================================
   6. Global Cart & Utilities
   ========================================= */

/* Header Cart Badge */
.header-cart-btn {
    position: relative;
    color: var(--text-light);
    font-size: 1.2rem;
    margin-right: 15px;
    text-decoration: none;
    transition: color 0.2s;
}

.header-cart-btn:hover {
    color: var(--accent-color);
}

.header-cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--accent-color);
    color: var(--primary-color);
    font-size: 0.7rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
}

/* Cart Toast */
.cart-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 51, 102, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    z-index: 10000;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

.cart-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    color: var(--text-muted);
}

/* ... rest of existing empty-state ... */

.empty-state i {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Modal (Order) */
.modal-overlay {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* =========================================
   7. Dashboard Styles (Soft UI)
   ========================================= */

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(0, 86, 179, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-dark);
}

.stat-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dashboard-orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.order-card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 86, 179, 0.1);
}

.order-header {
    padding: 15px 20px;
    background: linear-gradient(to right, #f8f9fa, #fff);
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-id {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.order-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.order-body {
    padding: 20px;
    flex: 1;
}

.order-service-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
}

.order-detail-row i {
    color: var(--accent-color);
    width: 20px;
    text-align: center;
}

.order-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-in_progress {
    background: #fff8e1;
    color: #fbc02d;
}

.status-completed {
    background: #e8f5e9;
    color: #388e3c;
}

.status-cancelled {
    background: #ffebee;
    color: #d32f2f;
}

.chat-container {
    height: calc(100vh - 100px);
    background: var(--bg-white);
    border: 1px solid #ddd;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f0f2f5;
}

.message {
    max-width: 80%;
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 12px;
    position: relative;
}

.message-own {
    background: #d1e7dd;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.message-other {
    background: #fff;
    margin-right: auto;
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}