:root {
    --primary: #17a2b8;
    --primary-gradient-1: #00c6ff; /* New Gradient Color 1 */
    --primary-gradient-2: #00a4d4; /* New Gradient Color 2 */
    --primary-gradient-3: #007bff; /* New Gradient Color 3 */
    --primary-light: #d4f8ff;
    --secondary: #138496;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #007bff;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --white: #ffffff;
    --shadow-sm: 0 0.15rem 0.35rem rgba(0,0,0,0.1);
    --shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    --rounded-sm: 0.35rem;
    --rounded: 0.75rem;
    --rounded-lg: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #f0f2f5;
    color: #212529;
    line-height: 1.5;
    touch-action: manipulation;
    font-size: 16px; /* Base font size for better mobile readability */
}

body.modal-open {
    overflow: hidden;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 12px;
}

/* Header Styles - IMPROVED */
.app-header {
    background: linear-gradient(135deg, var(--primary-gradient-1), var(--primary-gradient-2), var(--primary-gradient-3)); /* 3-color gradient */
    color: var(--white);
    padding: 12px 16px;
    border-radius: var(--rounded);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap; /* Responsive header */
    gap: 10px;
}

.header-title-container { display: flex; align-items: center; gap: 15px; }
.header-logo {
    width: 50px; height: 50px; border-radius: 50%; background-color: var(--white);
    padding: 5px; box-shadow: var(--shadow-sm); display: flex; align-items: center;
    justify-content: center; font-size: 1.8rem; color: var(--primary-gradient-2);
}
.app-title { font-size: 1.3rem; font-weight: 600; }
.header-info { text-align: right; font-size: 0.85rem; }
.header-info p { margin: 2px 0; }
.header-info a { color: var(--white); text-decoration: none; font-weight: 500;}
.header-info a:hover { text-decoration: underline; }

#realTimeClock { font-weight: 500; font-size: 0.9rem; opacity: 0.9; }

.dev-info {
    font-size: 0.75rem;
    margin-top: 4px;
    opacity: 0.9;
}

#shiftStatusContainer {
    background-color: rgba(255,255,255,0.2); padding: 5px 8px; border-radius: 20px;
    margin-top: 5px; display: flex; align-items: center; gap: 8px; font-size: 0.8rem;
}
#shiftStatusBadge.active { color: #aeffae; }
#shiftActionBtn { padding: 3px 8px; font-size: 0.75rem; width: auto !important; border-radius: 15px; }

/* Main Content Layout */
.app-content { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--white); border-radius: var(--rounded); padding: 16px; box-shadow: var(--shadow-sm); }
.panel-title {
    font-size: 1.2rem; margin-bottom: 12px; color: var(--dark);
    font-weight: 600; display: flex; align-items: center; justify-content: space-between;
}

/* Service Grid */
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.service-card {
    background: var(--white); border-radius: var(--rounded-sm); padding: 12px;
    box-shadow: var(--shadow-sm); transition: all 0.2s; border: 1px solid #eee;
    cursor: pointer; position: relative; display: flex; flex-direction: column;
    align-items: center; text-align: center;
}
.service-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary-gradient-2); }
.service-icon { font-size: 2.5rem; color: var(--primary-gradient-2); margin-bottom: 8px; }
.service-name { font-weight: 600; margin-bottom: 4px; font-size: 0.95rem; }
.service-price { color: var(--dark); font-weight: 500; }
.service-duration { font-size: 0.8rem; color: var(--gray); }

/* Order Form */
#newOrderForm .form-group { margin-bottom: 12px; }
.order-item-list { max-height: 250px; overflow-y: auto; padding-right: 5px; }
.order-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px; border: 1px solid #eee; border-radius: var(--rounded-sm); margin-bottom: 8px;
}
.order-item-details { flex-grow: 1; }
.order-item-name { font-weight: 500; }
.order-item-input { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.order-item-input .qty-input { width: 70px; padding: 6px; border: 1px solid #ddd; border-radius: 4px; }
.order-item-input .unit-label { font-weight: 500; }

/* Summary & Button Styles */
.summary-container { margin-top: 16px; padding-top: 16px; border-top: 1px dashed #ddd; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.total-row {
    font-weight: 600; font-size: 1.1rem; color: var(--primary-gradient-2);
    margin-top: 12px; padding-top: 12px; border-top: 1px solid #ddd;
}
.btn {
    display: inline-block; padding: 12px 20px; background-color: var(--primary-gradient-2); color: var(--white);
    border: none; border-radius: var(--rounded-sm); cursor: pointer; font-size: 1rem;
    font-weight: 500; text-align: center; transition: all 0.2s; width: 100%;
}
.btn:disabled { background-color: var(--gray); cursor: not-allowed; opacity: 0.7; }
.btn:hover:not(:disabled) { background-color: var(--secondary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn .fa-spinner { margin-right: 8px; }
.btn-sm { padding: 8px 12px; font-size: 0.9rem; }
.btn-success { background-color: var(--success); } .btn-success:hover { background-color: #218838; }
.btn-danger { background-color: var(--danger); } .btn-danger:hover { background-color: #c82333; }
.btn-warning { background-color: var(--warning); color: #000; } .btn-warning:hover { background-color: #e0a800; }
.btn-info { background-color: var(--info); } .btn-info:hover { background-color: #0056b3; }

/* Tab Styles */
.main-tabs { display: flex; border-bottom: 1px solid #ddd; margin-bottom: 16px; background: var(--white); border-radius: var(--rounded) var(--rounded) 0 0; padding: 0 10px; box-shadow: var(--shadow-sm); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.main-tab { padding: 14px 16px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; text-align: center; font-weight: 500; color: var(--gray); flex-shrink: 0; }
.main-tab.active { border-bottom: 3px solid var(--primary-gradient-2); color: var(--primary-gradient-2); font-weight: 600; }
.main-tab-content { display: none; } .main-tab-content.active { display: block; animation: fadeIn 0.4s; }
.modal .tabs { display: flex; border-bottom: 1px solid #ddd; }
.modal .tab { padding: 12px 16px; cursor: pointer; border-bottom: 3px solid transparent; flex: 1; text-align: center; }
.modal .tab.active { border-bottom: 3px solid var(--primary-gradient-2); color: var(--primary-gradient-2); font-weight: 600; }
.modal .tab-content { display: none; padding-top: 16px; } .modal .tab-content.active { display: block; }

/* Modal Styles */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); z-index: 1000; justify-content: center;
    align-items: center; padding: 20px;
}
.modal-content {
    background-color: var(--white); border-radius: var(--rounded-lg); width: 100%;
    max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
    display: flex; flex-direction: column;
}
.modal-header { padding: 16px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 1.2rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray); }
.modal-body { padding: 16px; overflow-y: auto; flex-grow: 1; }
.modal-footer { padding: 16px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Form & Login Styles */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-control { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: var(--rounded-sm); font-size: 1rem; }
.form-control[readonly] { background-color: #e9ecef; opacity: 1; cursor: not-allowed; user-select: none; }
.form-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.form-check-input { width: auto; }
textarea.form-control { min-height: 80px; resize: vertical; }
.d-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#loginModal { background: linear-gradient(45deg, #f0f2f5, #e6e9ed); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-container {
    width: 100%; max-width: 400px; margin: 0; background: var(--white);
    border-radius: var(--rounded-lg); padding: 32px; box-shadow: var(--shadow);
    border-top: 5px solid var(--primary-gradient-2); animation: fadeIn 0.4s;
}
.login-header { text-align: center; margin-bottom: 24px; }
.login-logo { font-size: 3.5rem; color: var(--primary-gradient-2); margin-bottom: 12px; line-height: 1; }
.login-title { font-size: 2rem; color: var(--dark); font-weight: 700; }
.login-header p { color: var(--gray); }
.captcha-container { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
#captchaText { 
    background: #e9ecef; padding: 12px; border-radius: var(--rounded-sm); font-weight: 600;
    letter-spacing: 4px; text-decoration: line-through; color: var(--dark); flex-grow: 1; text-align: center;
}
#refreshCaptcha { cursor: pointer; color: var(--primary-gradient-2); font-size: 1.5rem; }

/* Toast & Empty State */
.toast {
    position: fixed; top: 20px; right: 20px; padding: 12px 16px; background-color: var(--dark);
    color: var(--white); border-radius: var(--rounded-sm); box-shadow: var(--shadow);
    z-index: 1100; display: flex; align-items: center; transform: translateX(200%); transition: transform 0.3s;
}
.toast.show { transform: translateX(0); }
.toast.success { background-color: var(--success); } .toast.error { background-color: var(--danger); }
.toast i { margin-right: 8px; }
.empty-state { text-align: center; padding: 24px; color: var(--gray); }
.empty-state i { font-size: 3rem; color: #ddd; margin-bottom: 12px; }

/* Admin & Data Table */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.search-container { position: relative; margin-bottom: 16px; }
.search-container i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gray); }
.search-input { width: 100%; padding: 12px 16px 12px 40px; border: 1px solid #ddd; border-radius: var(--rounded-sm); font-size: 1rem; }
.data-table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 600px; }
.data-table th, .data-table td { padding: 10px; text-align: left; border-bottom: 1px solid #eee; }
.data-table th { background-color: var(--light); font-weight: 600; }
.data-table .action-buttons { display: flex; gap: 8px; }
.data-table .whatsapp-link { color: var(--success); text-decoration: none; font-weight: 500; }
.data-table .whatsapp-link:hover { text-decoration: underline; }

/* Order Management */
.order-management-container { max-height: 70vh; overflow-y: auto; }
.order-card {
    background: #fff; border-left: 5px solid var(--primary-gradient-2); border-radius: var(--rounded-sm);
    padding: 12px; box-shadow: var(--shadow-sm); margin-bottom: 12px;
}
.order-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.order-customer-name { font-weight: 600; font-size: 1.1rem; }
.order-id { font-size: 0.8rem; font-weight: 500; color: var(--gray); }
.order-card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 0.9rem; }
.order-status-badge {
    padding: 4px 8px; border-radius: 20px; font-size: 0.8rem; font-weight: 500;
    color: white; cursor: pointer; text-transform: capitalize;
}
.status-antrian { background-color: var(--gray); }
.status-proses-cuci, .status-proses-kering, .status-proses-setrika { background-color: var(--warning); color: #000; }
.status-siap-diambil { background-color: var(--info); }
.status-selesai { background-color: var(--success); }
.status-diambil { background-color: var(--dark); }
.payment-status-badge { padding: 2px 6px; border-radius: 10px; font-size: 0.7rem; font-weight: 500; text-transform: capitalize; }
.status-lunas { background-color: var(--success); color: white; }
.status-belum-lunas { background-color: var(--danger); color: white; }
.order-card-footer { margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.filter-container { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

/* Receipt (Nota) Styles - REFINED */
#receiptContent {
    font-family: 'Courier New', Courier, monospace;
    width: 100%;
    max-width: 80mm; /* Standard thermal printer width */
    margin: 0 auto;
    padding: 10px;
    font-size: 11px;
    line-height: 1.4;
    color: #000;
    background: white;
}
.receipt-header, .receipt-footer { text-align: center; }
.receipt-header .receipt-title { font-size: 14px; font-weight: bold; margin-bottom: 4px; }
.receipt-info { margin: 8px 0; border-top: 1px dashed #000; border-bottom: 1px dashed #000; padding: 5px 0; }
.receipt-info .info-row { display: grid; grid-template-columns: 80px 1fr; margin-bottom: 2px; }
#receiptItemsContainer { padding: 8px 0; border-bottom: 1px dashed #000; }
.receipt-item { margin-bottom: 4px; }
.receipt-item .item-name { font-weight: bold; }
.receipt-item .item-details { display: grid; grid-template-columns: 1fr auto; }
.receipt-total { font-weight: bold; margin-top: 8px; padding-top: 8px; }
.receipt-total .total-row-item { display: grid; grid-template-columns: 1fr auto; font-size: 12px; }
.payment-status-nota {
    border: 1px solid #000; padding: 4px; margin: 8px 0; text-align: center;
    font-weight: bold; font-size: 14px;
}
.receipt-terms { font-size: 9px; text-align: center; margin-top: 10px; }

/* Quick Action Button (FAB) - NEW */
.quick-action-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}
.quick-action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-gradient-1), var(--primary-gradient-3));
    color: white;
    border: none;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}
.quick-action-btn.active { transform: rotate(45deg); }
.quick-action-options {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease-in-out;
}
.quick-action-options.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.quick-action-options .option {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
    cursor: pointer;
}
.quick-action-options .option .label {
    background-color: white;
    padding: 5px 10px;
    border-radius: var(--rounded-sm);
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}
.quick-action-options .option .icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--white);
    color: var(--primary-gradient-2);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Smart Payment Buttons - NEW */
.smart-payment-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.smart-payment-btn {
    flex-grow: 1;
    background-color: var(--light);
    color: var(--dark);
    border: 1px solid #ddd;
}

/* Welcome Splash Screen */
#welcomeSplashModal .modal-content {
    max-width: 550px;
    border-radius: var(--rounded-lg);
    border-top: 7px solid var(--primary-gradient-1);
    background: linear-gradient(160deg, #ffffff, #f0f8ff);
    animation: slideInUp 0.5s ease-out;
}
.splash-header { text-align: center; padding: 20px 20px 10px; }
.splash-icon {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 15px;
    background: -webkit-linear-gradient(135deg, var(--primary-gradient-1), var(--primary-gradient-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.splash-title { font-size: 1.8rem; font-weight: 700; color: var(--dark); }
.splash-body { padding: 0 25px 20px; text-align: center; color: var(--gray); font-size: 1rem; }
.splash-body .app-description { margin: 15px 0; }
.splash-footer { 
    padding: 15px; background-color: rgba(0,0,0,0.03); 
    border-top: 1px solid #eee; text-align: center; font-size: 0.85rem; color: var(--gray);
}
.splash-footer a { color: var(--primary-gradient-2); text-decoration: none; font-weight: 600; }

@media (min-width: 992px) { .app-layout { display: grid; grid-template-columns: 1fr 380px; gap: 16px; } }
@media (max-width: 600px) {
    .app-header { flex-direction: column; align-items: flex-start; }
    .header-info { text-align: left; margin-top: 10px; }
    .main-tab { padding: 12px 10px; font-size: 0.9rem; }
    .d-grid-2 { grid-template-columns: 1fr; }
    .modal-footer { justify-content: center; }
}
@media print {
    body, .modal { background: #fff !important; }
    body * { visibility: hidden; }
    #print-container, #print-container * { visibility: visible; }
    #print-container {
        position: absolute; left: 0; top: 0; width: 100%;
        display: flex; justify-content: center;
    }
    .no-print { display: none !important; }
    @page { size: auto; margin: 5mm; }
}

/* Animations & Footer */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.d-none { display: none; }
.app-footer { text-align: center; margin-top: 20px; padding: 10px; color: var(--gray); font-size: 0.8rem; }
