/* CV Service CRM - mobile shell styles */

:root {
                --primary:#1f6feb;
                --primary-dark:#1659bf;
                --success:#198754;
                --warning:#f0ad4e;
                --danger:#dc3545;
                --secondary:#6c757d;
                --light:#eef2f7;
                --bg:#f5f7fb;
                --text:#222;
                --muted:#666;
                --card:#fff;
                --border:#dde4ef;
                --radius:14px;
                --shadow:0 2px 10px rgba(0,0,0,.07);
            }

            * {
                box-sizing:border-box;
            }

            body {
                font-family:Arial,sans-serif;
                background:var(--bg);
                color:var(--text);
                margin:0;
                padding:14px 14px 88px;
            }

            a {
                color:var(--primary);
            }

            .mobile-shell {
                max-width:780px;
                margin:0 auto;
            }

            .mobile-top {
                background:linear-gradient(135deg,var(--primary),var(--primary-dark));
                color:#fff;
                padding:18px;
                border-radius:var(--radius);
                margin-bottom:14px;
                box-shadow:var(--shadow);
            }

            .mobile-top h1 {
                margin:0;
                font-size:22px;
                line-height:1.2;
            }

            .mobile-top p {
                margin:7px 0 0;
                opacity:.92;
                font-size:14px;
            }

            .card,
            .mobile-card,
            .item,
            .filters {
                background:var(--card);
                border-radius:var(--radius);
                padding:14px;
                margin-bottom:12px;
                box-shadow:var(--shadow);
            }

            .section-title,
            .small-title {
                font-weight:bold;
                font-size:17px;
                margin-bottom:9px;
            }

            .muted {
                color:var(--muted);
                font-size:13px;
            }

            .label {
                color:var(--muted);
                font-size:13px;
                margin-bottom:3px;
            }

            .value {
                font-size:16px;
                font-weight:bold;
                margin-bottom:10px;
            }

            .grid2,
            .btn-row,
            .nav {
                display:grid;
                grid-template-columns:1fr 1fr;
                gap:10px;
            }

            .actions {
                display:grid;
                grid-template-columns:1fr;
                gap:10px;
            }

            .btn {
                display:block;
                width:100%;
                border:0;
                border-radius:11px;
                padding:13px;
                font-weight:bold;
                font-size:15px;
                cursor:pointer;
                text-align:center;
                text-decoration:none;
                background:var(--primary);
                color:#fff;
                line-height:1.2;
            }

            .btn.secondary { background:var(--secondary); color:#fff; }
            .btn.success { background:var(--success); color:#fff; }
            .btn.warning { background:var(--warning); color:#222; }
            .btn.danger { background:var(--danger); color:#fff; }
            .btn.light { background:var(--light); color:#222; }
            .btn.compact { padding:8px; font-size:13px; }

            input,
            select,
            textarea {
                width:100%;
                padding:11px;
                border:1px solid #ccd3dd;
                border-radius:9px;
                font-size:16px;
                font-family:Arial,sans-serif;
                background:#fff;
            }

            textarea {
                min-height:95px;
                resize:vertical;
            }

            label {
                display:block;
                font-weight:bold;
                margin:12px 0 6px;
            }

            .alert {
                padding:12px;
                border-radius:11px;
                margin-bottom:12px;
            }

            .alert.success {
                background:#e7f7ec;
                color:#145c2a;
                border:1px solid #b9e4c5;
            }

            .alert.error {
                background:#fdecec;
                color:#8a1f1f;
                border:1px solid #f4bcbc;
            }

            .status {
                display:inline-block;
                padding:7px 10px;
                border-radius:999px;
                font-weight:bold;
                font-size:13px;
                background:var(--light);
                color:#333;
            }

            .status.good {
                background:#e7f7ec;
                color:#145c2a;
            }

            .status.warn {
                background:#fff6df;
                color:#7a4b00;
            }

            .file-row,
            .line-row {
                border-top:1px solid #eef2f7;
                padding:10px 0;
            }

            .file-row:first-child,
            .line-row:first-child {
                border-top:0;
            }

            .preview-grid {
                display:grid;
                grid-template-columns:repeat(2,1fr);
                gap:10px;
            }

            .thumb {
                border-radius:11px;
                overflow:hidden;
                background:var(--light);
                border:1px solid var(--border);
                text-decoration:none;
                color:inherit;
            }

            .thumb img {
                width:100%;
                height:130px;
                object-fit:cover;
                display:block;
            }

            .thumb-caption {
                padding:8px;
                font-size:12px;
                color:#555;
                word-break:break-word;
            }

            .thumb-actions {
                padding:0 8px 8px;
            }

            .signature-preview {
                max-width:100%;
                max-height:130px;
                border:1px solid #ddd;
                border-radius:8px;
                background:#fff;
                padding:8px;
            }

            .danger-zone {
                border:1px solid #f4bcbc;
                background:#fffafa;
            }

            .mobile-bottom-nav {
                position:fixed;
                left:0;
                right:0;
                bottom:0;
                background:#fff;
                border-top:1px solid #dde4ef;
                box-shadow:0 -2px 12px rgba(0,0,0,.08);
                padding:7px 8px;
                z-index:9999;
            }

            .mobile-bottom-nav-inner {
                max-width:780px;
                margin:0 auto;
                display:grid;
                grid-template-columns:repeat(5,1fr);
                gap:6px;
            }

            .mobile-bottom-link {
                text-decoration:none;
                color:#555;
                font-size:12px;
                text-align:center;
                padding:7px 4px;
                border-radius:10px;
                font-weight:bold;
            }

            .mobile-bottom-link span {
                display:block;
                font-size:20px;
                line-height:1;
                margin-bottom:3px;
            }

            .mobile-bottom-link.active {
                background:#eaf2ff;
                color:var(--primary);
            }

            @media (min-width:720px) {
                .actions { grid-template-columns:repeat(2,1fr); }
                .preview-grid { grid-template-columns:repeat(3,1fr); }
            }


/* ---- Phase D: shared page utilities (dashboard / werkbon / uploads) ---- */

.mobile-page,
.page {
    max-width: 780px;
    margin: 0 auto;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.maps { background: #0f9d58; color: #fff; }
.btn.sms { background: #7c3aed; color: #fff; }
.btn.call { background: #2563eb; color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

.alert-success,
.alert.success { background: #e7f7ec; color: #145c2a; border: 1px solid #b9e4c5; padding: 12px; border-radius: 11px; margin-bottom: 12px; }
.alert-error,
.alert.error,
.error { background: #fdecec; color: #8a1f1f; border: 1px solid #f4bcbc; padding: 12px; border-radius: 11px; margin-bottom: 12px; }
.alert-warning,
.alert.warning { background: #fff6df; color: #7a4b00; border: 1px solid #f5e0a3; padding: 12px; border-radius: 11px; margin-bottom: 12px; }

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.stat {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    text-align: center;
}
.stat strong { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); }

.filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}
.filter-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    border: 0;
    border-radius: 12px;
    padding: 11px 8px;
    background: var(--light);
    color: var(--text);
    font-weight: 800;
    font-size: 13px;
}
.filter-btn.active {
    background: var(--primary);
    color: #fff;
}

.wo-item {
    background: var(--card);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border-left: 6px solid var(--primary);
}
.wo-item.status-in_behandeling { border-left-color: var(--warning); }
.wo-item.status-wacht_op_onderdelen,
.wo-item.status-wacht_op_klant,
.wo-item.status-te_factureren { border-left-color: #f59e0b; }
.wo-item.status-afgewerkt { border-left-color: var(--success); }
.wo-item.status-geannuleerd { border-left-color: var(--danger); }

.wo-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
}
.wo-number { font-size: 18px; font-weight: 900; }
.wo-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 800;
    font-size: 12px;
    background: var(--light);
    color: var(--text);
    white-space: nowrap;
}
.status-pill.gepland { background: #dbeafe; color: #1e40af; }
.status-pill.in_behandeling { background: #fef9c3; color: #854d0e; }
.status-pill.wacht_op_onderdelen { background: #ffedd5; color: #9a3412; }
.status-pill.wacht_op_klant { background: #ede9fe; color: #5b21b6; }
.status-pill.te_factureren { background: #fef3c7; color: #92400e; }
.status-pill.afgewerkt { background: #dcfce7; color: #166534; }
.status-pill.geannuleerd { background: #fee2e2; color: #991b1b; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.info-box,
.box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
}
.info-box strong,
.box strong {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}
.customer { font-weight: 800; margin-top: 8px; }
.address-text { white-space: pre-line; line-height: 1.45; }
.contact-name { display: block; color: var(--text); font-size: 14px; font-weight: 800; }
.primary-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 11px;
    margin-left: 5px;
}
.status-form-label {
    display: block;
    font-weight: 800;
    font-size: 13px;
    margin: 12px 0 5px;
    color: #374151;
}

.mobile-sticky-actions {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.mobile-sticky-actions .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mobile-sticky-actions .btn {
    display: inline-block;
    width: auto;
}

.signature-pad {
    width: 100%;
    height: 170px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #fff;
    touch-action: none;
}
.signature-img {
    max-width: 100%;
    max-height: 150px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    margin-bottom: 8px;
}
.attachment-preview {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin: 8px 0;
    background: #f8fafc;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px; border-bottom: 1px solid #eef2f7; text-align: left; vertical-align: top; }
th { background: #f8fafc; }
.right { text-align: right; }
.small { color: var(--muted); font-size: 14px; }

h1 { font-size: 24px; margin: 14px 0; }
h2 { font-size: 18px; margin-top: 0; }

@media (max-width: 520px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .filters { grid-template-columns: repeat(2, 1fr); }
    .wo-actions { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
}


/* ---- Tikklok & handtekening ---- */
.clock-big { font-size: 42px; font-weight: 900; line-height: 1; margin: 10px 0; }
.clock-card-active { border-left: 6px solid var(--success); }
.clock-card-idle { border-left: 6px solid var(--secondary); }
.clock-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.clock-stat { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.clock-stat strong { display: block; font-size: 24px; margin-bottom: 4px; }
.clock-entry { border-top: 1px solid #eef2f7; padding: 12px 0; }
.clock-entry:first-child { border-top: 0; }
.clock-entry-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.clock-entry form { margin-top: 10px; }

canvas.signature-pad,
.card canvas {
    width: 100%;
    height: 260px;
    border: 2px dashed #ccd3dd;
    border-radius: 10px;
    background: #fff;
    touch-action: none;
    display: block;
}
.check-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
}
.check-row input { width: auto; margin-top: 3px; }

