/* ===== GENERAL STYLES ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 8px;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.4;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 2px;
    color: #2980b9;
}

h2 {
    font-size: 1.2rem;
    margin-top: 0;
    color: #34495e;
}

h3 {
    font-size: 1rem;
    text-align: left;
    margin: 12px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

/* ===== LAYOUT COMPONENTS ===== */
.container {
    max-width: 700px;
    margin: 0 auto 12px;
    background: #fff;
    padding: 12px 10px;
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.header-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* ===== FORM STYLES ===== */
form {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 2px;
}

input, select, textarea, button {
    padding: 7px 8px;
    font-size: 0.95rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkbox-group {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 4px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

/* ===== BUTTON STYLES ===== */
.btn {
    display: inline-block;
    padding: 7px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #219653;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #7f8c8d;
    color: white;
}

.btn-secondary:hover {
    background-color: #636e72;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background-color: #1da851;
}

.btn-group {
    display: flex;
    gap: 7px;
    margin: 7px 0;
}

.btn-report {
    background: linear-gradient(90deg, #0072ff 0%, #00c6ff 100%);
    color: #fff !important;
    border: none;
    border-radius: 25px;
    padding: 10px 28px;
    font-weight: 700;
    font-size: 1.08rem;
    box-shadow: 0 2px 10px rgba(0,114,255,0.10);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    text-decoration: none;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.btn-report:hover, .btn-report:focus {
    background: linear-gradient(90deg, #005fa3 0%, #00a6c3 100%);
    color: #fff !important;
    box-shadow: 0 4px 18px rgba(0,114,255,0.18);
    transform: translateY(-2px) scale(1.04);
    text-decoration: none;
}

.btn-billing {
    background: linear-gradient(90deg, #27ae60 0%, #6dd5ed 100%);
    color: #fff !important;
    border: none;
    border-radius: 25px;
    padding: 10px 28px;
    font-weight: 700;
    font-size: 1.08rem;
    box-shadow: 0 2px 10px rgba(39,174,96,0.10);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    text-decoration: none;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.btn-billing:hover, .btn-billing:focus {
    background: linear-gradient(90deg, #219653 0%, #43cea2 100%);
    color: #fff !important;
    box-shadow: 0 4px 18px rgba(39,174,96,0.18);
    transform: translateY(-2px) scale(1.04);
    text-decoration: none;
}

.btn-orders {
    background: linear-gradient(90deg, #636363 0%, #a2ab58 100%);
    color: #fff !important;
    border: none;
    border-radius: 25px;
    padding: 10px 28px;
    font-weight: 700;
    font-size: 1.08rem;
    box-shadow: 0 2px 10px rgba(99,99,99,0.10);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    text-decoration: none;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.btn-orders:hover, .btn-orders:focus {
    background: linear-gradient(90deg, #434343 0%, #8d9a3d 100%);
    color: #fff !important;
    box-shadow: 0 4px 18px rgba(99,99,99,0.18);
    transform: translateY(-2px) scale(1.04);
    text-decoration: none;
}

/* ===== TABLE STYLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

th, td {
    padding: 6px 7px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

th {
    background-color: #f4f6f9;
    font-weight: 500;
    color: #2c3e50;
}

tr:nth-child(even) {
    background-color: #f4f6f9;
}

tr:hover {
    background-color: #e0f0fa;
}

/* ===== ENHANCED COLLAPSIBLE STYLES ===== */
.collapsible {
    cursor: pointer;
    padding: 12px 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.collapsible:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2573a7 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.collapsible.active {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
    border-radius: 8px 8px 0 0;
}

.collapsible-indicator {
    transition: transform 0.3s ease;
}

.collapsible.active .collapsible-indicator {
    transform: rotate(180deg);
}

.collapsible-content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.3s ease;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
    margin-top: -10px;
    margin-bottom: 15px;
}

.collapsible-content.active {
    padding: 15px;
    max-height: 2000px; /* Increased to accommodate larger forms */
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-top: none;
}

/* Smooth transition for form elements */
.collapsible-content .form-group {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.collapsible-content.active .form-group {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for form elements */
.collapsible-content .form-group:nth-child(1) { transition-delay: 0.1s; }
.collapsible-content .form-group:nth-child(2) { transition-delay: 0.15s; }
.collapsible-content .form-group:nth-child(3) { transition-delay: 0.2s; }
.collapsible-content .form-group:nth-child(4) { transition-delay: 0.25s; }
.collapsible-content .form-group:nth-child(5) { transition-delay: 0.3s; }
.collapsible-content .form-group:nth-child(6) { transition-delay: 0.35s; }
.collapsible-content .form-group:nth-child(7) { transition-delay: 0.4s; }

@media (max-width: 600px) {
    .collapsible-content {
        padding: 0 2px;
    }
    .collapsible.active + .collapsible-content {
        padding: 6px;
    }
}

/* ===== IMAGE PREVIEWS ===== */
.photo-preview {
    max-width: 120px;
    height: auto;
    margin-top: 5px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
}

/* ===== SUMMARY & TOTALS ===== */
.summary-section {
    margin: 12px 0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 7px;
    margin: 10px 0;
}

.summary-card {
    background: #f8f9fa;
    padding: 7px;
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.summary-card h4 {
    margin-bottom: 4px;
    color: #7f8c8d;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.summary-card .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-progress {
    background-color: #ffeaa7;
    color: #d35400;
}

.status-ready {
    background-color: #81ecec;
    color: #00b894;
}

.status-delivered {
    background-color: #55efc4;
    color: #00b894;
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.message {
    padding: 7px;
    border-radius: 4px;
    margin: 7px 0;
    text-align: center;
    font-weight: 500;
}

.message-info {
    background-color: #d6eaf8;
    color: #2874a6;
}

.message-warning {
    background-color: #fdebd0;
    color: #d35400;
}

.message-success {
    background-color: #d5f5e3;
    color: #27ae60;
}

.message-error {
    background-color: #fadbd8;
    color: #c0392b;
}

.sleeve-indicator {
    font-weight: 600;
    color: #3498db;
    margin-left: 8px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        padding: 7px;
    }
    .btn-group {
        flex-direction: column;
    }
    .header-actions {
        flex-direction: column;
        align-items: center;
    }
    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }
    table {
        font-size: 0.85rem;
    }
    th, td {
        padding: 5px 6px;
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    .checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ===== LOGIN STYLES ===== */
.login-btn {
    position: absolute;
    top: 18px;
    right: 24px;
    background: #2980b9;
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 7px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}
.login-btn:hover { background: #1c5d8c; }
.login-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    align-items: center; justify-content: center;
}
.login-modal.active { display: flex; }
.login-box {
    background: #fff;
    border-radius: 8px;
    padding: 28px 24px;
    width: 320px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
}
.login-box h3 { 
    margin-bottom: 18px; 
    text-align: center;
    color: #2c3e50;
}
.login-box label { 
    font-weight: 500; 
    margin-bottom: 5px;
    display: block;
}
.login-box input[type="text"], 
.login-box input[type="password"] {
    width: 100%; 
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.login-error { 
    color: #e74c3c; 
    margin-bottom: 10px; 
    text-align: center; 
    padding: 8px;
    background: #fadbd8;
    border-radius: 4px;
}
.login-success { 
    color: #27ae60; 
    margin-bottom: 10px; 
    text-align: center; 
    padding: 8px;
    background: #d5f5e3;
    border-radius: 4px;
}
.password-container {
    position: relative;
}
.toggle-password {
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
    color: #7f8c8d;
}
.logout-link {
    position: absolute;
    top: 18px;
    right: 24px;
    color: #e74c3c;
    font-weight: 600;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e74c3c;
    border-radius: 18px;
    padding: 7px 18px;
    transition: background 0.2s, color 0.2s;
}
.logout-link:hover {
    background: #e74c3c;
    color: #fff;
}
.login-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #7f8c8d;
}
.login-footer a {
    color: #3498db;
    text-decoration: none;
}
.login-footer a:hover {
    text-decoration: underline;
}