/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: #f0f4e8;
    color: #2d3a2d;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
}

/* === Typography === */
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; margin-bottom: 1.25rem; color: #1b2f1b; }

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.7rem 1.6rem; border: none; border-radius: 10px;
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s; text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #4a7c59; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #3d6b4b; transform: translateY(-1px); }
.btn-secondary { background: #e2e8d8; color: #2d3a2d; }
.btn-secondary:hover { background: #d0d9c4; }
.btn-success { background: #4a7c59; color: #fff; }
.btn-success:hover { background: #3d6b4b; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }

/* === Progress Bar === */
.progress-bar {
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 2.5rem; gap: 0;
}
.progress-step {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    background: #dce3d0; color: #7a8f7a; transition: all 0.3s; flex-shrink: 0;
}
.progress-step.active { background: #4a7c59; color: #fff; }
.progress-step.done { background: #4a7c59; color: #fff; }
.progress-line {
    width: 60px; height: 3px; background: #dce3d0; transition: all 0.3s;
}
.progress-line.active { background: #4a7c59; }

/* === Steps === */
.step { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.step-hint { color: #5a6f5a; margin-bottom: 1rem; font-size: 0.95rem; }

/* === Option Cards (radio) === */
.options { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.option-card {
    display: block; cursor: pointer;
    border: 2px solid #dce3d0; border-radius: 14px;
    padding: 1rem 1.25rem; transition: all 0.2s;
}
.option-card:hover { border-color: #a8c0a0; background: #f5f9f0; }
.option-card.selected { border-color: #4a7c59; background: #edf5e8; }
.option-card input { display: none; }
.option-content { display: flex; align-items: center; gap: 0.75rem; }
.option-icon { font-size: 1.5rem; flex-shrink: 0; }
.option-title { font-weight: 600; font-size: 1rem; }
.option-desc { display: block; color: #6a7f6a; font-size: 0.85rem; font-weight: 400; margin-left: auto; }

/* === Ingredient Grid === */
.ingredient-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.ingredient-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.7rem 1rem; border: 2px solid #dce3d0; border-radius: 10px;
    cursor: pointer; transition: all 0.2s; font-size: 0.9rem;
    position: relative;
}
.ingredient-item:hover { border-color: #a8c0a0; background: #f5f9f0; }
.ingredient-item.selected { border-color: #4a7c59; background: #edf5e8; }
.ingredient-item input { display: none; }
.ingredient-item .checkmark {
    width: 18px; height: 18px; border-radius: 4px;
    border: 2px solid #a8bca0; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.ingredient-item.selected .checkmark {
    background: #4a7c59; border-color: #4a7c59;
}
.ingredient-item.selected .checkmark::after {
    content: '✓'; color: #fff; font-size: 0.7rem; font-weight: 700;
}

/* === Inputs === */
.input-house {
    width: 100%; padding: 0.85rem 1rem; border: 2px solid #dce3d0;
    border-radius: 12px; font-size: 1rem; margin-bottom: 1.5rem;
    transition: border-color 0.2s; background: #fff;
}
.input-house:focus { outline: none; border-color: #4a7c59; }

/* === Step Actions === */
.step-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
.step-actions .btn:first-child { margin-right: auto; }

/* === Daily Salad Info === */
.daily-salad-info {
    background: #fff; border: 2px solid #dce3d0; border-radius: 14px;
    padding: 1.5rem; margin-bottom: 1.5rem; line-height: 1.7;
}

/* === Order Summary === */
.order-summary {
    background: #fff; border: 2px solid #dce3d0; border-radius: 14px;
    padding: 1.25rem; margin-bottom: 1.5rem;
}
.order-summary h3 { margin-bottom: 0.75rem; font-size: 1rem; }
.order-summary ul { list-style: none; }
.order-summary li { padding: 0.3rem 0; border-bottom: 1px solid #eef3e8; font-size: 0.9rem; }
.order-summary li:last-child { border-bottom: none; }

/* === Modal === */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 1rem;
}
.modal {
    background: #fff; border-radius: 18px; max-width: 480px; width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2); animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header {
    padding: 1.5rem 1.5rem 0; font-size: 1.3rem; font-weight: 700;
    text-align: center; color: #4a7c59;
}
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer { padding: 0 1.5rem 1.5rem; text-align: center; }
.modal-note { margin-top: 1rem; font-size: 0.9rem; color: #5a6f5a; text-align: center; }

.payment-box {
    background: #f5f9f0; border: 2px solid #dce3d0; border-radius: 12px;
    padding: 1.25rem; margin-top: 1rem;
}
.payment-box h4 { margin-bottom: 0.75rem; color: #2d3a2d; }
.payment-info {
    white-space: pre-wrap; font-family: inherit; font-size: 0.9rem;
    line-height: 1.7; color: #2d3a2d;
}

/* === Error Toast === */
.error-toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
    background: #c0392b; color: #fff; padding: 0.85rem 1.5rem;
    border-radius: 12px; font-weight: 600; font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(192,57,43,0.3); z-index: 2000;
    animation: fadeIn 0.3s ease;
}

/* === Admin === */
.admin-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem;
}
.admin-header-actions {
    display: flex; gap: 0.5rem; align-items: center;
}

.filter-bar {
    display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.filter-btn {
    padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.85rem;
    font-weight: 500; text-decoration: none; color: #2d3a2d;
    background: #e2e8d8; transition: all 0.2s;
}
.filter-btn:hover { background: #d0d9c4; }
.filter-btn.active { background: #4a7c59; color: #fff; }

.orders-list { display: flex; flex-direction: column; gap: 1rem; }

.order-card {
    background: #fff; border-radius: 14px; border: 1px solid #dce3d0;
    overflow: hidden; transition: box-shadow 0.2s;
}
.order-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

.order-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.85rem 1.25rem; background: #fafcf8;
    border-bottom: 1px solid #eef3e8; flex-wrap: wrap;
}
.order-id { font-weight: 700; font-size: 0.95rem; }
.order-status { font-size: 0.85rem; font-weight: 500; }
.status-pending { color: #d4a017; }
.status-completed { color: #4a7c59; }
.status-deleted { color: #a0a0a0; }
.order-date { margin-left: auto; font-size: 0.8rem; color: #7a8f7a; }

.order-body { padding: 1rem 1.25rem; }
.order-detail { margin-bottom: 0.5rem; font-size: 0.9rem; }
.order-detail:last-child { margin-bottom: 0; }

.ingredient-tag {
    display: inline-block; background: #edf5e8; color: #2d3a2d;
    padding: 0.15rem 0.6rem; border-radius: 20px; font-size: 0.8rem;
    margin: 0.1rem 0.15rem;
}

.order-actions {
    padding: 0.75rem 1.25rem; border-top: 1px solid #eef3e8;
    display: flex; gap: 0.5rem;
}

.empty-state {
    text-align: center; padding: 3rem 1rem; color: #7a8f7a;
    background: #fff; border-radius: 14px; border: 1px solid #dce3d0;
}

/* === Tabs === */
.tab-bar {
    display: flex; gap: 0; margin-bottom: 1.5rem;
    border-bottom: 2px solid #dce3d0;
}
.tab-btn {
    padding: 0.7rem 1.5rem; border: none; background: none;
    font-size: 0.95rem; font-weight: 600; color: #7a8f7a; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: all 0.2s;
}
.tab-btn:hover { color: #2d3a2d; }
.tab-btn.active { color: #4a7c59; border-bottom-color: #4a7c59; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.25s ease; }

/* === Ingredient Management === */
.ing-mgmt-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.75rem;
}
.ing-mgmt-header h2 { margin-bottom: 0; font-size: 1.1rem; }

.ing-table-wrapper {
    background: #fff; border-radius: 14px; border: 1px solid #dce3d0;
    overflow-x: auto;
}
.ing-table {
    width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.ing-table th {
    text-align: left; padding: 0.75rem 1rem;
    background: #fafcf8; border-bottom: 1px solid #eef3e8;
    font-weight: 600; color: #5a6f5a; font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ing-table td {
    padding: 0.7rem 1rem; border-bottom: 1px solid #eef3e8; vertical-align: middle;
}
.ing-table tr:last-child td { border-bottom: none; }
.ing-table tr:hover { background: #fafcf8; }
.ing-actions { white-space: nowrap; }
.ing-actions .btn { padding: 0.3rem 0.6rem; font-size: 0.8rem; min-width: 32px; }

.status-badge {
    display: inline-block; padding: 0.15rem 0.6rem; border-radius: 20px;
    font-size: 0.8rem; font-weight: 500;
}
.status-badge.active { background: #edf5e8; color: #3d6b4b; }
.status-badge.inactive { background: #f5f0f0; color: #8a7a7a; }

/* === Form Groups === */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block; font-weight: 600; font-size: 0.9rem;
    margin-bottom: 0.35rem; color: #2d3a2d;
}
.form-actions {
    display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem;
}

.checkbox-label {
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
    font-weight: 500; font-size: 0.9rem;
}
.checkbox-label input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: #4a7c59; cursor: pointer;
}

.modal-sm { max-width: 400px; }

/* === Settings === */
.settings-card {
    background: #fff; border: 1px solid #dce3d0; border-radius: 14px;
    padding: 1.5rem; margin-bottom: 1.5rem;
}
.input-textarea {
    width: 100%; padding: 0.85rem 1rem; border: 2px solid #dce3d0;
    border-radius: 12px; font-size: 0.95rem; font-family: inherit;
    line-height: 1.6; resize: vertical; min-height: 120px;
    transition: border-color 0.2s; background: #fff;
}
.input-textarea:focus { outline: none; border-color: #4a7c59; }

.settings-preview { margin-bottom: 2rem; }
.settings-preview h3 { font-size: 1rem; margin-bottom: 0.75rem; color: #5a6f5a; }
.preview-box {
    background: #edf5e8; border: 2px solid #d4e0cc; border-radius: 14px;
    padding: 1.25rem; line-height: 1.7; font-size: 0.9rem; white-space: pre-wrap;
}

/* === Login === */
.login-wrapper {
    display: flex; align-items: center; justify-content: center;
    min-height: 80vh;
}
.login-card {
    background: #fff; border-radius: 18px; border: 1px solid #dce3d0;
    padding: 2.5rem 2rem; max-width: 400px; width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
.login-icon { text-align: center; font-size: 2.5rem; margin-bottom: 0.5rem; }
.login-card h1 {
    text-align: center; font-size: 1.2rem; margin-bottom: 1.5rem; color: #2d3a2d;
}
.login-error {
    background: #fde8e8; border: 1px solid #f5c6c6; color: #a94442;
    padding: 0.7rem 1rem; border-radius: 10px; margin-bottom: 1rem;
    font-size: 0.9rem; text-align: center;
}
.btn-block { width: 100%; justify-content: center; padding: 0.85rem; }
.login-footer {
    text-align: center; margin-top: 1.25rem;
}
.link-secondary {
    color: #7a8f7a; text-decoration: none; font-size: 0.85rem;
}
.link-secondary:hover { color: #2d3a2d; text-decoration: underline; }

/* === Responsive === */
@media (max-width: 500px) {
    .container { padding: 1rem; }
    .ingredient-grid { grid-template-columns: 1fr; }
    .progress-line { width: 36px; }
    .option-card { padding: 0.85rem 1rem; }
    .order-header { flex-direction: column; align-items: flex-start; }
    .order-date { margin-left: 0; }
}
