/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f0eb;
    color: #333;
    padding: 10px;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
}

/* HEADER */
.header {
    background: linear-gradient(135deg, #8B0000, #cc0033);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
    margin-bottom: 10px;
    background: white;
    padding: 5px;
}

.header h1 {
    font-size: 28px;
    letter-spacing: 2px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

/* TABS */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    background: white;
    padding: 5px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 10px 5px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.tab-btn.active {
    background: #8B0000;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #f0e6e0;
}

/* TAB CONTENT */
.tab-content {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

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

.tab-content h2 {
    color: #8B0000;
    margin-bottom: 15px;
    font-size: 20px;
}

.tab-content h3 {
    color: #8B0000;
    margin: 20px 0 10px 0;
    font-size: 16px;
    border-bottom: 2px solid #8B0000;
    padding-bottom: 5px;
}

/* FORM */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #555;
    margin-bottom: 3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0d6d0;
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.3s;
    background: #faf8f7;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #8B0000;
    outline: none;
    background: white;
}

.form-group input[type="number"] {
    width: 100%;
}

.measure-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.measure-grid .form-group {
    margin-bottom: 8px;
}

.measure-grid .form-group label {
    font-size: 12px;
}

.measure-grid .form-group input {
    padding: 8px 10px;
    font-size: 13px;
}

/* BUTTONS */
.btn-save {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #8B0000, #cc0033);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.btn-save:active {
    transform: scale(0.97);
}

.btn-sync {
    width: 100%;
    padding: 12px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: transform 0.2s;
}

.btn-sync:active {
    transform: scale(0.97);
}

.btn-small {
    padding: 5px 12px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-small:active {
    transform: scale(0.95);
}

/* SEARCH */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0d6d0;
    border-radius: 8px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 20px;
    background: #8B0000;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* RESULTS & LISTS */
#searchResults,
#customerList {
    margin-top: 10px;
}

.customer-card {
    background: #faf8f7;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #8B0000;
    transition: all 0.3s;
}

/* Pickup status styles */
.customer-card.overdue {
    border-left: 4px solid #dc3545;
    background: #fff5f5;
}

.customer-card.today {
    border-left: 4px solid #ffc107;
    background: #fffbf0;
}

.customer-card.soon {
    border-left: 4px solid #fd7e14;
    background: #fff8f0;
}

.customer-card.ok {
    border-left: 4px solid #28a745;
}

.customer-card.none {
    border-left: 4px solid #6c757d;
}

.status-overdue {
    color: #dc3545;
    font-weight: bold;
}

.status-today {
    color: #ffc107;
    font-weight: bold;
}

.status-soon {
    color: #fd7e14;
    font-weight: bold;
}

.status-ok {
    color: #28a745;
}

.status-none {
    color: #6c757d;
}

.customer-card h4 {
    color: #8B0000;
    font-size: 16px;
}

.customer-card p {
    font-size: 13px;
    color: #666;
    margin: 3px 0;
}

.customer-card .measurements {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3px;
    margin-top: 8px;
    font-size: 12px;
    background: white;
    padding: 8px;
    border-radius: 6px;
}

.customer-card .measurements span {
    background: #f0e6e0;
    padding: 2px 6px;
    border-radius: 4px;
    text-align: center;
}

.customer-card .notes {
    margin-top: 6px;
    font-style: italic;
    color: #888;
    font-size: 13px;
}

.customer-card .delete-btn {
    margin-top: 8px;
    padding: 5px 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
}

/* SYNC STATUS */
#syncStatus {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.sync-success {
    background: #d4edda;
    color: #155724;
}

.sync-error {
    background: #f8d7da;
    color: #721c24;
}

/* FOOTER */
.footer {
    text-align: center;
    padding: 15px;
    font-size: 12px;
    color: #999;
    margin-top: 15px;
}

/* RESPONSIVE */
@media (max-width: 400px) {
    .measure-grid {
        grid-template-columns: 1fr;
    }
    .tabs {
        flex-wrap: wrap;
    }
    .tab-btn {
        font-size: 12px;
        padding: 8px 4px;
    }
    .customer-card .measurements {
        grid-template-columns: 1fr 1fr;
    }
}