/* ==============================
   BASE
============================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f6f4ef;
    margin: 0;
    color: #1f2937;
}

a {
    text-decoration: none;
    color: #2f3e46;
    font-weight: 500;
}

a:hover {
    opacity: 0.75;
}

input:-webkit-autofill {
    box-shadow: 0 0 0px 1000px white inset;
}

/* ==============================
   LAYOUT
============================== */

.container {
    max-width: 1000px;
    margin: 60px auto;
    background: #fbfaf8;
    padding: 48px;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.04);
}

.section-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 14px;
    border: 1px solid #ece7df;
    margin-bottom: 40px;
}

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

/* ==============================
   NAVBAR
============================== */

.navbar {
    background: #ffffff;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ece7df;
}

.navbar a {
    margin-left: 20px;
}

.navbar a.active {
    font-weight: 700;
    border-bottom: 2px solid #1d4e89;
    padding-bottom: 4px;
}

.lang-switch {
    margin-left: 24px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 3px 8px;
    text-decoration: none !important;
}

.lang-switch:hover {
    color: #1d4e89;
    border-color: #1d4e89;
}

.nav-kitchen {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid #d1d5db;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.nav-settings {
    margin-left: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 3px 10px;
    text-decoration: none !important;
}

.nav-settings:hover {
    color: #1d4e89;
    border-color: #1d4e89;
}

.nav-logout {
    margin-left: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 3px 10px;
    text-decoration: none !important;
}

.nav-logout:hover {
    color: #dc2626;
    border-color: #dc2626;
}

.brand {
    font-weight: 700;
    font-size: 18px;
}

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 22px;
    color: #1f2937;
    line-height: 1;
}

.nav-hamburger:hover {
    background: none;
    opacity: 0.7;
}

/* ==============================
   HEADINGS
============================== */

h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
}

h2 {
    margin-top: 50px;
    margin-bottom: 18px;
    font-size: 22px;
    font-weight: 600;
    color: #374151;
    border-left: 3px solid #1d4e89;
    padding-left: 12px;
}

h3 {
    margin-top: 50px;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
}

h3::after {
    content: "";
    display: block;
    margin-top: 10px;
    height: 1px;
    background: #d9d3c8;
}

h3.process-title::after {
    background: #e5e0d8;
    opacity: 0.4;
}

/* ==============================
   TABLES
============================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed;
}

th {
    text-align: left;
    padding: 14px 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    border-bottom: 2px solid #ece7df;
}

/* Merged td + table td — 14px 10px is the effective padding */
td {
    padding: 14px 10px;
    border-bottom: 1px solid #f0ece6;
    vertical-align: middle;
}

tbody tr:hover {
    background: #f7f4ef;
    transform: translateY(-1px);
    transition: 0.15s ease;
}

table td:first-child {
    font-weight: 600;
    font-size: 16px;
}

.date-cell {
    font-size: 14px;
    color: #4b5563;
}

.date-label {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    margin-bottom: 2px;
}

/* ==============================
   TABLE HIERARCHY
============================== */

.highlight-row td {
    border-top: 3px solid #1d4e89;
    font-weight: 600;
}

.section-start td {
    padding-top: 18px;
    border-top: 2px solid #ece7df;
    color: #4b5563;
}

.financial-start td {
    padding-top: 20px;
    border-top: 3px solid #1d4e89;
}

.financial-row td {
    background: #faf8f4;
}

.financial-row:last-of-type td {
    border-bottom: 3px solid #1d4e89;
}

/* ==============================
   FORMS
============================== */

/* Merged both input/select/textarea blocks into one */
input,
select,
textarea {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

/* input-specific properties from original line 268 */
input {
    background: #ffffff;
    box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #d1d5db;
}

textarea {
    width: 100%;
    resize: vertical;
}

.search-bar input {
    width: 260px;
    padding: 8px 12px;
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: #1d4e89;
}

/* Remove number input arrows (Chrome, Edge, Safari) */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove number input arrows (Firefox) */
input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

/* ==============================
   BUTTONS
============================== */

/* Single base button reset — merged from two duplicate blocks */
button {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #e5e0d8;
    background: #f8f6f2;
    color: #1f2937;
    font-weight: 500;
    cursor: pointer;
    transition: 0.15s ease;
}

button:hover {
    background: #efeae2;
}

/* Primary */
.primary-btn {
    background: #1d4e89;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 20px;
}

.primary-btn:hover {
    background: #163d6e;
}

.primary-btn:disabled {
    background: #6b9fd4;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Feedback send button sits inside a grid — no top margin */
#feedback-send-btn {
    margin-top: 0;
}

/* Scale / recalculate */
.scale-btn {
    background: #1d4e89;
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.scale-btn:hover {
    background: #163d6e;
}

.recalculate-btn {
    margin-top: 25px;
    padding: 10px 20px;
    font-size: 15px;
    background: #1d4e89;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
}

.recalculate-btn:hover {
    background: #163d6e;
}

/* Destructive — single definition (transparent icon style) */
.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #dc2626;
    font-size: 16px;
    padding: 0 5px;
}

.delete-btn:hover {
    opacity: 0.7;
}

/* Ingredient row remove */
.remove-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 16px;
    cursor: pointer;
}

.remove-btn:hover {
    color: #b42318;
}

/* Sort arrows */
.sort-btn {
    background: transparent;
    border: none;
    color: #c4bdb4;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 8px;
    line-height: 1.4;
    display: block;
    width: 14px;
    text-align: center;
}

.sort-btn:hover {
    color: #1d4e89;
}

/* Misc button helpers */
.add-btn {
    margin-top: 5px;
    margin-bottom: 15px;
}

.welcome-manual-btn {
    display: inline-block;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* Secondary (link-style) */
.btn-secondary {
    display: inline-block;
    padding: 6px 14px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Auth */
.auth-btn {
    width: 100%;
    padding: 11px;
    background: #374151;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.15s ease;
}

.auth-btn:hover {
    background: #1f2937;
}

/* Decide / confirm actions */
.decide-btn {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 24px;
    margin: 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    white-space: nowrap;
    min-width: 180px;
    text-decoration: none;
    box-sizing: border-box;
}

.decide-btn.primary-btn {
    background: #1d4e89;
    color: white;
    border-color: #1d4e89;
    margin-top: 0;
}

.decide-btn.primary-btn:hover {
    background: #163d6e;
    border-color: #163d6e;
}

/* ==============================
   HELPERS
============================== */

.right { text-align: right; }
.center { text-align: center; }

td form {
    margin: 0;
}

.open-link {
    display: inline-block;
    text-align: center;
}

.no-history {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

.history-block {
    font-size: 11px;
    color: #8b8b8b;
    line-height: 1.4;
}

.volatility-label {
    color: #9ca3af;
    margin-right: 4px;
}

.negative {
    color: #dc2626;
}

.positive {
    color: #16a34a;
}

.meta-line {
    margin-bottom: 6px;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 15px;
    border-radius: 8px;
    margin: 12px 0 6px 0;
}

/* Merged both .alert-danger definitions into one */
.alert-danger {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 12px 0 1rem 0;
}

.info-banner {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #bfdbfe;
    border-top-color: #1d4e89;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.upload-loading {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    color: #1d4e89;
    font-size: 14px;
    font-weight: 500;
}

.upload-loading.visible {
    display: flex;
}

.upload-loading-slow {
    display: none;
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
    font-style: italic;
}

.upload-loading-slow.visible {
    display: block;
}

/* ==============================
   FEEDBACK MODAL
============================== */

#feedback-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1d4e89;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: background 0.15s;
}

#feedback-btn:hover {
    background: #163d6e;
}

#feedback-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

#feedback-modal-box {
    background: white;
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    max-width: 440px;
    margin: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#feedback-modal-box h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
}

#feedback-modal-box h3::after {
    display: none;
}

#feedback-text {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

#feedback-text:focus {
    outline: 2px solid #1d4e89;
    border-color: transparent;
}

#feedback-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

#feedback-modal-actions button {
    padding: 10px 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

#feedback-cancel-btn {
    background: #f3f4f6;
    color: #374151;
}

#feedback-cancel-btn:hover {
    background: #e5e7eb;
}

#feedback-status {
    margin: 0;
    font-size: 14px;
}

/* ==============================
   PRODUCTION BLOCK
============================== */

.production-block {
    margin-bottom: 40px;
}

.production-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

/* Merged both .production-meta definitions */
.production-meta {
    margin-top: 6px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* ==============================
   RECIPE HEADER
============================== */

.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.recipe-date {
    font-size: 14px;
    color: #6b7280;
}

/* ==============================
   RECIPE ACTIONS
============================== */

.recipe-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
}

.actions-left {
    display: flex;
    gap: 10px;
}

.actions-right {
    display: flex;
}

/* ==============================
   CREATE & EDIT RECIPE
============================== */

.create-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    margin-top: 30px;
}

.create-left input,
.create-left textarea,
.create-right input:not([type="radio"]),
.create-right select {
    width: 100%;
    margin-bottom: 16px;
}

.ingredients-block {
    background: #ffffff;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #ece7df;
    margin-bottom: 20px;
}

#ingredients .row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

#ingredients .row input[name="name"] {
    flex: 2 1 0;
    min-width: 0;
    width: auto;
    margin-bottom: 0;
}

#ingredients .row input[name="qty"] {
    flex: 0 0 68px;
    min-width: 0;
    width: 68px;
    margin-bottom: 0;
}

#ingredients .row select {
    flex: 0 0 68px;
    width: 68px;
    margin-bottom: 0;
}

.sort-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    gap: 0;
}

.margin-wrapper {
    min-height: 70px;
}

.save-section {
    margin-top: 30px;
}

.radio-group {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-bottom: 20px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

#unit_fields,
#weight_fields {
    margin-top: 15px;
    margin-bottom: 30px;
}

.auto-weight-note {
    font-size: 14px;
    color: #6b7280;
    margin-top: 8px;
}

.form-section {
    margin-top: 35px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.pricing-block {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 10px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 13px;
    color: #6b7280;
}

.yield-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.page-title {
    margin-bottom: 5px;
}

.page-subtitle {
    color: #6b7280;
    margin-bottom: 25px;
}

.field-group-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #9ca3af;
    margin: 24px 0 14px;
}

.section-line {
    height: 1px;
    background: #ece7df;
    margin-bottom: 20px;
}

.field-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.field-wrap {
    display: inline-flex;
    flex-direction: column;
}

.field-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 3px;
    display: none;
}

.field-error.visible {
    display: block;
}

/* ==============================
   SCALE RECIPE
============================== */

.scale-subtitle strong {
    font-weight: 600;
}

.scale-subtitle {
    font-size: 15px;
    color: #6b7280;
}

.scale-mode {
    margin-top: 15px;
    margin-bottom: 20px;
}

.scale-mode label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.scale-input {
    margin-top: 20px;
}

.scale-input input {
    width: 360px;
    padding: 14px 16px;
    font-size: 17px;
}

.collapsible-title {
    margin-top: 50px;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.production-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.production-highlight {
    text-align: right;
}

.highlight-value {
    font-size: 26px;
    font-weight: 700;
}

.highlight-label {
    font-size: 13px;
    color: #6b7280;
}

.process-text {
    margin-top: 15px;
    white-space: pre-line;
    font-size: 15px;
    line-height: 1.7;
}

.scale-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.scale-right {
    text-align: right;
}

.scale-from {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 6px;
}

.scale-target {
    font-size: 28px;
    font-weight: 700;
}

.production-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==============================
   RECIPE RECALCULATE
============================== */

.section-divider {
    margin: 30px 0;
    border: none;
    border-top: 2px solid #ece7df;
}

.price-summary {
    display: flex;
    gap: 50px;
    margin-bottom: 20px;
}

.summary-label {
    display: block;
    font-size: 13px;
    color: #6b7280;
}

.summary-value {
    font-size: 20px;
    font-weight: 600;
}

.scenario-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 10px 0 25px 0;
}

.scenario-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
    font-weight: 600;
}

.scenario-value {
    margin-bottom: 6px;
}

.scenario-card .summary-value {
    font-size: 18px;
}

.sub-divider {
    height: 1px;
    background: #ece7df;
    margin: 20px 0;
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin: 15px 0 10px 0;
}

.page-footer {
    margin-top: 30px;
}

.decide-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    margin-top: 30px;
}

.decide-actions form {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.drift-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    padding: 2px 7px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    vertical-align: middle;
    cursor: pointer;
    white-space: nowrap;
}

.drift-badge:hover {
    background: #e2e8f0;
}

/* ==============================
   INGREDIENT PAGE
============================== */

.ingredient-table th {
    white-space: normal;
    word-break: break-word;
}

.ingredient-table th:nth-child(1),
.ingredient-table td:nth-child(1) { width: 28%; }

.ingredient-table th:nth-child(2),
.ingredient-table td:nth-child(2) { width: 13%; }

.ingredient-table th:nth-child(3),
.ingredient-table td:nth-child(3) { width: 15%; }

.ingredient-table th:nth-child(4),
.ingredient-table td:nth-child(4) { width: 20%; }

.ingredient-table th:nth-child(5),
.ingredient-table td:nth-child(5) { width: 12%; }

.ingredient-table th:nth-child(6),
.ingredient-table td:nth-child(6) {
    width: 12%;
    padding-left: 16px;
}

.ingredient-table .number-input {
    width: 100px;
    text-align: right;
}

.ingredient-table .save-btn {
    min-width: 60px;
}

.price-history-info {
    font-size: 0.85em;
    color: #555;
}

/* ==============================
   AUTH PAGES
============================== */

body.auth-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: #fbfaf8;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    padding: 48px;
    width: 100%;
    max-width: 420px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 36px;
}

.auth-brand .brand-name {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.3px;
}

.auth-brand .brand-tagline {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 4px;
}

.auth-brand .gold-bar {
    width: 32px;
    height: 3px;
    background: #1d4e89;
    margin: 12px auto 0;
    border-radius: 2px;
}

.auth-title {
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 6px 0;
}

.auth-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 28px 0;
}

.auth-divider {
    height: 1px;
    background: #ece7df;
    margin-bottom: 28px;
}

.auth-card .field {
    margin-bottom: 18px;
}

.auth-card .field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.auth-card .field input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e5e0d8;
    background: #ffffff;
    font-size: 14px;
    color: #1f2937;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.auth-card .field input:focus {
    outline: none;
    border-color: #1d4e89;
    box-shadow: 0 0 0 3px rgba(29, 78, 137, 0.1);
}

.auth-error {
    background: #fee2e2;
    color: #991b1b;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: #6b7280;
}

.auth-footer a {
    color: #374151;
    font-weight: 600;
}

.auth-footer a:hover {
    color: #1d4e89;
}

/* ==============================
   WELCOME / ONBOARDING
============================== */

.welcome-empty-state {
    padding: 30px 0 10px;
    text-align: center;
}

.welcome-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.welcome-empty-desc {
    font-size: 15px;
    color: #6b7280;
    max-width: 520px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.welcome-options {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.welcome-option-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 28px 28px 24px;
    width: 260px;
    text-align: left;
}

.welcome-option-divider {
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    padding: 0 24px;
}

.option-label {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.option-desc {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.55;
    margin-bottom: 18px;
}

/* ==============================
   SUPPLIER / INVOICE
============================== */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #374151;
}

.hint {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

.review-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.supplier-table th:nth-child(1),
.supplier-table td:nth-child(1) { width: 30%; }

.supplier-table th:nth-child(2),
.supplier-table td:nth-child(2) { width: 36%; }

.supplier-table th:nth-child(3),
.supplier-table td:nth-child(3) {
    width: auto;
    white-space: nowrap;
}

.supplier-contact-cell {
    color: #6b7280;
}

.review-table-4col td:nth-child(1),
.review-table-4col th:nth-child(1) { width: 40%; }

.review-table-4col td:nth-child(2),
.review-table-4col th:nth-child(2) { width: 12%; }

.review-table-4col td:nth-child(3),
.review-table-4col th:nth-child(3) { width: auto; }

.review-table-4col td:nth-child(4),
.review-table-4col th:nth-child(4) { width: 20%; }

.review-table-new td:nth-child(1),
.review-table-new th:nth-child(1) { width: 28%; }

.review-table-new td:nth-child(2),
.review-table-new th:nth-child(2) { width: 13%; }

.review-table-new td:nth-child(3),
.review-table-new th:nth-child(3) { width: auto; }

.review-table-new td:nth-child(4),
.review-table-new th:nth-child(4) { width: 16%; }

.review-table-new td:nth-child(5),
.review-table-new th:nth-child(5) { width: 15%; }

.status-processed {
    color: #6b7280;
}

.no-invoices-yet {
    color: #9ca3af;
    font-style: italic;
}

.back-to-suppliers {
    font-size: 14px;
}

/* ==============================
   PRINT STYLES
============================== */

@media print {

    body {
        background: white;
    }

    .navbar,
    .result-actions,
    a {
        display: none !important;
    }

    .container {
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    h1 {
        font-size: 22px;
    }

    table {
        font-size: 13px;
    }

    .production-highlight {
        font-size: 20px;
    }

    .process-text {
        font-size: 13px;
    }
}

/* ==============================
   RESPONSIVE — MOBILE (max 768px)
============================== */

@media (max-width: 900px) {
    .scenario-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .nav-hamburger {
        display: none !important;
    }
}

@media (max-width: 768px) {

    /* Navbar */
    .navbar {
        flex-wrap: wrap;
        padding: 12px 20px;
    }

    .nav-hamburger {
        display: block;
    }

    .nav-right {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 10px 0 4px;
        border-top: 1px solid #ece7df;
        margin-top: 10px;
    }

    .nav-right.open {
        display: flex;
    }

    .nav-right a {
        margin-left: 0;
        padding: 10px 4px;
        font-size: 15px;
        border-bottom: 1px solid #f0ece6;
    }

    .nav-right a:last-child {
        border-bottom: none;
    }

    .nav-right a.active {
        border-bottom: 1px solid #f0ece6;
        font-weight: 700;
        color: #1d4e89;
    }

    .lang-switch,
    .nav-settings,
    .nav-logout {
        margin-left: 0;
        align-self: flex-start;
    }

    /* Container */
    .container {
        margin: 12px;
        padding: 24px 18px;
        border-radius: 12px;
    }

    /* Tables — horizontal scroll */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Grids — collapse to single column */
    .create-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .yield-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .impact-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Fixed-width inputs — go fluid */
    .scale-input input {
        width: 100%;
        box-sizing: border-box;
    }

    .search-bar input {
        width: 100%;
        box-sizing: border-box;
    }

    /* Flex headers — stack vertically */
    .recipes-header,
    .production-top,
    .recipe-header,
    .scale-header,
    .production-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .production-highlight,
    .scale-right {
        text-align: left;
    }

    /* Recipe actions */
    .recipe-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Decide/confirm actions */
    .decide-actions {
        flex-wrap: wrap;
    }

    .decide-btn {
        min-width: unset;
        width: 100%;
        box-sizing: border-box;
    }

    /* Price summary */
    .price-summary {
        flex-direction: column;
        gap: 20px;
    }

    /* Review actions */
    .review-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Auth card */
    .auth-card {
        padding: 32px 20px;
    }

    /* Headings */
    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
    }
}
