/* WMS Mobile CSS - Optimalizált mobil eszközökre */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1976d2;
    --primary-dark: #115293;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Prevent zoom on input focus (iOS) */
input, select, textarea {
    font-size: 16px !important;
}

#app {
    width: 100%;
    min-height: 100vh;
}

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h2 {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
}

.btn-back {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.btn-icon {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

/* Login Screen */
.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px;
}

.logo {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
}

.login-container h1 {
    font-size: 28px;
    margin-bottom: 32px;
    color: var(--primary-color);
}

#login-form,
#activate-form,
#set-pin-form,
#change-password-form {
    width: 100%;
    max-width: 400px;
}

/* M12.T: eszköz-jelző, PIN / jelszó választó */
.device-badge {
    margin: -16px 0 16px;
    padding: 6px 12px;
    border-radius: 16px;
    background: #e3f2fd;
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 600;
}

.device-badge.inactive {
    background: #eceff1;
    color: var(--text-secondary);
    font-weight: 400;
}

.login-mode-toggle {
    display: flex;
    width: 100%;
    max-width: 400px;
    margin-bottom: 16px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
}

.login-mode-toggle button {
    flex: 1;
    padding: 12px;
    border: none;
    background: white;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.login-mode-toggle button.active {
    background: var(--primary-color);
    color: white;
}

.login-container .hint {
    max-width: 400px;
    margin: -16px 0 20px;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

.link-secondary {
    margin-top: 20px;
    color: var(--primary-color);
    font-size: 15px;
}

input[type="text"],
input[type="password"],
.scan-input {
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
}

input:focus,
.scan-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-primary:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background-color: #eef3f7;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
}

.btn-warning:active {
    background-color: #e0a800;
}

.btn-large {
    padding: 20px;
    font-size: 20px;
    margin-top: 24px;
}

.error-message {
    color: var(--error-color);
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}

.error-message.info-message {
    color: var(--success-color, #2e7d32);
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 16px;
    justify-items: stretch;
    align-items: stretch;
}

.menu-card {
    background-color: var(--card-bg);
    border: none;
    border-radius: 12px;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 120px;
    min-width: 0;
    width: 100%;
    justify-self: stretch;
    min-inline-size: 0;
    -webkit-appearance: none;
    appearance: none;
}

/* Tabs */
.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-button {
    flex: 1;
    padding: 10px 12px;
    background-color: #e3f2fd;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
}

/* Simple list items */
.list-item {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.list-item-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--primary-color);
}

.menu-card:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.menu-icon {
    font-size: 40px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.menu-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.3;
    min-width: 0;
}

/* M20.M: nem nyugtázott fontos üzenet — állandó sáv a főmenüben */
.important-banner {
    display: block;
    width: calc(100% - 24px);
    margin: 8px 12px 0;
    padding: 10px 12px;
    border: 2px solid #e65100;
    border-radius: 8px;
    background-color: #fff3e0;
    color: #b33c00;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.message-important {
    border-left: 4px solid #e65100;
}

.message-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.message-alert {
    background-color: #fff3e0;
    color: #e65100;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

/* Content Area */
.content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

/* Task List */
.task-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.task-card:active {
    transform: scale(0.98);
}

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

.task-number {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-color);
}

.task-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background-color: var(--warning-color);
    color: white;
}

.task-info {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Info Card */
.info-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.info-card p {
    font-size: 16px;
    margin-bottom: 8px;
}

/* Scan Section */
.scan-section {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.scan-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.input-with-scan {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-scan .scan-input {
    flex: 1;
    margin-bottom: 0;
}

.btn-scan {
    background-color: #e3f2fd;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    min-width: 48px;
    min-height: 48px;
}

.scanner-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.scanner-content {
    background: white;
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}

.scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 12px;
}

#scanner-close-btn {
    color: var(--text-primary);
    background: #f5f5f5;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 16px;
}

#scanner-preview {
    width: 100%;
    min-height: 260px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.scanner-hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* Status Indicator */
.status-indicator {
    padding: 12px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.status-indicator.success {
    background-color: #e8f5e9;
    color: var(--success-color);
}

.status-indicator.error {
    background-color: #ffebee;
    color: var(--error-color);
}

.status-indicator.warning {
    background-color: #fff3e0;
    color: var(--warning-color);
}

/* Info Row */
.info-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row.hint {
    background-color: #e3f2fd;
    padding: 12px;
    border-radius: 6px;
    margin: 8px 0;
    border: none;
}

.info-row.warning {
    background-color: #fff3e0;
    padding: 12px;
    border-radius: 6px;
    margin: 8px 0;
    border: none;
    color: var(--warning-color);
}

/* Code Highlights */
.code-highlight {
    display: inline-block;
    background-color: #f5f5f5;
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 4px;
    letter-spacing: 1px;
}

.check-digit-highlight {
    display: inline-block;
    background-color: #4caf50;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: 700;
    margin-left: 8px;
    letter-spacing: 2px;
}

/* Badge */
.badge {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
}

/* Info Text */
.info-text {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px;
    font-size: 16px;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 900px;
        margin: 0 auto;
    }

    .content {
        max-width: 800px;
        margin: 0 auto;
        width: 100%;
    }
}


/* Check Digit Field */
.scan-section.alternative {
    background-color: #f0f7ff;
    border: 2px dashed var(--primary-color);
}

.scan-section.alternative h3 {
    color: var(--primary-color);
    font-size: 14px;
}

.hint-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.check-digit-field {
    max-width: 120px;
    text-align: center;
    font-size: 32px !important;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 8px;
    padding: 16px 8px;
}

/* Optional section */
.scan-section.optional {
    background-color: #fafafa;
    border: 1px dashed var(--border-color);
}

.scan-section.optional h3 {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Completed task card */
.task-card.completed {
    background-color: #e8f5e9;
    border-left: 4px solid var(--success-color);
}

/* PWA specific */
@media (display-mode: standalone) {
    .header {
        padding-top: max(16px, env(safe-area-inset-top));
    }
}

/* Sorter workspace progress */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    transition: width 0.2s ease;
}

/* M20.S: beolvasási sor állapotjelzője és „Nem teljesült beolvasások” panel */
.scan-queue-badge {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 900;
    padding: 8px 14px;
    border: none;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background-color: var(--warning-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.scan-queue-badge.error {
    background-color: var(--danger-color, #d32f2f);
}

body.has-scan-badge .content {
    padding-bottom: 64px;
}

.scan-queue-badge.hidden {
    display: none;
}

.scan-queue-panel {
    position: fixed;
    inset: 0;
    z-index: 950;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0,0,0,0.45);
}

.scan-queue-panel-body {
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 16px;
    border-radius: 12px 12px 0 0;
    background: var(--bg-color, #f5f5f5);
}

.task-card.scan-rejected {
    border-left: 4px solid var(--danger-color, #d32f2f);
}

.scan-pending-note {
    margin-top: 8px;
}

/* ==================== M21 „Kolléga" hangpanel (L3 6.) ==================== */
.voice-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    max-width: 640px;
    margin: 0 auto;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 2px solid var(--primary-color);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}

.voice-panel[hidden] {
    display: none;
}

body.voice-panel-visible .screen .content {
    padding-bottom: 260px;
}

.voice-panel-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.voice-btn {
    padding: 10px 14px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: #fff;
    color: var(--primary-color);
    font-size: 15px;
    font-weight: 600;
}

.voice-btn.on {
    background: var(--primary-color);
    color: #fff;
}

.voice-btn:disabled {
    opacity: 0.45;
}

.voice-status {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #555;
}

.voice-operator {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.voice-operator.live {
    background: #fff3e0;
    color: #8a4b00;
}

.voice-operator.silent {
    background: #eceff1;
    color: #455a64;
}

.voice-operator.model {
    background: #e8eaf6;
    color: #283593;
}

/* M21 L2 D16: az AI-kolléga tájékoztatója */
.voice-consent {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid #c5cae9;
    border-radius: 8px;
    background: #f5f6fc;
}

.voice-consent-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
}

.voice-consent-text {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.45;
    color: #263238;
}

.voice-consent-actions {
    display: flex;
    gap: 8px;
}

.voice-consent-msg {
    margin-top: 6px;
    font-size: 12px;
    color: #b71c1c;
}

.voice-caption {
    margin-top: 6px;
    max-height: 4.2em;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.voice-obligations {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.voice-obligations li.warn {
    color: #8a4b00;
}

.voice-obligations li.missed {
    color: var(--danger-color, #d32f2f);
    font-weight: 600;
}

/* Hangmódban az ellenőrző értékek (check digit, vonalkód) nem látszanak (L1 4.4) — TESZTÜZEMBEN KIKAPCSOLVA (felhasználói döntés
   2026-10-20, L3 9.1 I77). Visszakapcsolás: voice-panel.js `HIDE_VERIFY_VALUES = true` (a body megkapja a `voice-hide-verify` osztályt).
   A check digit nélküli működésre átálláskor ez a szabály és a kapcsoló kódból eltávolítandó. */
body.voice-mode.voice-hide-verify .verify-value {
    display: none !important;
}

/* S3 (VOICE_V1 L3 6.4): a képesség szerint letiltott menüpont — szürke, a kattintás elnyelve (client-mode.js) */
.menu-card.menu-disabled { opacity: 0.45; filter: grayscale(1); cursor: not-allowed; }
