/* data-transfer (Migraties): the Evo Dental tokens from DESIGN.md, and the
   few components the login pages and the upload page use. No inline styles
   anywhere: the Content-Security-Policy refuses them. */

:root {
    --primary: #695097;
    --primary-hover: #58407d;
    --primary-light: #f3f0f8;
    --primary-lighter: #ebe7f2;
    --primary-border: #c9bcdf;
    --focus-ring: 0 0 0 3px rgba(105, 80, 151, 0.1);
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --success: #059669;
    --success-text: #14532d;
    --success-bg: #d1fae5;
    --warning: #d97706;
    --warning-text: #92400e;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-text: #991b1b;
    --danger-bg: #fee2e2;
    --info: #2563eb;
    --info-text: #1e3a8a;
    --info-bg: #e0f2fe;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

/* Several components set display; the hidden attribute must still win. */
[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--gray-900);
    background: #f8fafc;
}

h1 { font-size: 1.75rem; font-weight: 700; margin: 0; }
h2 { font-size: 1.25rem; font-weight: 600; margin: 0; }
h3 { font-size: 1.125rem; font-weight: 600; margin: 0; }
.h3-like { font-size: 1.125rem; font-weight: 600; margin: 0; }
.eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin: 0;
}

.muted { color: var(--gray-500); }
.small { font-size: 0.8125rem; }
.xs { font-size: 0.75rem; }
.mono { font-family: var(--mono); font-size: 0.75rem; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.btn:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn--sm { padding: 0.375rem 0.75rem; border-radius: 0.375rem; font-size: 0.8125rem; }
.btn--lg { padding: 0.75rem 1.5rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn--secondary { background: var(--gray-100); color: var(--gray-900); border-color: var(--gray-200); }
.btn--secondary:hover:not(:disabled) { background: var(--gray-200); }
.btn--outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--outline:hover:not(:disabled) { background: var(--primary-light); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger-ghost { background: transparent; color: var(--danger-text); border-color: var(--gray-200); }
.btn--danger-ghost:hover:not(:disabled) { background: var(--danger-bg); }
.btn--link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}
.badge--success { background: var(--success-bg); color: var(--success-text); }
.badge--warning { background: var(--warning-bg); color: var(--warning-text); }
.badge--danger { background: var(--danger-bg); color: var(--danger-text); }
.badge--neutral { background: var(--gray-100); color: var(--gray-700); }
.badge--info { background: var(--info-bg); color: #1e40af; }

/* Cards */
.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}
.card__body { padding: 1rem 1.25rem; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.375rem; }
.field label { font-weight: 500; font-size: 0.8125rem; color: var(--gray-700); }
.field input {
    font-family: inherit;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    background: #fff;
    color: var(--gray-900);
    width: 100%;
}
.field input:focus { outline: 0; border-color: var(--primary); box-shadow: var(--focus-ring); }
.field input:disabled { background: var(--gray-50); color: var(--gray-600); }
.field input[aria-invalid="true"] { border-color: var(--danger); }

/* Alerts */
.alert {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    margin: 0;
}
.alert--info { background: var(--info-bg); color: var(--info-text); }
.alert--warning { background: var(--warning-bg); color: var(--warning-text); }
.alert--danger { background: var(--danger-bg); color: var(--danger-text); }
.alert--success { background: var(--success-bg); color: var(--success-text); }

/* Progress */
.progress {
    height: 0.375rem;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
}
.progress__bar {
    display: block;
    height: 100%;
    width: 0;
    background: var(--primary);
    transition: width 0.3s ease;
}
.progress--success .progress__bar { background: var(--success); }
.progress--warning .progress__bar { background: var(--warning); }
.progress--danger .progress__bar { background: var(--danger); }

/* Brand */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
/* static/evo-logo.svg: the CRM masthead's purple wordmark, canvas cropped. */
.logo__img { height: 2rem; width: auto; display: block; }
.logo__suffix {
    font-weight: 500;
    color: var(--gray-500);
    font-size: 0.8125rem;
    border-left: 1px solid var(--gray-200);
    padding-left: 0.5rem;
    margin-left: 0.25rem;
}

/* Login pages: one centred card under the logo */
.auth {
    min-height: 100vh;
    padding: 2.5rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth__brand { text-align: center; margin-bottom: 1.5rem; }
.auth__logo { height: 3rem; width: auto; display: block; margin: 0 auto; }
.auth__product { margin-top: 0.25rem; }
.auth__card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 2.5rem;
}
.auth__title { text-align: center; font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
.auth__lead { text-align: center; margin: 0 0 1.75rem; }
.auth__alt { text-align: center; margin: 0; }
.auth__note { margin: 0; }
.choice-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.choice {
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.choice:hover, .choice:focus-visible { border-color: var(--primary); background: var(--primary-light); outline: 0; }
.choice__name { font-weight: 600; }

@media (max-width: 480px) {
    .auth__card { padding: 1.5rem; }
}

/* Upload page shell */
.top {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    height: 3.75rem;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
}
.top__spacer { flex: 1; }
.top__form { margin: 0; }
.main {
    width: min(68.75rem, 92vw);
    margin: 1.5rem auto 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.page-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 0.75rem; }
.page-head h1 { margin-top: 0.25rem; }
.page-head__spacer { flex: 1; }
.upload-grid {
    display: grid;
    grid-template-columns: minmax(16rem, 20rem) 1fr;
    gap: 1.5rem;
    align-items: start;
}
.upload-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist__item {
    display: flex;
    gap: 0.625rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--gray-200);
}
.checklist__item:last-child { border-bottom: 0; }
.checklist__icon { flex: none; margin-top: 0.125rem; }
.checklist__icon--done path { fill: var(--success); }
.checklist__icon--required circle { stroke: var(--gray-400); }
.checklist__icon--optional circle { stroke: var(--gray-300); stroke-dasharray: 3 3; }
.checklist__text { min-width: 0; }
.checklist__name { font-weight: 500; }
.checklist__pattern { overflow-wrap: anywhere; }
.checklist__item--missing .checklist__name { color: var(--gray-900); }
.quota { margin-top: 1rem; }
.quota .progress { margin-top: 0.375rem; }
.empty-note { margin: 0; padding: 0.75rem 0; }

/* Dropzone */
.dropzone {
    border: 2px dashed var(--primary-border);
    background: var(--primary-light);
    border-radius: 0.5rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.dropzone--over { background: var(--primary-lighter); border-color: var(--primary); }
.dropzone__icon { display: block; margin: 0 auto; }
.dropzone__title { font-weight: 600; margin-top: 0.5rem; }
.dropzone__actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.dropzone__hint { margin-top: 0.5rem; }

/* File rows */
.file-row { padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--gray-200); }
.file-row:last-child { border-bottom: 0; }
.file-row__line { display: flex; align-items: center; gap: 0.75rem; }
.file-row__text { min-width: 0; flex: 1; }
.file-row__name { font-weight: 500; overflow-wrap: anywhere; }
.file-row__actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.file-row .progress { margin-top: 0.5rem; }
.file-row__confirm {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 0.8125rem;
}
.file-row__error { margin-top: 0.5rem; }
.uploads-empty { padding: 1.25rem; margin: 0; }

/* The checklist modal. Layout only while [open]: a display rule on the closed
   dialog would override the UA's display: none and show it on load. */
.checklist-dialog {
    border: 0;
    border-radius: 0.75rem;
    padding: 0;
    width: min(40rem, calc(100vw - 2rem));
    max-height: calc(100vh - 4rem);
    box-shadow: 0 20px 45px rgba(17, 24, 39, 0.2);
    color: var(--gray-900);
}
.checklist-dialog[open] { display: flex; flex-direction: column; }
.checklist-dialog::backdrop { background: rgba(17, 24, 39, 0.5); }
.checklist-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}
.checklist-dialog__title { font-size: 1.125rem; font-weight: 600; margin: 0; }
.checklist-dialog__close {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
}
.checklist-dialog__close:hover { background: var(--gray-100); color: var(--gray-900); }
.checklist-dialog__close:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.checklist-dialog__body { padding: 1rem 1.5rem; overflow-y: auto; flex: 1; }
.checklist-dialog__footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
}
.checklist-dialog__group { margin: 0 0 1.25rem; }
.checklist-dialog__group-title { margin-bottom: 0.25rem; }
.checklist-dialog__list { list-style: none; margin: 0; padding: 0; }
.checklist-dialog__item { padding: 0.625rem 0; border-bottom: 1px solid var(--gray-200); }
.checklist-dialog__item:last-child { border-bottom: 0; }
.checklist-dialog__name { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-weight: 600; }
.checklist-dialog__fields { display: grid; grid-template-columns: auto 1fr; gap: 0.125rem 0.75rem; margin: 0.375rem 0 0; font-size: 0.8125rem; }
.checklist-dialog__fields dt { color: var(--gray-500); }
.checklist-dialog__fields dd { margin: 0; overflow-wrap: anywhere; }
.checklist-dialog__hint { margin: 0; }

@media (max-width: 760px) {
    .upload-grid { grid-template-columns: 1fr; }
    .hide-sm { display: none; }
    .top { padding: 0 1rem; }
    .main { width: auto; margin: 1rem; }
    .file-row__line { flex-wrap: wrap; }
}
