@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #ff6c00;
    --primary-dark: #e05e00;
    --success: #00C45E;
    --warning: #f59e0b;
    --danger: #ff2400;
    --hold: #4099f2;
    --genius: #0891b2;
    --bg: #fff0e5;
    --card: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --radius: 5px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* ── Header ── */
.app-header {
    background: #ffffff;
    color: var(--text);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.app-header h1 { font-size: 18px; font-weight: 600; display: inline-block; margin-right: 5px }
.app-header .user-info { font-size: 13px; color: var(--text-light); }

.logout-btn {
    background: none;
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.logout-btn svg { width: 16px; height: 16px; }

/* ── Cards ── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.card-header {
    font-size: 16px;
    font-weight: 600;
    margin: -20px -20px 16px;
    padding: 12px 20px;
    background: #F3F5F9;
    border-radius: var(--radius) var(--radius) 0 0;
}

/* ── Form elements ── */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-light);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    transition: border-color .2s;
    -webkit-appearance: none;
}

.form-control:focus { outline: none; border-color: var(--primary); }

select.form-control { background: white; cursor: pointer; }

textarea.form-control { min-height: 80px; resize: vertical; }

/* ── Buttons ── */
.btn svg { width: 16px; height: 16px; flex-shrink: 0; margin-right: 6px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    width: 100%;
    text-decoration: none;
    text-align: center;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn + .btn { margin-top: 8px; }

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

.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: #00a84f; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover:not(:disabled) { background: #d97706; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #dd1f00; }

.btn-hold { background: var(--hold); color: white; }
.btn-hold:hover:not(:disabled) { background: #2d7fd9; }

.btn-genius { background: var(--genius); color: white; }
.btn-genius:hover:not(:disabled) { background: #0e7490; }

.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }

.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
.btn-row .btn + .btn { margin-top: 0; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

.badge-1 { background: #dbeafe; color: #1e40af; }
.badge-2 { background: #fef3c7; color: #92400e; }
.badge-3 { background: #fed7aa; color: #9a3412; }
.badge-4 { background: #cffafe; color: #155e75; }
.badge-5 { background: #d1fae5; color: #065f46; }
.badge-6 { background: #dbeafe; color: #1e40af; }
.badge-7 { background: #dcfce7; color: #166534; }

.order-status { font-size: 13px; padding: 5px 14px; }

/* ── Summary grid ── */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.summary-item {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
}

.summary-item .value { font-size: 24px; font-weight: 700; color: var(--primary); }
.summary-item .label {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.verzendbaar-ja { color: var(--success) !important; }
.verzendbaar-nee { color: var(--danger) !important; }

/* ── Asset cards ── */
.asset-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    /*border-left: 4px solid var(--border);*/
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.asset-card.status-1 { border-left-color: #3b82f6; }
.asset-card.status-2 { border-left-color: #f59e0b; }
.asset-card.status-3 { border-left-color: #f97316; }
.asset-card.status-4 { border-left-color: #06b6d4; }
.asset-card.status-5 { border-left-color: #10b981; }
.asset-card.status-6 { border-left-color: #8b5cf6; }
.asset-card.status-7 { border-left-color: #22c55e; }

.asset-card.focused { box-shadow: 0 0 0 2px var(--primary); }

.asset-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.asset-id { font-weight: 700; font-size: 16px; }
.asset-detail { font-size: 14px; color: var(--text-light); display: block; }

.asset-actions { display: flex; flex-direction: column; gap: 8px; }

/* ── Scan input ── */
.scan-wrapper { position: relative; }

.scan-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 18px;
    background: white;
}

.scan-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,108,0,.2); }

.scan-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
}

/* ── Alerts ── */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-weight: 500;
}

.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Checklist ── */
.checklist-panel {
    background: #f9fafb;
    border-radius: var(--radius);
    padding: 16px;
}

.checklist-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.checklist-item:last-of-type { border-bottom: none; }

.checklist-item span {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checklist-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-width: 24px;
    accent-color: var(--primary);
}

.checklist-item label {
    font-size: 15px;
    cursor: pointer;
}

/* ── Order rules ── */
.rules-list { list-style: none; }

.rules-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rules-list li:last-child { border-bottom: none; }
.rule-name { font-weight: 600; }

.rule-qty {
    background: var(--bg);
    padding: 4px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 12px;
}

/* ── Login ── */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card { width: 100%; max-width: 400px; }

.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo h2 { font-size: 24px; color: var(--primary); }
.login-logo p { color: var(--text-light); font-size: 14px; }

/* ── Section title ── */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 8px 0 12px;
}

/* ── Memo block ── */
.memo-block {
    background: #fffbeb;
    border: 2px solid #f59e0b;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.memo-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.memo-block-header strong {
    font-size: 15px;
    color: #92400e;
}

.memo-block-content {
    font-size: 14px;
    line-height: 1.6;
    color: #78350f;
    white-space: pre-line;
    word-break: break-word;
}

.btn-memo-toggle {
    background: none;
    border: 1px solid #d97706;
    color: #d97706;
    padding: 4px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

/* Memo modal overlay */
.memo-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    padding: 16px;
    overflow-y: auto;
}

.memo-modal-overlay.active { display: flex; align-items: flex-start; justify-content: center; }

.memo-modal {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    margin-top: 40px;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.memo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.memo-modal-header strong { font-size: 17px; }

.memo-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px 8px;
    line-height: 1;
}

.memo-modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
    word-break: break-word;
}

/* Opmerking input (inline toggle) */
.opmerking-panel {
    margin-top: 8px;
}

.btn-opmerking {
    background: #f3f4f6;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-height: 36px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-opmerking svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-right: 6px;
}

/* ── Progress dots ── */
.progress-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.progress-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.progress-dot.done { background: #22c55e; }
.progress-dot.current { background: var(--primary); box-shadow: 0 0 0 3px rgba(255,108,0,.3); }
.progress-dot.pending { background: #d1d5db; color: #6b7280; }
.progress-dot.special { background: #4099f2; }

.progress-line {
    height: 2px;
    flex: 1;
    min-width: 8px;
}

.progress-line.done { background: #22c55e; }
.progress-line.pending { background: #d1d5db; }

/* ── Footer ── */
.app-footer {
    background: var(--primary);
    color: white;
    padding: 16px;
    text-align: center;
    margin-top: 32px;
}

.app-footer .footer-logo { height: 24px; margin-bottom: 6px; }

.app-footer .footer-info {
    font-size: 12px;
    opacity: .7;
}

.app-footer .footer-info span { margin: 0 6px; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .container { padding: 10px; }
    .card { padding: 16px; }
    .card-header { margin: -16px -16px 12px; padding: 10px 16px; }
    .summary-grid { gap: 8px; }
}
