/* ClayFlow Main CSS Stylesheet */

:root {
    --bg-base: #0a0d16;
    --bg-surface: rgba(22, 28, 45, 0.65);
    --bg-surface-solid: #151a2d;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-active: rgba(255, 136, 51, 0.4);
    
    /* Branding Colors */
    --color-primary: #ff8833;      /* Clay Orange */
    --color-primary-hover: #e07024;
    --color-secondary: #3b82f6;    /* Mixer Blue */
    --color-success: #10b981;      /* Completed Green */
    --color-danger: #f43f5e;       /* Rose Red */
    --color-warning: #f59e0b;      /* Amber / Measured */
    
    /* Text Colors */
    --color-text: #f3f4f6;
    --color-text-muted: #9ca3af;
    --color-text-dark: #111827;
    
    /* Heights and Layout */
    --touch-target: 48px;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    --transition-speed: 0.25s;
    --glass-blur: 16px;
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 2rem;
}

/* Background Glow Effects */
.glass-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 136, 51, 0.08) 0%, rgba(59, 130, 246, 0.05) 50%, rgba(10, 13, 22, 0) 100%);
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
}

/* Typography headers and text */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

p {
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--touch-target);
    padding: 0 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
    gap: 0.5rem;
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #e06010 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(255, 136, 51, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 136, 51, 0.45);
}

.btn-primary:disabled {
    background: #4b5563;
    color: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger) 0%, #e11d48 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.45);
}

.btn-outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-text-muted);
}

.btn-outline.active {
    background: rgba(255, 136, 51, 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-sm {
    height: 38px;
    padding: 0 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    height: 60px;
    padding: 0 2.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Header styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(13, 17, 30, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--color-primary);
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo-text span {
    color: var(--color-primary);
}

.header-user-panel {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.user-info i {
    color: var(--color-primary);
    font-size: 1.2rem;
}

.badge {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.badge-lg {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 136, 51, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(255, 136, 51, 0.3);
}

/* Container */
.app-container {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Glassmorphism styling */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Auth / Login Card */
.auth-card {
    max-width: 480px;
    margin: 4rem auto;
    flex-direction: column;
    gap: 1.5rem;
    transition: transform var(--transition-speed) ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.logo-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
}

.logo-large i {
    color: var(--color-primary);
}

.logo-large h1 {
    font-weight: 800;
    font-size: 2.5rem;
}

.logo-large h1 span {
    color: var(--color-primary);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.tab-btn {
    height: 40px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-speed);
}

.tab-btn.active {
    background: rgba(255, 136, 51, 0.15);
    color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Card Scan styling */
.card-scan-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all var(--transition-speed);
    text-align: center;
    position: relative;
}

.card-scan-area:hover, .card-scan-area:focus-within {
    border-color: var(--color-primary);
    background: rgba(255, 136, 51, 0.02);
}

.scanner-icon {
    font-size: 4rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.scan-prompt {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.scan-subtext {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

#cardIdInput {
    opacity: 0.02;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.form-control {
    height: var(--touch-target);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--color-text);
    padding: 0 1rem;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-speed);
}

.form-control:focus {
    border-color: var(--color-primary);
}

textarea.form-control {
    height: auto;
    padding: 0.75rem 1rem;
}

/* Custom Select Dropdown Styling */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

select.form-control {
    appearance: none;
    padding-right: 2.5rem;
    width: 100%;
    background-color: var(--bg-surface-solid);
    color: #ffffff;
}

select.form-control option {
    background-color: var(--bg-surface-solid);
    color: #ffffff;
    padding: 0.5rem;
}

select.form-control optgroup {
    background-color: var(--bg-surface-solid);
    color: var(--color-primary);
    font-weight: 700;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-danger {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fda4af;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

/* Dashboards and view headers */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.view-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Batches Grid Layout */
.batches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.0rem;
}

/* Batch Card styling */
.batch-card {
    border-radius: var(--border-radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 1.0rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-speed) ease;
}

.batch-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.batch-card.status-measuring::before { background: var(--color-primary); }
.batch-card.status-measured::before { background: var(--color-warning); }
.batch-card.status-mixing::before { background: var(--color-secondary); }

.batch-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.serial-no {
    font-family: 'Outfit', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card-mixture-name {
    font-size: 1.4rem;
    font-weight: 600;
}

.status-tag {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.4rem 1.0rem;
    border-radius: 16px;
}

.tag-measuring {
    background: rgba(255, 136, 51, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(255, 136, 51, 0.3);
}

.tag-measured {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag-mixing {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-secondary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-cancelled {
    background: rgba(244, 63, 94, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.card-meta-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-meta-item i {
    width: 16px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.8rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.scroll-modal-body {
    max-height: 60vh;
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.recipe-preview-box {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1rem;
}

.recipe-preview-box h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.components-preview-list {
    list-style: none;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Workfile (Active Batch Lifecycle) View */
.workfile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.batch-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.workfile-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.details-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1rem;
}

.details-card .label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.details-card .val {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Timeline tracking */
.batch-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.batch-timeline::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 2rem;
    right: 2rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    z-index: 2;
    width: 80px;
}

.timeline-step .icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-surface-solid);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--color-text-muted);
    transition: all var(--transition-speed);
}

.timeline-step.active .icon-circle {
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 0 12px rgba(255,136,51,0.3);
}

.timeline-step.completed .icon-circle {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #ffffff;
}

.timeline-step.completed span {
    color: var(--color-success);
    font-weight: 500;
}

.timeline-step small {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Workflow Panes */
.workflow-content-pane {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
}

.pane-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pane-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.pane-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Measurement Forms Table */
.measurement-table-header {
    display: grid;
    grid-template-columns: 2fr 1.1fr 1.6fr 100px;
    font-weight: 700;
    color: #e2e8f0;
    font-size: 1.05rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1rem;
    gap: 0.75rem;
    align-items: center;
}

.measurement-row {
    display: grid;
    grid-template-columns: 2fr 1.1fr 1.6fr 100px;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 0.75rem;
}

.mat-name {
    font-weight: 600;
    font-size: 1.25rem;
    color: #ffffff;
}

.target-qty {
    text-align: center;
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: #f1f5f9;
}

.lepen-hint {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: normal;
    margin-top: 0.2rem;
}

.text-center { text-align: center; }
.text-right { text-align: right; }

/* Numeric Keypad style buttons around inputs for gloves in factory */
.weight-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.weight-input {
    width: 110px;
    height: 44px;
    text-align: center;
    font-family: monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    background: rgba(255,255,255,0.08);
}

.adjust-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border-color);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    transition: all var(--transition-speed);
}

.adjust-btn:hover {
    background: rgba(255, 136, 51, 0.25);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pct-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.pct-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #94a3b8;
    min-width: 80px;
    text-align: center;
    transition: all var(--transition-speed);
}

.pct-badge.pct-exact {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
}

.pct-badge.pct-close {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #f59e0b;
}

.pct-badge.pct-under {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.pct-badge.pct-over {
    background: rgba(244, 63, 94, 0.18);
    border-color: #f43f5e;
    color: #f43f5e;
}

/* Verification Layouts */
.verification-alert {
    display: flex;
    gap: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--border-radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-icon {
    font-size: 1.8rem;
    color: var(--color-warning);
}

.verification-alert h4 {
    color: var(--color-warning);
    margin-bottom: 0.25rem;
}

.verification-alert p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.verification-table {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.verif-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
}

.verif-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 0.75rem 1rem;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.95rem;
}

.verif-row:last-child {
    border-bottom: none;
}

.deviation-value {
    font-weight: 600;
    font-family: monospace;
}

.deviation-ok {
    color: var(--color-success);
}

.deviation-warn {
    color: var(--color-warning);
}

.deviation-danger {
    color: var(--color-danger);
}

/* Mixer status styling */
.mixer-status-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 3rem 1rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1.5rem;
}

.mixer-spinner {
    font-size: 6rem;
    color: var(--color-secondary);
}

.spinning {
    animation: spin 3s linear infinite;
}

.mixer-timer-panel {
    display: flex;
    flex-direction: column;
}

.timer-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-secondary);
    letter-spacing: 1px;
}

.mixer-timer-panel h2 {
    font-size: 3.5rem;
    font-family: monospace;
    font-weight: 700;
    color: #ffffff;
    margin: 0.25rem 0;
}

.mixing-since {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.mixer-instructions {
    text-align: center;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin: 2rem 0;
}

/* Seal of completion */
.success-seal {
    font-size: 5rem;
    color: var(--color-success);
    margin-bottom: 1.5rem;
    animation: scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Admin layout views */
.admin-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* Filtering styling */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.filter-actions {
    margin-left: auto;
}

/* Data tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.scroll-table {
    max-height: 450px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.data-table th, .data-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.data-table tr:hover td {
    background: rgba(255,255,255,0.015);
}

/* Admin Two-Column CRUD Panel */
.admin-two-col {
    display: grid;
    grid-template-columns: 1.2fr 2fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .admin-two-col {
        grid-template-columns: 1fr;
    }
}

.admin-form-col {
    border-right: 1px solid var(--border-color);
    padding-right: 2rem;
}

@media (max-width: 900px) {
    .admin-form-col {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 2rem;
    }
}

.admin-form-col h3, .admin-table-col h3 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.input-with-action {
    display: flex;
    gap: 0.5rem;
}

.input-with-action .form-control {
    flex: 1;
}

.form-help {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.form-actions-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Recipe Split Sidebar Editor */
.recipe-admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    min-height: 480px;
}

@media (max-width: 768px) {
    .recipe-admin-layout {
        grid-template-columns: 1fr;
    }
}

.recipe-mixtures-sidebar {
    border-right: 1px solid var(--border-color);
    padding-right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 768px) {
    .recipe-mixtures-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 1.5rem;
    }
}

.recipe-mixtures-sidebar h4 {
    font-size: 1.05rem;
    color: var(--color-text-muted);
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-item {
    padding: 0.9rem 1.1rem;
    border-radius: var(--border-radius-md);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-speed);
    width: 100%;
    color: #ffffff;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}

.sidebar-item.active {
    background: rgba(255, 136, 51, 0.15);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.sidebar-item .item-title {
    font-weight: 600;
    font-size: 1.15rem;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.sidebar-item.active .item-title {
    color: var(--color-primary);
}

.sidebar-item .subtitle {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: 0.2rem;
}

.recipe-details-editor {
    display: flex;
    flex-direction: column;
}

.intro-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    color: #94a3b8;
    gap: 1rem;
    padding: 4rem 1rem;
}

.intro-box i {
    font-size: 3rem;
    color: var(--color-primary);
    opacity: 0.8;
}

.recipe-info-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.form-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.recipe-rows-header {
    display: grid;
    grid-template-columns: 2fr 1fr 80px;
    font-weight: 600;
    color: #e2e8f0;
    font-size: 1.05rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-color);
}

.recipe-row-edit {
    display: grid;
    grid-template-columns: 2fr 1fr 80px;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 0.75rem;
}

.rec-mat-select {
    font-size: 1.05rem !important;
    font-weight: 500;
    color: #ffffff !important;
}

.rec-qty-input {
    font-size: 1.15rem !important;
    font-weight: 600;
    color: #ffffff !important;
}

.recipe-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* History Modal items */
.recipe-history-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.history-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background: rgba(255,255,255,0.02);
    padding: 1rem;
}

.history-card.active-version {
    border-color: var(--color-success);
    background: rgba(16, 185, 129, 0.02);
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.history-meta {
    color: var(--color-text-muted);
}

.history-components-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
}

/* Expandable batch details in reports */
.detail-row-expanded {
    background: rgba(0,0,0,0.2);
}

.report-detail-box {
    padding: 1rem;
}

.report-detail-box h5 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-muted);
}

/* RFID card scan overlay indicator */
.scan-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.scan-overlay-card {
    max-width: 400px;
    padding: 3rem 2rem;
    border: 2px solid var(--color-primary);
}

.pulsing-text {
    margin: 1.5rem 0;
    font-weight: 500;
    color: var(--color-primary);
    animation: pulse 1.5s infinite;
}

/* Placeholder loadings */
.loading-placeholder {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    gap: 1rem;
}

.loading-placeholder i {
    font-size: 2rem;
    color: var(--color-primary);
}

/* Keyframes and Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

@keyframes scaleUp {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.blink {
    animation: pulse 2s infinite;
}

/* Tablet adjustments */
@media (max-width: 768px) {
    body {
        padding-bottom: 3rem;
    }
    .app-header {
        padding: 1rem;
    }
    .app-container {
        margin: 1rem auto;
        padding: 0 1rem;
    }
    .glass-panel {
        padding: 1.25rem;
    }
    .batches-grid {
        grid-template-columns: 1fr;
    }
    .timeline-step {
        width: 65px;
        font-size: 0.7rem;
    }
    .timeline-step .icon-circle {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }
    .batch-timeline::before {
        top: 17px;
    }
    .mixer-status-box {
        flex-direction: column;
        gap: 1.5rem;
        padding: 2rem 1rem;
    }
    .mixer-spinner {
        font-size: 4rem;
    }
    .mixer-timer-panel h2 {
        font-size: 2.5rem;
    }
}

/* ==================== BILINGUAL LANGUAGE SELECTOR ==================== */
.lang-switcher {
    display: flex;
    gap: 4px;
    border: 1px solid var(--border-color);
    padding: 3px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(5px);
}

.btn-lang {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all var(--transition-speed) ease;
}

.btn-lang:hover {
    color: var(--color-primary);
}

.btn-lang.active {
    background: var(--color-primary);
    color: #000000 !important;
}

/* ==================== CONTRAST & ACCESSIBILITY FIXES ==================== */
/* High contrast styling for disabled and read-only inputs */
input:disabled, textarea:disabled, select:disabled,
input[readonly], textarea[readonly], select[readonly] {
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--color-primary) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    cursor: not-allowed;
    opacity: 0.75;
}

/* High contrast dropdown options to prevent black-on-grey text in browsers */
select.form-control option,
select.form-control optgroup {
    background-color: var(--bg-surface-solid) !important;
    color: var(--color-primary) !important;
}

/* Better placeholder visibility */
::placeholder {
    color: rgba(255, 136, 51, 0.45) !important;
}
::-webkit-input-placeholder {
    color: rgba(255, 136, 51, 0.45) !important;
}
:-ms-input-placeholder {
    color: rgba(255, 136, 51, 0.45) !important;
}

/* ==================== COMPLETED BATCH CARD STYLING ==================== */
.batch-card.completed-tint {
    border-left: 5px solid var(--color-success) !important;
    background: rgba(16, 185, 129, 0.06);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.04);
}

.batch-card.completed-tint:hover {
    border-color: var(--color-success);
    background: rgba(16, 185, 129, 0.09);
    transform: translateY(-2px);
}

/* ==================== PRINT MEDIA OVERRIDES (A5 PORTRAIT) ==================== */
@page {
    size: A5 portrait;
    margin: 0;
}

@media print {
    @page {
        size: 148mm 210mm; /* Force A5 dimensions explicitly */
        margin: 0;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    body > *:not(#printLabelContainer) {
        display: none !important;
    }
    
    #printLabelContainer {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        width: 148mm !important;
        height: auto !important; /* Let content determine height naturally to avoid blank 2nd page on tablets */
        padding: 16mm 12mm 10mm 12mm !important; /* Extra breathing space at top */
        box-sizing: border-box;
        margin: 0 auto !important;
        font-family: 'Outfit', 'Inter', sans-serif;
        text-align: center;
        background: #ffffff !important;
        color: #000000 !important;
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        break-inside: avoid !important;
        break-after: avoid !important;
        position: relative !important;
    }

    #printLabelContainer .label-serial {
        font-size: 4rem;
        font-weight: 900;
        margin: 0 0 10px 0 !important;
        line-height: 1.1;
        color: #000000 !important;
    }

    #printLabelContainer .label-title {
        font-size: 2.2rem;
        font-weight: 800;
        text-transform: uppercase;
        margin: 10px 0 !important;
        border-bottom: 3px solid #000000;
        padding-bottom: 8px;
        width: 100%;
        color: #000000 !important;
    }

    #printLabelContainer .label-date {
        font-size: 1.3rem;
        font-weight: 600;
        margin: 5px 0 10px 0 !important;
        color: #000000 !important;
    }

    #printLabelContainer .label-dry-weight {
        font-size: 1.7rem;
        font-weight: 800;
        margin: 10px 0 !important;
        color: #000000 !important;
        border-top: 2px solid #000000;
        border-bottom: 2px solid #000000;
        padding: 10px 0;
        width: 100%;
    }

    #printLabelContainer .label-qr {
        margin-top: 26px !important; /* Increased space away from text and weight info */
        margin-bottom: 0 !important;
        display: flex !important;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    #printLabelContainer .label-qr img,
    #printLabelContainer .label-qr canvas {
        width: 260px !important;
        height: 260px !important;
    }
}

/* Inventory Custom Styles */
.badge-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background-color: rgba(244, 63, 94, 0.15) !important;
    color: #f43f5e !important;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-info {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-xs {
    height: 28px;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--border-radius-sm);
}

.data-table-sm th, .data-table-sm td {
    padding: 0.5rem 0.75rem !important;
}

.alert-danger {
    background-color: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: var(--border-radius-md);
}

/* Custom Overrides for details text, mixer select and high-contrast forms */
.batch-title {
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    font-family: 'Outfit', sans-serif;
    color: var(--color-primary);
}

#wfStatusBadge {
    font-size: 1.3rem !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 20px !important;
    font-weight: 700 !important;
}

#wfMixtureName {
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    color: var(--color-text);
    margin-top: 0.25rem;
}

.mixer-selection-section label {
    font-size: 1.5rem !important;
}

.mixer-selection-section #designatedMixerBadge {
    font-size: 1.1rem !important;
    padding: 4px 8px !important;
}

.mixer-selection-section .select-wrapper::after {
    color: #ffffff !important;
    font-size: 1.1rem !important;
}

#batchMixerSelect {
    background-color: var(--color-success) !important;
    border-color: #0d9488 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    height: 48px !important;
}

#batchMixerSelect option {
    background-color: var(--bg-surface-solid) !important;
    color: var(--color-text) !important;
    font-weight: normal;
    font-size: 1.0rem;
}

/* High contrast inputs and select styles */
input, select, textarea {
    color: var(--color-text) !important;
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

select option, select optgroup {
    background-color: var(--bg-surface-solid) !important;
    color: var(--color-primary) !important;
}

/* Fix browser autofill dark theme text visibility */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    border: 1px solid var(--border-color) !important;
    -webkit-text-fill-color: var(--color-text) !important;
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-surface-solid) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

