/* -------------------------------------------------------------
 * 1. Global Setup & CSS Variables (Theme System)
 * ------------------------------------------------------------- */
:root {
    /* Fonts */
    --font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    
    /* Light Theme (Default) */
    --body-bg: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    --device-border: #1e293b;
    --device-bg: #f8fafc;
    --app-bg: #f1f5f9;
    --card-bg: #ffffff;
    --card-border: rgba(226, 232, 240, 0.8);
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --primary-color: #6366f1; /* Indigo */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --accent-color: #8b5cf6; /* Violet */
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    
    --success-color: #10b981; /* Emerald */
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger-color: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-focus: #6366f1;
    --input-focus-shadow: rgba(99, 102, 241, 0.15);
    
    --nav-bg: rgba(255, 255, 255, 0.85);
    --nav-border: rgba(226, 232, 240, 0.5);
    --nav-active: #6366f1;
    --nav-inactive: #94a3b8;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 8px 24px rgba(148, 163, 184, 0.15);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.08);
    
    --glass-blur: blur(20px);
}

.dark-theme {
    /* Dark Theme Override */
    --body-bg: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    --device-border: #334155;
    --device-bg: #0b0f19;
    --app-bg: #090d16;
    --card-bg: rgba(15, 23, 42, 0.6);
    --card-border: rgba(255, 255, 255, 0.06);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary-color: #818cf8;
    --primary-gradient: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    --accent-color: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    
    --success-color: #34d399;
    --success-bg: rgba(52, 211, 153, 0.15);
    --danger-color: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.15);
    
    --input-bg: rgba(15, 23, 42, 0.8);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: #818cf8;
    --input-focus-shadow: rgba(129, 140, 248, 0.25);
    
    --nav-bg: rgba(15, 23, 42, 0.8);
    --nav-border: rgba(255, 255, 255, 0.05);
    --nav-active: #818cf8;
    --nav-inactive: #64748b;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.3);
    --shadow-lg: 0 24px 60px rgba(0,0,0,0.45);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--body-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    color: var(--text-primary);
    transition: background 0.4s ease;
}

/* -------------------------------------------------------------
 * 2. Background Graphic Elements (For Desktop Viewports)
 * ------------------------------------------------------------- */
.app-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 1;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.bg-shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #6366f1 0%, #d946ef 100%);
    top: -50px;
    left: 10%;
}

.bg-shape-2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    bottom: 50px;
    right: 10%;
}

.dark-theme .bg-shape {
    opacity: 0.25;
}

/* -------------------------------------------------------------
 * 3. Mobile Device Simulation Shell
 * ------------------------------------------------------------- */
.mobile-device {
    position: relative;
    width: 385px;
    height: 820px;
    background: var(--device-bg);
    border: 12px solid var(--device-border);
    border-radius: 46px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

/* Interactive shell elements (top speaker, notch) */
.device-header-elements {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 30px;
    background: var(--device-border);
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding-bottom: 2px;
}

.camera-lens {
    width: 8px;
    height: 8px;
    background: #0f172a;
    border-radius: 50%;
    border: 1.5px solid #334155;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
}

.speaker-grill {
    width: 45px;
    height: 4px;
    background: #1e293b;
    border-radius: 2px;
}

/* Device screen area */
.device-screen {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--app-bg);
    overflow: hidden;
}

/* Home Indicator for iOS style mockup */
.home-indicator {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4.5px;
    background: var(--text-muted);
    border-radius: 3px;
    z-index: 100;
    pointer-events: none;
    opacity: 0.6;
}

/* Mobile App Status Bar Mockup */
.status-bar {
    height: 38px;
    width: 100%;
    padding: 12px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 99;
    user-select: none;
}

.status-icons {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* -------------------------------------------------------------
 * 4. Main App Components & Layouts
 * ------------------------------------------------------------- */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* App Header styling */
.app-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    z-index: 90;
    transition: all 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.brand-text h1 {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

.brand-text .subtitle {
    font-size: 10px;
    color: var(--text-secondary);
    display: block;
}

.header-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-icon-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-refresh-cache {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: 18px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-refresh-cache:hover {
    transform: scale(1.03);
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.btn-refresh-cache:active {
    transform: scale(0.96);
}

/* Scrollable main content */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 84px; /* extra space at bottom for nav bar */
    position: relative;
    scroll-behavior: smooth;
}

/* Hide standard scrollbars for native feeling */
.app-content::-webkit-scrollbar {
    display: none;
}

/* App Bottom Navigation Bar */
.app-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--nav-bg);
    border-top: 1px solid var(--nav-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 10px 14px; /* space for home indicator */
    z-index: 95;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
}

.nav-item {
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--nav-inactive);
    cursor: pointer;
    flex: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    gap: 3px;
}

.nav-icon {
    font-size: 19px;
    transition: transform 0.3s ease;
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
}

.nav-item.active {
    color: var(--nav-active);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px) scale(1.1);
}

/* -------------------------------------------------------------
 * 5. Sheet Panels & Animation States
 * ------------------------------------------------------------- */
.app-sheet {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-sheet.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Animation keyframes for switching tabs */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sheet-title-wrapper {
    margin-bottom: 22px;
}

.sheet-title-wrapper h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.sheet-title-wrapper p {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* -------------------------------------------------------------
 * 6. Form Fields Design
 * ------------------------------------------------------------- */
.app-input-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.app-input-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    padding-right: 4px;
}

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

.input-icon {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-container input,
.input-container select {
    width: 100%;
    padding: 12px 38px 12px 14px; /* rtl padding adjustments */
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    appearance: none; /* remove browser default select styling */
}

/* Styled drop down arrow for SELECT element */
.input-container select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: left 12px center;
    background-size: 20px;
    background-repeat: no-repeat;
    padding-left: 36px;
}

.dark-theme .input-container select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}

.input-container input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Focus and hover states */
.input-container input:hover,
.input-container select:hover {
    border-color: var(--text-muted);
}

.input-container input:focus,
.input-container select:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px var(--input-focus-shadow);
}

.input-container input:focus + .input-icon,
.input-container select:focus + .input-icon {
    color: var(--primary-color);
}

/* Stepper Component for Count Field */
.count-stepper-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.count-stepper-wrapper:focus-within {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px var(--input-focus-shadow);
}

.stepper-btn {
    border: none;
    background: none;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}

.stepper-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
}

.stepper-btn:active {
    transform: scale(0.92);
}

.count-stepper-wrapper input {
    flex: 1;
    border: none;
    background: none;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
    height: 44px;
    width: 100%;
}

/* Two inputs side-by-side */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Error/Validation messaging */
.validation-msg {
    font-size: 10px;
    color: var(--danger-color);
    font-weight: 600;
    display: none;
    padding-right: 4px;
    margin-top: 1px;
    animation: slideUp 0.2s ease forwards;
}

.app-input-group.has-error .input-container input,
.app-input-group.has-error .input-container select,
.app-input-group.has-error .count-stepper-wrapper {
    border-color: var(--danger-color) !important;
}

.app-input-group.has-error .validation-msg {
    display: block;
}

/* Submit Button */
.app-submit-btn {
    margin-top: 10px;
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.app-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.app-submit-btn:active {
    transform: translateY(1px);
}

.app-submit-btn .btn-icon {
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.app-submit-btn:hover .btn-icon {
    transform: translateX(-4px);
}

/* -------------------------------------------------------------
 * 7. Tab 2: Stats & Orders History List
 * ------------------------------------------------------------- */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.stat-value {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Search bar styling */
.app-search-box {
    position: relative;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 13px;
}

.app-search-box input {
    width: 100%;
    padding: 10px 38px 10px 14px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s ease;
}

.app-search-box input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
}

/* Orders List Wrapper */
.orders-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Empty list state */
.empty-list-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 34px;
    color: var(--text-muted);
    margin-bottom: 12px;
    opacity: 0.7;
}

.empty-list-state h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.empty-list-state p {
    font-size: 10px;
    margin-top: 4px;
}

/* Order Item Card UI */
.order-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.3s ease forwards;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-customer {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.order-date {
    font-size: 9px;
    color: var(--text-muted);
}

.order-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    background: rgba(148, 163, 184, 0.04);
    padding: 8px 12px;
    border-radius: 8px;
}

.order-info-item {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.order-info-item strong {
    color: var(--text-primary);
    font-weight: 700;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.order-tag {
    background: var(--success-bg);
    color: var(--success-color);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-delete-order {
    background: var(--danger-bg);
    color: var(--danger-color);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}

.btn-delete-order:hover {
    background: var(--danger-color);
    color: #ffffff;
    transform: scale(1.08);
}

.btn-delete-order:active {
    transform: scale(0.92);
}

/* -------------------------------------------------------------
 * 8. Tab 3: About & Info Section
 * ------------------------------------------------------------- */
.info-content-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px 18px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.app-info-logo {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: var(--accent-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-size: 24px;
    margin: 0 auto 14px;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.25);
}

.info-content-card h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.app-version {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.info-divider {
    margin: 18px 0;
    border: 0;
    border-top: 1px solid var(--card-border);
}

.info-item {
    display: flex;
    gap: 12px;
    text-align: right;
    margin-bottom: 16px;
}

.info-icon {
    font-size: 16px;
    color: var(--primary-color);
    margin-top: 3px;
}

.info-text h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-text p {
    font-size: 10.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 3px;
}

.btn-clear-data {
    margin-top: 16px;
    width: 100%;
    padding: 10px 16px;
    background: var(--danger-bg);
    color: var(--danger-color);
    border: 1px dashed var(--danger-color);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
}

.btn-clear-data:hover {
    background: var(--danger-color);
    color: #ffffff;
    border-style: solid;
}

/* -------------------------------------------------------------
 * 9. Premium Fullscreen Success Modal Overlay
 * ------------------------------------------------------------- */
.success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 13, 22, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.success-overlay.active {
    display: flex;
}

.success-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px 20px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.success-card h2 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 14px;
}

.success-card p {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.success-details {
    background: rgba(148, 163, 184, 0.05);
    border: 1px dashed var(--card-border);
    border-radius: 12px;
    padding: 12px;
    margin: 16px 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 700;
}

.btn-success-close {
    width: 100%;
    padding: 11px;
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
    transition: all 0.2s;
}

.btn-success-close:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.3);
}

.btn-success-close:active {
    transform: scale(0.98);
}

/* Success Checkmark Circle SVG/Pure CSS Animation */
.success-checkmark {
    width: 68px;
    height: 68px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 68px;
    height: 68px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid var(--success-bg);
}

.success-checkmark .check-icon::before, 
.success-checkmark .check-icon::after {
    content: '';
    height: 100px;
    position: absolute;
    background: var(--card-bg);
    transform: rotate(-45deg);
}

.success-checkmark .check-icon::before {
    border-radius: 100px 0 0 100px;
    width: 30px;
    top: -2px;
    left: -9px;
    transform-origin: 100% 50%;
    transform: rotate(-45deg);
}

.success-checkmark .check-icon::after {
    border-radius: 0 100px 100px 0;
    width: 60px;
    top: -11px;
    left: 30px;
    transform-origin: 0 50%;
    transform: rotate(-45deg);
}

.success-checkmark .check-icon .icon-circle {
    top: -4px;
    left: -4px;
    position: absolute;
    box-sizing: content-box;
    width: 68px;
    height: 68px;
    border: 4px solid var(--success-color);
    border-radius: 50%;
    z-index: 2;
}

.success-checkmark .check-icon .icon-fix {
    top: 8px;
    left: 28px;
    width: 5px;
    height: 48px;
    position: absolute;
    z-index: 1;
    transform: rotate(-45deg);
}

.success-checkmark .check-icon .icon-line {
    height: 5px;
    background-color: var(--success-color);
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.success-checkmark .check-icon .icon-line.line-tip {
    width: 17px;
    left: 12px;
    top: 36px;
    transform: rotate(45deg);
}

.success-checkmark .check-icon .icon-line.line-long {
    width: 32px;
    right: 6px;
    top: 30px;
    transform: rotate(-45deg);
}

/* -------------------------------------------------------------
 * 10. Responsive Adaptability & Mobile Shell Removal
 * ------------------------------------------------------------- */
@media (max-width: 480px) {
    body {
        background: var(--app-bg);
        align-items: stretch;
    }
    
    .app-wrapper {
        padding: 0;
        min-height: 100vh;
    }
    
    .bg-shape {
        display: none;
    }
    
    .mobile-device {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    
    .device-header-elements {
        display: none;
    }
    
    .status-bar {
        padding: 10px 16px 0;
    }
    
    .app-header {
        padding: 12px 16px;
    }
    
    .app-content {
        padding: 12px 16px 84px;
    }
    
    .home-indicator {
        bottom: 4px;
    }
}

/* -------------------------------------------------------------
 * Autocomplete Dropdown - Customer Name Field
 * ------------------------------------------------------------- */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    background: var(--card-bg);
    border: 1.5px solid var(--input-focus);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.18), 0 2px 8px rgba(0,0,0,0.08);
    z-index: 9999;
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
    animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.autocomplete-dropdown::-webkit-scrollbar {
    width: 4px;
}
.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,0.3);
    border-radius: 4px;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--card-border);
    transition: background 0.15s ease;
}

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

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: rgba(99, 102, 241, 0.08);
}

.autocomplete-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    flex-shrink: 0;
}

.autocomplete-item-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    overflow: hidden;
}

.autocomplete-item-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item-name mark {
    background: transparent;
    color: var(--primary-color);
    font-weight: 800;
}

.autocomplete-item-phone {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    direction: ltr;
    text-align: right;
}

.autocomplete-no-result {
    padding: 14px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.autocomplete-loading {
    padding: 12px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.autocomplete-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(99,102,241,0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* -------------------------------------------------------------
 * 12. Multiple Materials Styling
 * ------------------------------------------------------------- */
.materials-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.material-item-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.material-item-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-md);
}

.material-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--card-border);
    padding-bottom: 8px;
}

.material-card-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-remove-material {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-material:hover {
    background: var(--danger-bg);
}

.btn-secondary-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: rgba(99, 102, 241, 0.06);
    border: 1.5px dashed var(--primary-color);
    border-radius: 12px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.btn-secondary-action:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.btn-secondary-action:active {
    transform: translateY(1px);
}

/* -------------------------------------------------------------
 * 13. Responsive iPad & Tablet Layout System
 * ------------------------------------------------------------- */

/* Mobile Phones (screen width <= 767px): Native Full-screen 1 Column layout */
@media (max-width: 767px) {
    .app-wrapper {
        padding: 0;
    }
    
    .mobile-device {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    
    .device-header-elements {
        display: none !important;
    }
    
    .materials-container {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    .orders-list-wrapper {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* iPad, Tablets & Larger Screens (screen width >= 768px): Unconfined container & Side-by-Side Materials Grid */
@media (min-width: 768px) {
    .app-wrapper {
        padding: 24px 16px;
        align-items: flex-start;
    }
    
    .mobile-device {
        width: 100%;
        max-width: 980px;
        height: auto;
        min-height: 840px;
        border: 1px solid var(--card-border);
        border-radius: 24px;
        box-shadow: var(--shadow-lg);
    }
    
    /* Hide phone mockup camera notch and status bar on iPad/Desktop */
    .device-header-elements,
    .status-bar,
    .home-indicator {
        display: none !important;
    }
    
    .app-header {
        padding: 18px 28px;
        border-radius: 23px 23px 0 0;
    }
    
    .app-content {
        padding: 24px 28px 100px;
    }
    
    /* Materials Grid: Side-by-Side (2 columns) on iPad */
    .materials-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
        margin-bottom: 20px;
    }
    
    /* Orders History Grid on iPad */
    .orders-list-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    
    /* Stats Panel Expansion on iPad */
    .stats-panel {
        gap: 14px;
        margin-bottom: 24px;
    }
    
    .stat-card {
        padding: 14px 10px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    /* Bottom Navigation Bar for iPad */
    .app-nav {
        padding: 10px 28px;
        border-radius: 0 0 23px 23px;
        justify-content: center;
        gap: 40px;
    }
    
    .nav-item {
        max-width: 160px;
    }
}

/* Large iPad Pro & Desktop Viewports (screen width >= 1100px) */
@media (min-width: 1100px) {
    .mobile-device {
        max-width: 1140px;
    }
    
    .materials-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .orders-list-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}
