/* VeriSub — verisub.org */

:root {
    --color-bg: #f4f6f9;
    --color-surface: #ffffff;
    --color-border: #dde3ec;
    --color-text: #1a2332;
    --color-muted: #5c6b7f;
    --color-primary: #2c5282;
    --color-primary-hover: #1a365d;
    --color-danger: #c53030;
    --color-danger-hover: #9b2c2c;
    --color-success: #276749;
    --color-warning: #975a16;
    --color-info: #2b6cb0;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    gap: 16px;
    flex-wrap: wrap;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.site-logo {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    display: block;
}

.site-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-primary);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--color-muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--color-primary);
    background: #edf2f7;
}

.main-nav .nav-logout {
    color: var(--color-danger);
    margin-left: 8px;
}

.main-nav .nav-logout:hover {
    background: #fff5f5;
    color: var(--color-danger-hover);
}

/* Main */
.main-content {
    flex: 1;
    padding: 28px 20px 48px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 600;
}

.flex-between {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.text-muted {
    color: var(--color-muted);
    margin: 0;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 20px; }

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
}

.card h2 {
    margin: 0 0 16px;
    font-size: 1.1rem;
    font-weight: 600;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-top: 4px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.users-table-scroll {
    margin: 0 -24px;
    border-top: 1px solid var(--color-border);
}

.card-table {
    overflow: hidden;
    min-width: 0;
}

.card-table .users-filter-bar {
    margin-bottom: 4px;
}

.card-table .users-filter-empty {
    margin-bottom: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table.users-table {
    min-width: 1040px;
}

.data-table.users-table th:first-child,
.data-table.users-table td:first-child {
    padding-left: 24px;
}

.data-table.users-table th:last-child,
.data-table.users-table td:last-child {
    padding-right: 24px;
}

.data-table.users-table .col-company {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table.users-table .col-created {
    white-space: nowrap;
    font-size: 0.85rem;
}

.data-table.users-table th.actions-col,
.data-table.users-table td.actions {
    position: sticky;
    right: 0;
    z-index: 1;
    background: var(--color-surface);
    box-shadow: -8px 0 10px -8px rgba(0, 0, 0, 0.12);
}

.data-table.users-table thead th.actions-col {
    background: #f8fafc;
    z-index: 2;
}

.data-table.users-table tbody tr:hover td.actions {
    background: #f8fafc;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    font-weight: 600;
    color: var(--color-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #f8fafc;
}

.data-table th.sortable a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.data-table th.sortable a:hover {
    color: var(--color-primary);
}

.data-table th.sortable.is-sorted a {
    color: var(--color-primary);
}

.data-table th .sort-indicator {
    font-size: 0.7rem;
    line-height: 1;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
    min-width: 200px;
}

.data-table .notes-cell {
    max-width: 220px;
    font-size: 0.85rem;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-pending   { background: #edf2f7; color: #4a5568; }
.badge-submitted { background: #ebf8ff; color: #2b6cb0; }
.badge-reviewed  { background: #faf5ff; color: #6b46c1; }
.badge-approved  { background: #f0fff4; color: #276749; }
.badge-rejected  { background: #fff5f5; color: #c53030; }

.status-display {
    margin: 8px 0;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input[type="date"] {
    min-height: 42px;
    color: var(--color-text);
    color-scheme: light;
    cursor: pointer;
}

/* Date field — calendar icon aligned with primary palette */
.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    padding: 4px;
    margin-left: 4px;
    border-radius: 4px;
    background-color: #edf2f7;
    /* Tint native icon toward --color-primary (#2c5282) */
    filter: brightness(0) saturate(100%) invert(24%) sepia(42%) saturate(1200%) hue-rotate(182deg) brightness(92%) contrast(91%);
    transition: background-color 0.15s;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background-color: #e2e8f0;
}

.form-group input[type="date"]::-webkit-datetime-edit {
    padding: 0;
}

.form-group input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.form-group input[type="date"]::-moz-calendar-picker-indicator {
    cursor: pointer;
    border-radius: 4px;
    padding: 4px;
    background-color: #edf2f7;
    filter: brightness(0) saturate(100%) invert(24%) sepia(42%) saturate(1200%) hue-rotate(182deg) brightness(92%) contrast(91%);
}

.form-group input[type="date"]:disabled {
    cursor: not-allowed;
    background: #f7fafc;
    color: var(--color-muted);
}

.form-group input[type="date"]:disabled::-webkit-calendar-picker-indicator {
    opacity: 0.4;
    cursor: not-allowed;
}

.form-group input:focus,
.form-group input[type="date"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15);
}

.form-group input[disabled] {
    background: #f7fafc;
    color: var(--color-muted);
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--color-muted);
}

.form-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.inline-form {
    display: inline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-secondary {
    background: #edf2f7;
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--color-danger-hover);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-error {
    background: #fff5f5;
    border-color: #feb2b2;
    color: #9b2c2c;
}

.alert-success {
    background: #f0fff4;
    border-color: #9ae6b4;
    color: #276749;
}

.alert-warning {
    background: #fffff0;
    border-color: #f6e05e;
    color: #975a16;
}

.alert-info {
    background: #ebf8ff;
    border-color: #90cdf4;
    color: #2c5282;
}

.alert code {
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.85em;
}

.error-list {
    margin: 0;
    padding-left: 20px;
}

/* Info list */
.info-list {
    margin: 0;
}

.info-list dt {
    font-size: 0.8rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 12px;
}

.info-list dt:first-child {
    margin-top: 0;
}

.info-list dd {
    margin: 4px 0 0;
    font-weight: 500;
}

.admin-notes {
    background: #fffff0;
    border: 1px solid #f6e05e;
    border-radius: var(--radius);
    padding: 12px 16px;
}

.admin-notes p {
    margin: 0;
    font-size: 0.9rem;
}

.user-message {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    border-radius: var(--radius);
    padding: 12px 16px;
}

.user-message h3 {
    margin: 0 0 6px;
    font-size: 0.95rem;
}

.user-message p {
    margin: 0;
    font-size: 0.9rem;
}

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(160deg, #edf2f7 0%, #e2e8f0 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.login-logo {
    display: block;
    height: 48px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    margin: 0 auto 12px;
}

.login-card h1 {
    margin: 0 0 4px;
    font-size: 1.25rem;
    text-align: center;
    color: var(--color-primary);
}

.login-subtitle {
    text-align: center;
    color: var(--color-muted);
    margin: 0 0 24px;
    font-size: 0.9rem;
}

.login-hint {
    text-align: center;
    margin: 20px 0 0;
    font-size: 0.82rem;
}

.login-hint strong {
    font-weight: 600;
}

/* Footer */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 16px 0;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-muted);
}

.site-footer-link {
    color: var(--color-primary);
    text-decoration: none;
}

.site-footer-link:hover {
    text-decoration: underline;
}

/* KYC checklist */
.completion-summary {
    margin: 0 0 12px;
    font-size: 0.9rem;
}

.checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--color-border);
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item.done .checklist-label {
    color: var(--color-success);
}

.checklist-item.optional .checklist-label {
    color: var(--color-muted);
}

.checklist-icon {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.checklist-item.done .checklist-icon {
    color: var(--color-success);
    font-weight: bold;
}

.checklist-label {
    flex: 1;
}

/* Profile form */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 768px) {
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}

.address-fieldset {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 20px 4px;
    margin: 0 0 16px;
    background: #f8fafc;
}

.address-fieldset legend {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0 6px;
}

.address-fieldset[disabled] {
    opacity: 0.85;
}

.profile-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Document slots */
.doc-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.doc-slot {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    background: #f8fafc;
}

.doc-slot-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.doc-slot-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.doc-slot-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.doc-slot-file {
    margin-bottom: 10px;
}

.doc-file-name {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    word-break: break-word;
}

.doc-slot-hint {
    margin: 0 0 10px;
    font-size: 0.85rem;
}

.doc-slot-empty {
    margin: 0 0 10px;
    font-size: 0.85rem;
}

.doc-slot-count,
.doc-slot-limit {
    margin: 0 0 10px;
    font-size: 0.82rem;
}

.doc-file-list {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}

.doc-file-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

.doc-file-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.doc-file-item .doc-slot-actions {
    margin-bottom: 0;
}

.doc-slot-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.doc-upload-form {
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
    margin-top: 4px;
}

.doc-upload-form .form-group {
    margin-bottom: 8px;
}

/* Admin profile grid */
.info-list-grid dd {
    margin-bottom: 8px;
}

/* Company presets & user company label */
.company-preset-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.company-preset-rename-input {
    flex: 1;
    min-width: 160px;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
}

.domain-setup-guide .domain-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.domain-guide-block h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.domain-guide-steps {
    margin: 0;
    padding-left: 18px;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.domain-guide-steps li {
    margin-bottom: 4px;
}

.domain-guide-table {
    font-size: 0.85rem;
}

.company-preset-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.company-preset-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    background: #f8fafc;
}

.company-preset-form .form-group {
    margin-bottom: 12px;
}

.company-preset-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.company-preset-brand-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.company-preset-title-block {
    min-width: 0;
}

.company-preset-meta {
    word-break: break-word;
}

.company-preset-logo-thumb {
    height: 40px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 4px;
    flex-shrink: 0;
}

.company-preset-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 4px;
}

.company-preset-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.company-preset-created {
    font-size: 0.85rem;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .company-preset-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .company-preset-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

.user-company-label {
    margin: 6px 0 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-primary);
}

/* Users list company filter */
.users-filter-bar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.users-filter-search {
    flex: 1.4;
    min-width: 240px;
    margin-bottom: 0;
}

.users-filter-search input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: #fff;
}

.users-filter-select {
    flex: 1;
    min-width: 220px;
    margin-bottom: 0;
}

.users-filter-select select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: #fff;
}

.users-filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.users-filter-empty {
    margin: 0;
    padding: 12px 0;
}

/* Video liveness verification */
.video-verify-app {
    max-width: 520px;
    margin: 0 auto;
}

.video-verify-page-header {
    text-align: center;
    margin-bottom: 16px;
}

.video-verify-layout {
    display: block;
}

.video-verify-main {
    margin: 0;
    padding: 20px;
}

.video-verify-camera-wrap {
    position: relative;
    background: #f7fafc;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    max-width: 100%;
    margin: 0 auto;
}

.video-verify-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scaleX(-1);
    transition: filter 0.25s ease;
}

.video-verify-oval {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56%;
    aspect-ratio: 1;
    height: auto;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(107, 70, 193, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.72);
    pointer-events: none;
    z-index: 3;
    transition: border-color 0.2s;
}

.video-verify-oval.recording {
    border-color: #6B46C1;
}

.video-verify-oval.error {
    border-color: #e53e3e;
    animation: vv-pulse 0.6s ease-in-out 2;
}

@keyframes vv-pulse {
    0%, 100% { border-color: #e53e3e; }
    50% { border-color: #fc8181; }
}

.video-verify-status {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
    background: rgba(68, 51, 122, 0.88);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    z-index: 4;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.video-verify-error {
    position: absolute;
    bottom: 20px;
    left: 16px;
    right: 16px;
    z-index: 5;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 245, 245, 0.96);
    border: 1px solid rgba(254, 178, 178, 0.9);
    color: #9b2c2c;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

.video-verify-instruction {
    font-size: 1.15rem;
    font-weight: 500;
    margin: 0 0 16px;
    line-height: 1.4;
    text-align: center;
    color: var(--color-text);
}

.video-verify-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.video-verify-panel {
    margin: 0;
}

.video-verify-steps {
    display: none;
}

.video-pose-progress {
    display: none;
}

.video-verify-hint {
    margin-top: 12px;
    font-size: 0.85rem;
}

.video-status-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

.video-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

.video-status-item.done {
    color: var(--color-text);
}

.video-verify-playback-grid,
.video-verify-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.video-playback-slot,
.video-admin-slot h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.video-playback {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    background: #000;
}

.video-verify-dashboard-actions {
    display: flex;
    gap: 8px;
}

.hidden {
    display: none !important;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 12px;
}

/* ============================================================
   WEBVIEW SHELL  (candidate-facing mobile UI)
   Activated by body.webview — never affects admin desktop pages.
   Palette --brand / --brand-2 / --accent / --warn are set inline
   from brand.php in <head>.
   ============================================================ */

body.webview {
    --bg: #ffffff;
    --surface: #f6f8fb;
    --surface-2: #eef2f8;
    --text: #0b1f3a;
    --muted: #5a6b85;
    --line: #e6ecf3;
    --radius-lg: 16px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bot: env(safe-area-inset-bottom, 0px);
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

body.webview .app {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 520px;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
}

body.webview .topbar {
    padding: calc(var(--safe-top) + 14px) 18px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    z-index: 10;
    position: sticky;
    top: 0;
}
body.webview .topbar__title {
    flex: 1;
    font-weight: 800;
    font-size: 1.05rem;
    text-align: center;
    letter-spacing: -0.01em;
}
body.webview .topbar__brand {
    display: flex;
    align-items: center;
}
body.webview .topbar__logo {
    height: 32px;
    width: auto;
    border-radius: 8px;
}
body.webview .topbar__mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
body.webview .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1;
    border: none;
    cursor: pointer;
}
body.webview .icon-btn:active {
    background: var(--surface-2);
}

body.webview .content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--safe-bot) + 32px);
}
body.webview .content.pad {
    padding: 16px 18px calc(var(--safe-bot) + 32px);
}

body.webview .card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 16px 18px;
    margin: 0 0 14px;
    box-shadow: 0 2px 8px rgba(11, 31, 58, 0.04);
}
body.webview .card h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
body.webview .card h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
}

body.webview .banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin: 0 0 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.45;
}
body.webview .banner__ico {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--warn);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
}
body.webview .banner strong {
    display: block;
    color: #7c2d12;
    margin-bottom: 2px;
}

/* Brand-coloured dot in tagline */
body.webview .brand-dot {
    color: var(--brand);
}

/* Auth screens (login/register) — full-height single card */
body.webview .auth-screen {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: calc(var(--safe-top) + 24px) 24px calc(var(--safe-bot) + 24px);
    max-width: 520px;
    margin: 0 auto;
    background: var(--bg);
}
body.webview .auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    margin-bottom: 24px;
}
body.webview .auth-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
body.webview .auth-screen h1 {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0 0 6px;
}
body.webview .auth-sub {
    color: var(--muted);
    margin: 0 0 22px;
}

/* Fields */
body.webview .field {
    display: block;
    margin-bottom: 14px;
}
body.webview .field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}
body.webview .field input,
body.webview .field select,
body.webview .field textarea {
    width: 100%;
    padding: 13px 15px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    font-size: 1rem;
    outline: none;
    color: var(--text);
    -webkit-appearance: none;
    appearance: none;
}
body.webview .field input:focus,
body.webview .field select:focus,
body.webview .field textarea:focus {
    border-color: var(--brand);
    background: #fff;
}
body.webview .field-row {
    display: flex;
    gap: 10px;
}
body.webview .field-row > .field {
    flex: 1;
}

/* Buttons */
body.webview .btn--primary,
body.webview .btn--ghost,
body.webview .btn--danger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.1s, opacity 0.15s;
}
body.webview .btn--primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}
body.webview .btn--primary:active {
    transform: scale(0.98);
}
body.webview .btn--ghost {
    background: var(--surface);
    color: var(--text);
}
body.webview .btn--danger {
    background: #fee2e2;
    color: #b91c1c;
}
body.webview .btn--primary[disabled] {
    opacity: 0.55;
    pointer-events: none;
}
body.webview .btn--sm {
    padding: 10px 14px;
    font-size: 0.9rem;
}

/* Stepper */
body.webview .step {
    position: relative;
    padding-left: 42px;
}
body.webview .step__num {
    position: absolute;
    left: 0;
    top: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.9rem;
    border: 2px solid var(--line);
}
body.webview .step.is-done .step__num {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
body.webview .step__status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    margin-left: 6px;
    vertical-align: middle;
}
body.webview .step.is-done .step__status {
    background: #d1fae5;
    color: #065f46;
}

/* Progress bar */
body.webview .progress {
    height: 6px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    margin: 6px 0 10px;
}
body.webview .progress__bar {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

/* Countdown */
body.webview .countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 18px 0 10px;
}
body.webview .countdown__cell {
    background: var(--surface);
    border-radius: 14px;
    padding: 14px 6px;
    text-align: center;
}
body.webview .countdown__num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--brand-2);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
body.webview .countdown__lbl {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Muted / helper text */
body.webview .text-muted {
    color: var(--muted);
}
body.webview .center {
    text-align: center;
}
body.webview .mt-1 { margin-top: 8px; }
body.webview .mt-2 { margin-top: 16px; }
body.webview .mb-2 { margin-bottom: 16px; }

/* Override legacy alert boxes to match card style */
body.webview .alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin: 0 0 12px;
    font-size: 0.9rem;
}
body.webview .alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}
body.webview .alert-success,
body.webview .alert-info {
    background: #ecfeff;
    border: 1px solid #bae6fd;
    color: #075985;
}
body.webview .alert-warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

