:root {
    --primary: #f97316;
    --primary-light: #fdba74;
    --secondary: #6b7280;
    --bg-dark: #fcf9f2;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --border: rgba(249, 115, 22, 0.2);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --glass: rgba(252, 249, 242, 0.85);
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
}

body {
    background: var(--bg-dark);
    background-image: 
        linear-gradient(rgba(252, 249, 242, 0.9), rgba(252, 249, 242, 0.9)),
        url('elegant_tech_background_1776976135531.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #0f172a; /* Biru Gelap / Dark Blue */
    --text-main: #f8fafc; /* Override text color locally for dark background */
    --text-muted: #94a3b8;
    color: var(--text-main);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
}

.brand {
    padding: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.brand h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

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

.glow-icon {
    font-size: 1.5rem;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-light));
}

.nav-menu {
    list-style: none;
    padding: 0.5rem 0;
    flex: 1;
    overflow-y: auto;
}

.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.nav-item {
    padding: 0.3rem 0.6rem;
    margin-bottom: 2px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background: rgba(249, 115, 22, 0.1);
    border-right: 3px solid var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.top-header {
    height: 70px;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    z-index: 90;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(249, 115, 22, 0.1);
    transition: var(--transition);
}

.menu-toggle:hover {
    background: rgba(249, 115, 22, 0.2);
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    width: 300px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding-left: 0.5rem;
    width: 100%;
    outline: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px var(--primary-light);
}

/* Views */
.views-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    position: relative;
    background: transparent;
    display: block;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: block;
}

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

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    position: relative;
    padding-left: 1rem;
}

.page-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 4px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--primary-light);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: rgba(249, 115, 22, 0.4);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.success {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.stat-icon.danger {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.2rem;
}

/* Forms */
.form-container {
    padding: 2rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

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

.section-subtitle {
    margin: 2rem 0 1rem 0;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.btn-primary { 
    background: linear-gradient(135deg, var(--primary), #c2410c); 
    color: #ffffff; 
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}
.btn-primary:hover { 
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.w-100 { width: 100%; justify-content: center; }
.mt-4 { margin-top: 1.5rem; }

/* Dynamic Items */
.item-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    background: rgba(0,0,0,0.03);
    padding: 1rem;
    border-radius: 8px;
}
.item-row input {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    padding: 0.6rem;
    border-radius: 6px;
    color: var(--text-main);
}
.item-desc { flex: 3; }
.item-qty { flex: 1; }
.item-price { flex: 2; }
.item-action {
    color: var(--danger);
    cursor: pointer;
    padding: 0.5rem;
}

/* Tables */
.data-table-container {
    padding: 1rem;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
}

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

.close {
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}
.close:hover {
    color: var(--text-main);
}

/* PDF Template Styling */
.pdf-template {
    background: #fff;
    color: #000;
    padding: 10mm;
    font-family: 'Inter', 'Arial', sans-serif;
    width: 210mm;
    height: 296mm; 
    box-sizing: border-box;
    margin: 0 auto;
    overflow: hidden;
}
.pdf-header h1 {
    color: #000;
    margin: 0;
    font-size: 24px;
}
.pdf-header h2 {
    color: #333;
    margin: 5px 0;
    font-size: 18px;
}
.pdf-header p {
    margin: 2px 0;
    color: #666;
    font-size: 12px;
}
.pdf-meta p {
    margin: 5px 0;
    font-size: 14px;
    color: #000;
}
.pdf-body {
    margin-top: 20px;
}
.pdf-body p {
    color: #000;
}
.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    color: #000;
}
.pdf-table th, .pdf-table td {
    border: 1px solid #ddd;
    padding: 8px;
    font-size: 14px;
    color: #000;
}
.pdf-table th {
    background-color: #f5f5f5;
    text-align: left;
    color: #000;
}
.pdf-footer {
    margin-top: 50px;
}
.pdf-footer p {
    color: #000;
}

/* Utilities */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.actions button {
    margin-left: 0.5rem;
}

/* Responsive Media Queries */
@media screen and (max-width: 1024px) {
    .sidebar {
        width: 240px;
        padding: 1.5rem 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-bar {
        width: 200px;
    }
}

@media screen and (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .top-header {
        padding: 0 1rem;
    }
    
    .search-bar {
        display: none; /* Hide search bar on mobile to save space */
    }
    
    .user-profile span {
        display: none; /* Hide username text on mobile */
    }
    
    .views-container {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .header-actions .btn {
        flex: 1;
        justify-content: center;
        white-space: nowrap;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .item-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .item-row > * {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    .modal-content {
        max-width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .data-table-container {
        padding: 0.5rem;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th, .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media screen and (max-width: 480px) {
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .brand h1 {
        font-size: 1rem;
    }
    
    .page-title {
        font-size: 1.2rem;
    }
}

/* Customer Portal Styles */
.customer-nav {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.customer-bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    z-index: 1000;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}
.cust-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 60px;
}
.cust-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}
.cust-nav-item.active {
    color: var(--primary);
    transform: translateY(-3px);
}
#customer-content, #technician-content {
    padding: 1rem;
    padding-bottom: 80px; /* Space for bottom menu */
}

.product-card {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.product-card .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

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

.btn-float {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(249, 115, 22, 0.4);
    z-index: 998;
    cursor: pointer;
}

.customer-section {
    animation: fadeIn 0.4s ease;
}

.category-pill {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.category-pill.active {
    background: var(--primary);
    color: white;
}

#customer-app, #technician-app {
    font-family: 'Outfit', sans-serif;
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-dark);
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.1);
    position: relative;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.customer-nav {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
}

#customer-content, #technician-content {
    padding: 1.5rem 1.2rem 6rem 1.2rem;
    flex: 1;
}

/* Mobile optimizations for customer/tech view */
@media screen and (max-width: 500px) {
    #customer-app, #technician-app {
        max-width: 100%;
        border: none;
    }
}

.customer-bottom-menu {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    border-bottom: none;
}

.cust-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

.cust-nav-item i {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

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

.cust-nav-item.active i {
    transform: scale(1.2) translateY(-2px);
    filter: drop-shadow(0 0 5px var(--primary-light));
}
/* Tracking Timeline & Progress */
.tracking-timeline {
    position: relative;
    padding-left: 30px;
    margin: 20px 0;
}
.tracking-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    margin-bottom: 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    z-index: 2;
}
.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.timeline-msg {
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.status-pending { background: #fee2e2; color: #ef4444; }
.status-proses { background: #fef3c7; color: #d97706; }
.status-checking { background: #e0f2fe; color: #0284c7; }
.status-selesai { background: #dcfce7; color: #16a34a; }
.status-diambil { background: #f3f4f6; color: #4b5563; }

.tech-task-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.tech-task-card h4 {
    margin-bottom: 0.5rem;
}
