/* =====================================================
   MODERN DESIGN - TEKNISI APP (FIXED SPACING)
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Poppins', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: #f0f2f5;
    height: 100vh;
    overflow: hidden;
}

/* =====================================================
   HEADER MODERN (DENGAN SPACING YANG CUKUP)
   ===================================================== */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 16px 25px 16px;  /* Tambah padding bawah */
    padding-top: env(safe-area-inset-top, 25px);
    border-radius: 0 0 30px 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 0;
}

.technician-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;  /* Jarak ke status bar */
}

.technician-avatar {
    width: 55px;
    height: 55px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.technician-details h5 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.technician-details small {
    font-size: 12px;
    opacity: 0.85;
}

.status-bars {
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.2);
    border-radius: 30px;
    padding: 10px 15px;
    margin-top: 5px;
}

.status-item {
    text-align: center;
    flex: 1;
}

.status-item i {
    font-size: 14px;
    margin-right: 6px;
}

.status-item span {
    font-size: 11px;
    font-weight: 500;
}

/* =====================================================
   STATS CARDS (POSISI TEPAT DI BAWAH HEADER)
   ===================================================== */
.stats-container {
    display: flex;
    gap: 12px;
    margin: -15px 16px 20px 16px;  /* Naik sedikit ke atas header */
    position: relative;
    z-index: 5;
}

.stat-card {
    flex: 1;
    background: white;
    border-radius: 18px;
    padding: 14px 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.stat-icon.blue { color: #667eea; }
.stat-icon.green { color: #48bb78; }
.stat-icon.orange { color: #ed8936; }

.stat-value {
    font-size: 22px;
    font-weight: bold;
    color: #2d3748;
}

.stat-label {
    font-size: 11px;
    color: #718096;
    font-weight: 500;
}

/* =====================================================
   SECTION TITLE
   ===================================================== */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 16px;
    margin-bottom: 10px;
}

.section-title h6 {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.section-title small {
    font-size: 11px;
    color: #667eea;
}

/* =====================================================
   TASK CARDS (LEBIH RINGKAS)
   ===================================================== */
.content {
    padding: 0 16px 70px 16px;
    height: calc(100vh - 160px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.task-card {
    background: white;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
}

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

.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
}

.status-badge.baru { background: #e2e8f0; color: #4a5568; }
.status-badge.diambil { background: #fefcbf; color: #975a16; }
.status-badge.dalam_perjalanan { background: #bee3f8; color: #2b6cb0; }
.status-badge.instalasi { background: #e9d8fd; color: #6b46c1; }
.status-badge.selesai_fisik { background: #c6f6d5; color: #276749; }
.status-badge.aktif { background: #c6f6d5; color: #276749; }

.ticket-number {
    font-size: 10px;
    color: #a0aec0;
    font-weight: 500;
}

.task-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.task-address {
    font-size: 11px;
    color: #718096;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.task-price {
    font-size: 11px;
    font-weight: 600;
    color: #667eea;
}

.btn-task {
    background: #667eea;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
}

/* =====================================================
   TASKS PAGE (ACCORDION LEBIH RAPI)
   ===================================================== */
.accordion-item {
    border: none !important;
    margin-bottom: 8px;
    background: transparent !important;
}

.accordion-button {
    background: white !important;
    border-radius: 12px !important;
    padding: 10px 15px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

.accordion-button:not(.collapsed) {
    background: white !important;
    color: #667eea !important;
}

.accordion-body {
    padding: 10px 0 0 0 !important;
}

/* Task list di dalam accordion */
.task-card-small {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    border-left: 3px solid #667eea;
}

/* =====================================================
   HISTORY PAGE
   ===================================================== */
.history-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
    cursor: pointer;
    transition: all 0.2s;
}

.history-card:active {
    transform: scale(0.98);
    background: #f8f9fa;
}

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

.history-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.history-status.aktif {
    background: #c6f6d5;
    color: #276749;
}

.history-status.gagal {
    background: #fed7d7;
    color: #9b2c2c;
}

.history-status.batal {
    background: #e2e8f0;
    color: #4a5568;
}

.history-date {
    font-size: 10px;
    color: #a0aec0;
}

.history-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.history-package {
    font-size: 11px;
    color: #718096;
    margin-bottom: 6px;
}

.history-address {
    font-size: 11px;
    color: #a0aec0;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.history-btn {
    background: transparent;
    border: 1px solid #667eea;
    color: #667eea;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
    width: 100%;
    transition: all 0.2s;
}

.history-btn:active {
    background: #667eea;
    color: white;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 40px;
    color: #cbd5e0;
    margin-bottom: 10px;
}

.empty-state p {
    color: #a0aec0;
    font-size: 13px;
}

/* =====================================================
   BOTTOM NAVIGATION
   ===================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
    border-top: 1px solid #edf2f7;
    z-index: 1000;
}

.nav-item {
    text-align: center;
    color: #a0aec0;
    font-size: 10px;
    cursor: pointer;
    flex: 1;
}

.nav-item.active {
    color: #667eea;
}

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

.nav-item span {
    font-size: 9px;
    font-weight: 500;
}

/* =====================================================
   LOGIN SCREEN
   ===================================================== */
.login-screen {
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 30px 20px;
    width: 100%;
    max-width: 320px;
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo i {
    font-size: 45px;
    color: #667eea;
    background: white;
    padding: 12px;
    border-radius: 50%;
}

.login-box .form-control {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 13px;
}

.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 600;
    color: white;
}

/* =====================================================
   LOADING SPINNER
   ===================================================== */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* =====================================================
   PHOTO GRID (2 KOLOM)
   ===================================================== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 10px 0;
}

.photo-item {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 15px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.photo-item i {
    font-size: 28px;
    margin-bottom: 8px;
    color: #6c757d;
}

.photo-item span {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
}

.photo-item:active {
    transform: scale(0.96);
    background: #e9ecef;
}

.photo-item.has-photo {
    background-size: cover;
    background-position: center;
    border: 2px solid #28a745;
}

.photo-item.has-photo i,
.photo-item.has-photo span {
    display: none;
}

.technician-avatar {
    cursor: pointer;
    transition: transform 0.2s;
}

.technician-avatar:active {
    transform: scale(0.95);
}