﻿:root {
    --navy-950: #081a2c;
    --navy-900: #102a43;
    --navy-800: #173f5f;
    --blue-600: #0d8fa5;
    --blue-500: #21d4c2;
    --turquoise: #21d4c2;
    --turquoise-deep: #0ba6a0;
    --purple: #7c5cff;
    --purple-soft: #ede9ff;
    --coral: #ff5d73;
    --surface: #ffffff;
    --background: #f4f7fb;
    --border: #dfe7ef;
    --muted: #68798b;
    --green: #22a06b;
    --amber: #e99922;
    --shadow-sm: 0 8px 22px rgba(8, 26, 44, 0.07);
    --shadow: 0 18px 45px rgba(8, 26, 44, 0.09);
    --shadow-lg: 0 26px 70px rgba(8, 26, 44, 0.14);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --sidebar-width: 264px;
    --topbar-height: 78px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--navy-950);
    background: var(--background);
    font-family:
        Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.topbar {
    background: var(--navy-950);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
    display: flex;
    width: min(1180px, calc(100% - 40px));
    min-height: 74px;
    margin: auto;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: white;
    text-decoration: none;
}

.brand strong,
.brand small {
    display: block;
}

.edag-brand-logo {
    display: block;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.brand .edag-brand-logo {
    width: 108px;
}

.brand strong {
    letter-spacing: 0.12em;
}

.brand small {
    margin-top: 2px;
    color: #9db2c3;
    font-size: 0.7rem;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    color: var(--navy-950);
    background: linear-gradient(135deg, #27c7ec, white);
    font-weight: 900;
}

.system-status {
    display: flex;
    gap: 9px;
    align-items: center;
    color: #b9c7d2;
    font-size: 0.82rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #20b486;
    box-shadow: 0 0 0 5px rgba(32, 180, 134, 0.12);
}

.page-container {
    width: min(1180px, calc(100% - 40px));
    margin: auto;
    padding: 38px 0 60px;
}

.hero-panel {
    display: flex;
    gap: 32px;
    padding: 42px;
    align-items: center;
    justify-content: space-between;
    border-radius: 24px;
    color: white;
    background: linear-gradient(120deg, #071a2b, #0b4463);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--blue-500);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.hero-panel h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.04em;
}

.hero-copy {
    max-width: 650px;
    margin: 18px 0 0;
    color: #bfd0dc;
    line-height: 1.7;
}

.hero-badge {
    display: grid;
    min-width: 155px;
    padding: 24px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.07);
}

.hero-badge strong {
    font-size: 2.7rem;
}

.hero-badge span {
    color: #a9bfce;
    font-size: 0.78rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 28px;
}

.stat-card,
.content-panel {
    border: 1px solid var(--border);
    border-radius: 19px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stat-card {
    position: relative;
    min-height: 155px;
    padding: 25px;
    overflow: hidden;
}

.stat-card::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    height: 100%;
    content: "";
}

.stat-total::after { background: var(--blue-500); }
.stat-pending::after { background: var(--amber); }
.stat-synced::after { background: var(--green); }

.stat-label,
.stat-card small {
    display: block;
    color: var(--muted);
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    margin: 9px 0 6px;
    font-size: 2.6rem;
}

.content-panel {
    margin-top: 28px;
    padding: 28px;
}

.section-heading {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.45rem;
}

.primary-button {
    padding: 12px 18px;
    border: 0;
    border-radius: 11px;
    color: white;
    background: var(--blue-600);
    font-weight: 750;
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.table-wrapper {
    overflow-x: auto;
}

.contact-table {
    width: 100%;
    border-collapse: collapse;
}

.contact-table th,
.contact-table td {
    padding: 15px 14px;
    border-bottom: 1px solid #edf2f5;
    text-align: left;
}

.contact-table th {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sync-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 750;
    text-transform: capitalize;
}

.sync-pending {
    color: #905b00;
    background: #fff0cf;
}

.sync-synced {
    color: #087150;
    background: #dff8ed;
}

.empty-state {
    padding: 48px 20px;
    text-align: center;
}

.empty-state h3 {
    margin: 13px 0 7px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.empty-icon {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    color: var(--blue-600);
    background: #e7f5fd;
    font-size: 1.7rem;
}

@media (max-width: 760px) {
    .system-status { display: none; }

    .page-container {
        width: min(100% - 24px, 1180px);
        padding-top: 20px;
    }

    .hero-panel {
        align-items: stretch;
        flex-direction: column;
        padding: 28px 23px;
    }

    .hero-badge { min-width: 0; }

    .stat-grid { grid-template-columns: 1fr; }

    .content-panel { padding: 20px 14px; }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* AUTH-PAGES */

.user-navigation {
    display: flex;
    gap: 18px;
    align-items: center;
}

.user-details {
    text-align: right;
}

.user-details strong,
.user-details small {
    display: block;
}

.user-details strong {
    color: white;
    font-size: 0.85rem;
}

.user-details small {
    margin-top: 3px;
    color: #9db2c3;
    font-size: 0.7rem;
}

.logout-button {
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9px;
    color: white;
    background: transparent;
    cursor: pointer;
    font-weight: 700;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.auth-shell {
    display: grid;
    min-height: calc(100vh - 172px);
    place-items: center;
    padding: 28px 0;
}

.auth-card {
    width: min(100%, 470px);
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: white;
    box-shadow: var(--shadow);
}

.auth-heading {
    margin-bottom: 27px;
}

.auth-heading h1 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -0.035em;
}

.auth-heading p:not(.eyebrow) {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.form-group {
    display: grid;
    gap: 7px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 750;
}

.form-group input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #ccd8df;
    border-radius: 10px;
    outline: none;
    background: #fbfcfd;
    font: inherit;
}

.form-group input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(39, 168, 223, 0.12);
}

.auth-submit {
    margin-top: 5px;
    padding: 14px 18px;
    border: 0;
    border-radius: 11px;
    color: white;
    background: var(--blue-600);
    cursor: pointer;
    font-weight: 800;
}

.auth-submit:hover {
    background: #066a9b;
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.7;
}

.auth-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #f2b8b5;
    border-radius: 10px;
    color: #9d2924;
    background: #fff0ef;
    font-size: 0.83rem;
}

.auth-switch {
    margin: 24px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 0.84rem;
}

.auth-switch a {
    color: var(--blue-600);
    font-weight: 750;
    text-decoration: none;
}

@media (max-width: 600px) {
    .auth-card {
        padding: 28px 20px;
    }

    .user-details {
        display: none;
    }
}

/* SCANNER-PAGE */

.scan-nav-link {
    padding: 9px 14px;
    border-radius: 9px;
    color: white;
    background: var(--blue-600, #087cad);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.scanner-page {
    padding: 24px 0 50px;
}

.scanner-heading,
.preview-heading {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
}

.scanner-heading h1,
.preview-heading h2 {
    margin: 0;
    letter-spacing: -0.035em;
}

.scanner-heading > div > p:not(.eyebrow) {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--muted, #657884);
    line-height: 1.6;
}

.scanner-back-link {
    color: var(--blue-600, #087cad);
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
}

.scanner-status {
    margin: 24px 0;
    padding: 13px 16px;
    border: 1px solid #d5e0e6;
    border-radius: 11px;
    color: #38505e;
    background: #f4f8fa;
    font-size: 0.84rem;
}

.scanner-status[data-status-type="success"] {
    border-color: #a9d9bf;
    color: #17663c;
    background: #effaf4;
}

.scanner-status[data-status-type="error"] {
    border-color: #f0b8b5;
    color: #982e29;
    background: #fff1f0;
}

.scanner-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    align-items: start;
}

.scanner-panel,
.scanner-tips,
.preview-panel {
    border: 1px solid var(--border, #dce4e8);
    border-radius: 18px;
    background: white;
    box-shadow: var(--shadow, 0 12px 32px rgba(10, 37, 54, 0.08));
}

.scanner-panel {
    padding: 18px;
}

.camera-stage {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    background: #06131d;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 9px;
    color: #dce8ee;
    text-align: center;
}

.camera-placeholder[hidden],
.card-guide[hidden] {
    display: none;
}

.camera-placeholder span {
    color: #91a8b5;
    font-size: 0.78rem;
}

.camera-placeholder-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 4px;
    place-items: center;
    border: 1px solid #4a6676;
    border-radius: 50%;
    color: #50bce5;
    font-size: 1.8rem;
}

.card-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(84%, 620px);
    aspect-ratio: 1.586 / 1;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 10px;
    pointer-events: none;
}

.card-guide p {
    position: absolute;
    right: 0;
    bottom: -32px;
    left: 0;
    margin: 0;
    color: white;
    text-align: center;
    font-size: 0.72rem;
    text-shadow: 0 1px 4px black;
}

.guide-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: #43c7f4;
    border-style: solid;
}

.corner-top-left {
    top: -2px;
    left: -2px;
    border-width: 4px 0 0 4px;
    border-radius: 10px 0 0;
}

.corner-top-right {
    top: -2px;
    right: -2px;
    border-width: 4px 4px 0 0;
    border-radius: 0 10px 0 0;
}

.corner-bottom-left {
    bottom: -2px;
    left: -2px;
    border-width: 0 0 4px 4px;
    border-radius: 0 0 0 10px;
}

.corner-bottom-right {
    right: -2px;
    bottom: -2px;
    border-width: 0 4px 4px 0;
    border-radius: 0 0 10px;
}

.camera-actions,
.preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 17px;
}

#captureWorkspace {
    scroll-margin-top: calc(var(--topbar-height, 78px) + 28px);
}

#captureWorkspace:focus {
    outline: none;
}

.camera-stage.is-camera-error {
    box-shadow: 0 0 0 3px rgba(181, 60, 75, 0.24);
}

.scanner-message-dialog {
    width: min(92vw, 520px);
    margin: auto;
    padding: 28px;
    border: 1px solid #e1e8ed;
    border-radius: 20px;
    color: #102f49;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(5, 23, 39, 0.28);
}

.scanner-message-dialog[open] {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 17px;
    animation: scanner-dialog-enter 160ms ease-out;
}

.scanner-message-dialog::backdrop {
    background: rgba(5, 20, 34, 0.62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.system-confirm-dialog {
    width: min(92vw, 510px);
    margin: auto;
    padding: 28px;
    border: 1px solid #e1e8ed;
    border-radius: 20px;
    color: #102f49;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(5, 23, 39, 0.3);
}

.system-confirm-dialog[open] {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 17px;
    animation: scanner-dialog-enter 160ms ease-out;
}

.system-confirm-dialog.is-fallback {
    position: fixed;
    z-index: 10020;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.system-confirm-dialog::backdrop {
    background: rgba(5, 20, 34, 0.62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.system-confirm-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    color: var(--blue-600, #087cad);
    background: #eaf6fb;
}

.system-confirm-dialog[data-tone="danger"] .system-confirm-icon {
    color: #a63843;
    background: #fff0f1;
}

.system-confirm-dialog[data-tone="warning"] .system-confirm-icon {
    color: #a66b00;
    background: #fff5dc;
}

.system-confirm-icon svg {
    width: 25px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.system-confirm-copy h2 {
    margin: 4px 0 8px;
    font-size: 1.28rem;
    letter-spacing: -0.025em;
}

.system-confirm-copy > p:last-child {
    margin: 0;
    color: var(--muted, #657884);
    line-height: 1.6;
}

.system-confirm-actions {
    display: flex;
    grid-column: 1 / -1;
    gap: 10px;
    margin-top: 8px;
    justify-content: flex-end;
}

.system-confirm-dialog[data-tone="danger"] #systemConfirmAccept {
    border-color: #ad3543;
    background: #ad3543;
}

.system-confirm-dialog[data-tone="warning"] #systemConfirmAccept {
    border-color: #b97800;
    background: #b97800;
}

.scanner-dialog-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    color: #a63843;
    background: #fff0f1;
}

.scanner-dialog-icon svg {
    width: 25px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.scanner-dialog-copy h2 {
    margin: 4px 0 8px;
    font-size: 1.28rem;
    letter-spacing: -0.025em;
}

.scanner-dialog-copy > p:last-child {
    margin: 0;
    color: var(--muted, #657884);
    line-height: 1.6;
}

.scanner-dialog-actions {
    display: flex;
    grid-column: 1 / -1;
    gap: 10px;
    margin-top: 8px;
    justify-content: flex-end;
}

@keyframes scanner-dialog-enter {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.primary-action,
.secondary-action,
.gallery-action {
    display: inline-flex;
    min-height: 44px;
    padding: 11px 17px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
}

.primary-action {
    border: 1px solid var(--blue-600, #087cad);
    color: white;
    background: var(--blue-600, #087cad);
}

.secondary-action,
.gallery-action {
    border: 1px solid #cbd8df;
    color: #173445;
    background: white;
}

.primary-action:disabled,
.secondary-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.scanner-tips {
    padding: 24px;
}

.scanner-tips h2 {
    margin: 0;
    font-size: 1.15rem;
}

.scanner-tips ul {
    display: grid;
    gap: 13px;
    margin: 20px 0 0;
    padding-left: 20px;
    color: var(--muted, #657884);
    font-size: 0.82rem;
    line-height: 1.55;
}

.preview-panel {
    margin-top: 25px;
    padding: 22px;
}

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

.preview-frame {
    display: grid;
    overflow: hidden;
    min-height: 260px;
    margin-top: 18px;
    place-items: center;
    border-radius: 14px;
    background: #071722;
}

.preview-frame img {
    display: block;
    max-width: 100%;
    max-height: 620px;
    object-fit: contain;
}

.image-source-badge {
    padding: 7px 11px;
    border-radius: 999px;
    color: #17663c;
    background: #e8f7ef;
    font-size: 0.72rem;
    font-weight: 800;
}

.extract-action {
    margin-left: auto;
}

@media (max-width: 850px) {
    .scanner-grid {
        grid-template-columns: 1fr;
    }

    .scanner-tips {
        order: 2;
    }
}

@media (max-width: 600px) {
    .scan-nav-link {
        display: none;
    }

    .scanner-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .scanner-panel {
        padding: 10px;
    }

    .camera-stage {
        aspect-ratio: 4 / 5;
    }

    .card-guide {
        width: 92%;
    }

    .camera-actions,
    .preview-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .primary-action,
    .secondary-action,
    .gallery-action {
        width: 100%;
    }

    .extract-action {
        margin-left: 0;
    }

    .preview-panel {
        padding: 16px;
    }

    .scanner-message-dialog {
        padding: 22px;
    }

    .scanner-dialog-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .scanner-dialog-actions .primary-action,
    .scanner-dialog-actions .secondary-action {
        width: 100%;
    }

    .system-confirm-dialog {
        padding: 22px;
    }

    .system-confirm-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .system-confirm-actions .primary-action,
    .system-confirm-actions .secondary-action {
        width: 100%;
    }
}

/* OCR-EXTRACTION */

.ocr-result-panel {
    margin-top: 25px;
    padding: 22px;
    border: 1px solid var(--border, #dce4e8);
    border-radius: 18px;
    background: white;
    box-shadow:
        var(--shadow, 0 12px 32px rgba(10, 37, 54, 0.08));
}

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

.ocr-result-heading {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
}

.ocr-result-heading h2 {
    margin: 0;
    letter-spacing: -0.03em;
}

.ocr-result-heading > div > p:not(.eyebrow) {
    margin: 8px 0 0;
    color: var(--muted, #657884);
    font-size: 0.82rem;
    line-height: 1.55;
}

.ocr-confidence {
    flex-shrink: 0;
    padding: 7px 11px;
    border-radius: 999px;
    color: #075b7e;
    background: #e6f4fa;
    font-size: 0.72rem;
    font-weight: 800;
}

.ocr-progress {
    margin-top: 20px;
}

.ocr-progress-track {
    overflow: hidden;
    height: 9px;
    border-radius: 999px;
    background: #e3ebef;
}

.ocr-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--blue-600, #087cad);
    transition: width 180ms ease;
}

#ocrProgressText {
    display: block;
    margin-top: 8px;
    color: var(--muted, #657884);
    font-size: 0.75rem;
}

.ocr-text-label {
    display: block;
    margin-top: 20px;
    color: #173445;
    font-size: 0.78rem;
    font-weight: 800;
}

.ocr-raw-text {
    width: 100%;
    min-height: 230px;
    margin-top: 8px;
    padding: 15px;
    resize: vertical;
    border: 1px solid #cbd8df;
    border-radius: 11px;
    color: #173445;
    background: #f8fafb;
    font: 0.82rem/1.65 Consolas, monospace;
}

.ocr-raw-text:focus {
    border-color: var(--blue-600, #087cad);
    outline: 3px solid rgba(8, 124, 173, 0.12);
}

.ocr-result-actions {
    display: flex;
    gap: 11px;
    justify-content: flex-end;
    margin-top: 16px;
}

@media (max-width: 600px) {
    .ocr-result-panel {
        padding: 16px;
    }

    .ocr-result-heading {
        flex-direction: column;
    }

    .ocr-result-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ocr-result-actions button {
        width: 100%;
    }
}

/* REVIEW-CONTACT */

.review-contact-panel {
    margin-top: 25px;
    padding: 22px;
    border: 1px solid var(--border, #dce4e8);
    border-radius: 18px;
    background: white;
    box-shadow:
        var(--shadow, 0 12px 32px rgba(10, 37, 54, 0.08));
}

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

.review-contact-heading {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
}

.review-contact-heading h2 {
    margin: 0;
    letter-spacing: -0.03em;
}

.review-contact-heading > div > p:not(.eyebrow) {
    max-width: 650px;
    margin: 8px 0 0;
    color: var(--muted, #657884);
    font-size: 0.82rem;
    line-height: 1.55;
}

.review-status-badge {
    flex-shrink: 0;
    padding: 7px 11px;
    border-radius: 999px;
    color: #17663c;
    background: #e8f7ef;
    font-size: 0.72rem;
    font-weight: 800;
}

.review-status-badge.is-ready {
    color: #17663c;
    background: #e8f7ef;
}

.review-status-badge.is-warning {
    color: #8a5a00;
    background: #fff3d6;
}

.review-status-badge.is-error {
    color: #9b3038;
    background: #fff0f1;
}

.review-validation-summary {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid #dce6eb;
    border-radius: 11px;
    color: #486176;
    background: #f7fafb;
    font-size: 0.8rem;
    line-height: 1.5;
}

.review-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
    margin-top: 24px;
}

.review-field {
    display: grid;
    gap: 7px;
}

.review-field-full {
    grid-column: 1 / -1;
}

.review-field label {
    color: #173445;
    font-size: 0.77rem;
    font-weight: 800;
}

.review-field input,
.review-field textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cbd8df;
    border-radius: 10px;
    color: #173445;
    background: white;
    font: inherit;
    font-size: 0.82rem;
}

.review-field-status {
    min-height: 17px;
    color: #718694;
    font-size: 0.7rem;
    line-height: 1.4;
}

.review-field[data-validation-state="valid"] input,
.review-field[data-validation-state="valid"] textarea {
    border-color: #9ed5b9;
    background: #fbfffd;
}

.review-field[data-validation-state="valid"] .review-field-status {
    color: #28714a;
}

.review-field[data-validation-state="warning"] input,
.review-field[data-validation-state="warning"] textarea {
    border-color: #e7c36c;
    background: #fffdf7;
}

.review-field[data-validation-state="warning"] .review-field-status {
    color: #8a5a00;
}

.review-field[data-validation-state="error"] input,
.review-field[data-validation-state="error"] textarea {
    border-color: #dc8e95;
    background: #fffafa;
}

.review-field[data-validation-state="error"] .review-field-status {
    color: #9b3038;
    font-weight: 700;
}

.review-field textarea {
    resize: vertical;
    line-height: 1.55;
}

.review-field input:focus,
.review-field textarea:focus {
    border-color: var(--blue-600, #087cad);
    outline: 3px solid rgba(8, 124, 173, 0.12);
}

#reviewOcrText {
    color: #526976;
    background: #f5f8fa;
    font-family: Consolas, monospace;
}

.review-form-actions {
    display: flex;
    gap: 11px;
    justify-content: flex-end;
    margin-top: 20px;
}

@media (max-width: 650px) {
    .review-contact-panel {
        padding: 16px;
    }

    .review-contact-heading {
        flex-direction: column;
    }

    .review-form-grid {
        grid-template-columns: 1fr;
    }

    .review-field-full {
        grid-column: auto;
    }

    .review-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .review-form-actions button {
        width: 100%;
    }
}

/* APP SHELL V2 ---------------------------------------------------------- */

button,
a,
input,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button,
a {
    transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease,
        opacity 180ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(33, 212, 194, 0.34);
    outline-offset: 3px;
}

.scanner-help {
    margin-top: 22px;
    padding-top: 17px;
    border-top: 1px solid #e5edf2;
}

.scanner-help summary {
    min-height: 44px;
    padding: 12px 0;
    color: #146873;
    font-size: 0.72rem;
    font-weight: 850;
    cursor: pointer;
}

.scanner-help ol {
    margin: 6px 0 0;
    padding-left: 21px;
    color: #5f7484;
    font-size: 0.7rem;
    line-height: 1.65;
}

.scanner-help p {
    margin: 12px 0 0;
    color: #6d8190;
    font-size: 0.68rem;
    line-height: 1.55;
}

.directory-empty-action {
    width: max-content;
    margin: 18px auto 0;
}

.directory-view-button,
.directory-refresh {
    min-height: 44px;
}

@media (max-width: 700px) {
    .directory-table-wrap,
    .recent-contact-card .table-wrapper {
        overflow: visible;
    }

    .directory-table,
    .dashboard-contact-table {
        min-width: 0;
    }

    .directory-table thead,
    .dashboard-contact-table thead {
        display: none;
    }

    .directory-table tbody,
    .dashboard-contact-table tbody {
        display: grid;
        padding: 12px;
        gap: 12px;
    }

    .directory-table tbody tr,
    .dashboard-contact-table tbody tr {
        display: block;
        overflow: hidden;
        border: 1px solid #dce6ed;
        border-radius: 14px;
        background: white;
    }

    .directory-table tbody td,
    .dashboard-contact-table tbody td {
        display: grid;
        max-width: none;
        padding: 10px 13px;
        grid-template-columns: minmax(105px, .75fr) minmax(0, 1.25fr);
        gap: 12px;
        align-items: center;
        border-bottom: 1px solid #edf1f4;
        text-align: right;
    }

    .directory-table tbody td::before,
    .dashboard-contact-table tbody td::before {
        color: #718292;
        content: attr(data-label);
        font-size: .61rem;
        font-weight: 850;
        letter-spacing: .05em;
        text-align: left;
        text-transform: uppercase;
    }

    .directory-table tbody td:last-child,
    .dashboard-contact-table tbody td:last-child {
        border-bottom: 0;
    }

    .directory-table td > strong,
    .directory-table td > small,
    .directory-table td > a,
    .directory-contact-cell strong {
        max-width: none;
    }

    .directory-contact-cell {
        min-width: 0;
        justify-content: flex-end;
        text-align: left;
    }

    .directory-view-button {
        justify-self: end;
    }

    .directory-skeleton-row td::before {
        content: "";
    }
}

svg {
    display: block;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2000;
    padding: 10px 14px;
    border-radius: 10px;
    color: white;
    background: var(--navy-950);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.has-app-shell {
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 72% -10%, rgba(124, 92, 255, 0.11), transparent 31rem),
        radial-gradient(circle at 22% 12%, rgba(33, 212, 194, 0.09), transparent 27rem),
        var(--background);
}

.app-frame {
    display: grid;
    min-height: 100vh;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.app-sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    height: 100vh;
    padding: 22px 18px 18px;
    flex-direction: column;
    overflow: hidden;
    color: white;
    background:
        radial-gradient(circle at 20% 12%, rgba(33, 212, 194, 0.14), transparent 15rem),
        radial-gradient(circle at 120% 80%, rgba(124, 92, 255, 0.2), transparent 20rem),
        var(--navy-950);
    box-shadow: 16px 0 42px rgba(8, 26, 44, 0.11);
}

.app-sidebar::after {
    position: absolute;
    right: 0;
    bottom: 12%;
    width: 2px;
    height: 42%;
    border-radius: 99px;
    content: "";
    background: linear-gradient(transparent, var(--turquoise), var(--purple), transparent);
    opacity: 0.45;
}

.sidebar-brand,
.mobile-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sidebar-brand {
    margin: 0 8px 34px;
    color: white;
    text-decoration: none;
}

.brand-mark {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 13px;
    color: var(--navy-950);
    background: linear-gradient(135deg, #ffffff 4%, var(--turquoise) 52%, #8a70ff 120%);
    box-shadow: 0 8px 24px rgba(33, 212, 194, 0.22);
    font-size: 1.05rem;
    font-weight: 950;
}

.brand-copy strong,
.brand-copy small,
.mobile-brand strong,
.mobile-brand small {
    display: block;
}

.sidebar-brand .edag-brand-logo {
    width: 116px;
}

.mobile-brand .edag-brand-logo {
    width: 78px;
}

.brand-copy strong,
.mobile-brand strong {
    letter-spacing: 0.15em;
}

.brand-copy small {
    margin-top: 3px;
    color: #9db1c2;
    font-size: 0.67rem;
}

.sidebar-navigation {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
}

.nav-section-label {
    margin: 0 13px 10px;
    color: #7290a7;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.nav-section-spaced {
    margin-top: 28px;
}

.nav-item {
    position: relative;
    display: flex;
    min-height: 48px;
    margin: 5px 0;
    padding: 0 13px;
    gap: 12px;
    align-items: center;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 14px;
    color: #aebfcb;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-item svg,
.sidebar-logout svg,
.profile-menu svg,
.sheet-action svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
    border-color: rgba(33, 212, 194, 0.2);
    color: white;
    background: linear-gradient(110deg, rgba(33, 212, 194, 0.17), rgba(124, 92, 255, 0.13));
    box-shadow: inset 3px 0 0 var(--turquoise);
}

.nav-item.is-active svg {
    color: var(--turquoise);
}

.nav-pulse {
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--turquoise);
    box-shadow: 0 0 0 5px rgba(33, 212, 194, 0.1);
}

.role-chip {
    margin-left: auto;
    padding: 4px 7px;
    border: 1px solid rgba(124, 92, 255, 0.32);
    border-radius: 999px;
    color: #cfc5ff;
    background: rgba(124, 92, 255, 0.12);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-footer {
    display: flex;
    padding: 15px 10px 0;
    gap: 8px;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: flex;
    min-width: 0;
    gap: 10px;
    align-items: center;
    flex: 1;
}

.user-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid rgba(33, 212, 194, 0.3);
    border-radius: 12px;
    color: #bffbf4;
    background: linear-gradient(135deg, rgba(33, 212, 194, 0.2), rgba(124, 92, 255, 0.28));
    font-size: 0.88rem;
    font-weight: 900;
}

.sidebar-user-copy {
    min-width: 0;
}

.sidebar-user-copy strong,
.sidebar-user-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-copy strong {
    font-size: 0.74rem;
}

.sidebar-user-copy small {
    margin-top: 4px;
    color: #7895aa;
    font-size: 0.61rem;
}

.sidebar-logout {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 11px;
    color: #8ca4b5;
    background: transparent;
    cursor: pointer;
}

.sidebar-logout:hover {
    color: white;
    background: rgba(255, 93, 115, 0.15);
}

.app-main {
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    min-height: var(--topbar-height);
    padding: 0 clamp(22px, 3vw, 42px);
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(215, 225, 235, 0.82);
    background: rgba(248, 250, 253, 0.82);
    box-shadow: 0 7px 28px rgba(8, 26, 44, 0.04);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.mobile-brand {
    display: none;
}

.page-identity {
    display: grid;
    gap: 4px;
}

.topbar-kicker {
    color: var(--muted);
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.page-identity strong {
    font-size: 1.08rem;
    letter-spacing: -0.02em;
}

.topbar-actions {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: center;
}

.connection-pill {
    display: flex;
    min-height: 36px;
    padding: 0 12px;
    gap: 8px;
    align-items: center;
    border: 1px solid #d8e5e2;
    border-radius: 999px;
    color: #247457;
    background: rgba(255, 255, 255, 0.76);
    font-size: 0.69rem;
    font-weight: 800;
}

.connection-pill .status-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.connection-pill.is-offline {
    border-color: #f1c6cd;
    color: #aa3447;
}

.connection-pill.is-offline .status-dot {
    background: var(--coral);
    box-shadow: 0 0 0 4px rgba(255, 93, 115, 0.12);
}

.profile-trigger {
    display: flex;
    min-width: 190px;
    padding: 7px 9px;
    gap: 9px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--navy-950);
    background: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.profile-trigger:hover {
    border-color: #b8dcd8;
    transform: translateY(-1px);
}

.profile-trigger .user-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    color: var(--navy-800);
    background: linear-gradient(135deg, #d9fbf7, #e7e1ff);
}

.profile-trigger-copy {
    min-width: 0;
    flex: 1;
}

.profile-trigger-copy strong,
.profile-trigger-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-trigger-copy strong {
    font-size: 0.72rem;
}

.profile-trigger-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.62rem;
}

.profile-trigger > svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 80;
    width: 245px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
    box-shadow: var(--shadow-lg);
    animation: menu-in 160ms ease both;
}

.profile-menu[hidden] {
    display: none;
}

.profile-menu-header {
    padding: 16px;
    border-bottom: 1px solid #edf1f5;
}

.profile-menu-header strong,
.profile-menu-header span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu-header strong {
    font-size: 0.8rem;
}

.profile-menu-header span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.68rem;
}

.profile-menu button,
.profile-menu > a {
    display: flex;
    width: 100%;
    padding: 13px 16px;
    gap: 10px;
    align-items: center;
    border: 0;
    color: #b03649;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 750;
}

.profile-menu > a {
    color: #25435a;
    text-decoration: none;
}

.profile-menu button:hover,
.profile-menu > a:hover {
    background: #fff3f5;
}

.profile-menu > a:hover {
    color: var(--turquoise-deep);
    background: #eefaf8;
}

/* My Account */
.account-page {
    max-width: 1396px;
    margin: 0 auto;
}

.account-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 30px 34px;
    gap: 20px;
    align-items: center;
    border: 1px solid #dbe6ed;
    border-radius: 22px;
    background: linear-gradient(115deg, #ffffff 0%, #f1fbfa 100%);
    box-shadow: 0 18px 45px rgba(17, 48, 72, 0.08);
}

.account-hero-avatar {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    border-radius: 18px;
    color: white;
    background: linear-gradient(145deg, #12b7ad, #087d85);
    font-size: 1.5rem;
    font-weight: 850;
}

.account-hero h1 {
    margin: 3px 0 5px;
    color: var(--navy-950);
    font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.account-hero p:last-child,
.account-card-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.account-role-badge {
    padding: 10px 14px;
    border-radius: 999px;
    color: #08716d;
    background: #dcf7f3;
    font-size: 0.72rem;
    font-weight: 850;
}

.account-message {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #b9e8d4;
    border-radius: 12px;
    color: #087150;
    background: #eafaf3;
    font-size: 0.78rem;
    font-weight: 700;
}

.account-message.is-error {
    border-color: #ffc2c9;
    color: #a52f42;
    background: #fff0f2;
}

.account-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
    margin-top: 22px;
    gap: 22px;
    align-items: start;
}

.account-main-column,
.account-side-column {
    display: grid;
    gap: 22px;
}

.account-card {
    padding: 26px;
    border: 1px solid #dbe6ed;
    border-radius: 19px;
    background: white;
    box-shadow: 0 14px 34px rgba(17, 48, 72, 0.06);
}

.account-card-heading {
    display: flex;
    gap: 16px;
    align-items: start;
    justify-content: space-between;
}

.account-card-heading h2 {
    margin: 4px 0 0;
    color: var(--navy-950);
    font-size: 1.03rem;
}

.account-card-heading > span {
    color: var(--muted);
    font-size: 0.67rem;
}

.account-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 22px 0 0;
    gap: 12px;
}

.account-detail-grid > div,
.account-request-details > div {
    padding: 14px;
    border-radius: 12px;
    background: #f5f8fa;
}

.account-detail-grid dt,
.account-request-details dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.account-detail-grid dd,
.account-request-details dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #17364c;
    font-size: 0.78rem;
    font-weight: 750;
    line-height: 1.45;
}

.account-password-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 22px;
    gap: 13px;
}

.account-password-form label,
.account-session-password {
    display: grid;
    gap: 7px;
    color: #354f61;
    font-size: 0.7rem;
    font-weight: 800;
}

.account-password-form input,
.account-session-password input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #d0dce5;
    border-radius: 10px;
    outline: none;
    font: inherit;
}

.account-password-form input:focus,
.account-session-password input:focus {
    border-color: var(--turquoise-deep);
    box-shadow: 0 0 0 4px rgba(33, 212, 194, 0.1);
}

.account-password-form .primary-button {
    grid-column: 1 / -1;
    justify-self: start;
}

.account-request-status {
    display: flex;
    margin-top: 20px;
    padding: 14px;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px;
    color: #8a5a00;
    background: #fff2d5;
}

.account-request-status span {
    font-size: 0.68rem;
    font-weight: 800;
}

.account-request-status strong {
    font-size: 0.8rem;
}

.account-request-status.status-approved {
    color: #087150;
    background: #e3f8ef;
}

.account-request-status.status-rejected,
.account-request-status.status-cancelled {
    color: #7b5660;
    background: #f5ecef;
}

.account-request-details {
    display: grid;
    margin: 12px 0;
    gap: 9px;
}

.account-secondary-button,
.account-danger-button {
    display: inline-flex;
    min-height: 44px;
    padding: 0 14px;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd9e3;
    border-radius: 10px;
    color: #25435a;
    background: white;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.account-danger-card {
    border-color: #f0d9dd;
}

.account-danger-card .account-card-copy {
    margin: 14px 0;
}

.account-danger-button {
    width: 100%;
    margin-top: 12px;
    border-color: #efb8c1;
    color: #a52f42;
    background: #fff7f8;
}

.account-secondary-button:disabled,
.account-danger-button:disabled {
    opacity: 0.55;
    cursor: wait;
}

@media (max-width: 900px) {
    .account-layout {
        grid-template-columns: 1fr;
    }

    .account-password-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .account-hero {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 22px;
    }

    .account-role-badge {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .account-detail-grid {
        grid-template-columns: 1fr;
    }

    .account-card {
        padding: 20px;
    }
}

.connection-banner {
    padding: 10px 24px;
    color: #7d2b39;
    background: #fff0f2;
    border-bottom: 1px solid #f6ccd3;
    text-align: center;
    font-size: 0.73rem;
    font-weight: 700;
}

.connection-banner[hidden] {
    display: none;
}

.has-app-shell .page-container {
    width: min(100%, 1480px);
    margin: 0 auto;
    padding: clamp(24px, 3vw, 42px);
}

.has-app-shell .hero-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        radial-gradient(circle at 82% 18%, rgba(124, 92, 255, 0.44), transparent 16rem),
        radial-gradient(circle at 22% 125%, rgba(33, 212, 194, 0.25), transparent 19rem),
        linear-gradient(125deg, #081a2c, #103c56 62%, #1b3158);
    box-shadow: 0 24px 60px rgba(8, 26, 44, 0.18);
}

.has-app-shell .hero-panel::after {
    position: absolute;
    top: -80%;
    left: 58%;
    z-index: -1;
    width: 280px;
    height: 420px;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: rotate(28deg);
}

.has-app-shell .eyebrow {
    color: var(--turquoise-deep);
}

.has-app-shell .hero-panel .eyebrow {
    color: #6ff0e2;
}

.has-app-shell .stat-card,
.has-app-shell .content-panel,
.has-app-shell .scanner-panel,
.has-app-shell .scanner-tips,
.has-app-shell .preview-panel,
.has-app-shell .ocr-result-panel,
.has-app-shell .review-contact-panel {
    border-color: rgba(215, 225, 235, 0.9);
    box-shadow: var(--shadow-sm);
}

.has-app-shell .stat-card:hover,
.has-app-shell .content-panel:hover {
    border-color: #c6ddd9;
    box-shadow: var(--shadow);
}

.primary-button,
.primary-action,
.auth-submit {
    background: linear-gradient(120deg, var(--turquoise-deep), #158ba7 50%, var(--purple));
    box-shadow: 0 9px 24px rgba(13, 143, 165, 0.19);
}

.primary-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.primary-button:hover:not(:disabled),
.primary-action:hover:not(:disabled),
.auth-submit:hover:not(:disabled) {
    box-shadow: 0 12px 30px rgba(13, 143, 165, 0.28);
    transform: translateY(-2px);
}

.mobile-navigation,
.mobile-sheet,
.mobile-sheet-backdrop {
    display: none;
}

.toast-region {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    display: grid;
    width: min(370px, calc(100vw - 40px));
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--turquoise-deep);
    border-radius: 13px;
    color: var(--navy-950);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-lg);
    font-size: 0.78rem;
    line-height: 1.5;
    pointer-events: auto;
    animation: toast-in 220ms ease both;
}

.public-layout {
    min-height: 100vh;
    background:
        radial-gradient(circle at 85% 8%, rgba(124, 92, 255, 0.16), transparent 28rem),
        radial-gradient(circle at 10% 88%, rgba(33, 212, 194, 0.16), transparent 28rem),
        #f4f7fb;
}

.public-topbar {
    background:
        radial-gradient(circle at 30% -100%, rgba(33, 212, 194, 0.25), transparent 24rem),
        var(--navy-950);
}

.public-container {
    position: relative;
}

.public-layout .auth-card {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-lg);
}

@keyframes menu-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
    :root {
        --sidebar-width: 232px;
    }

    .app-sidebar {
        padding-right: 13px;
        padding-left: 13px;
    }

    .sidebar-brand {
        margin-right: 5px;
        margin-left: 5px;
    }

    .connection-pill {
        display: none;
    }
}

@media (max-width: 800px) {
    .has-app-shell {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .app-frame {
        display: block;
        min-height: auto;
    }

    .app-sidebar {
        display: none;
    }

    .app-topbar {
        min-height: 68px;
        padding:
            max(10px, env(safe-area-inset-top))
            16px
            10px;
    }

    .mobile-brand {
        display: flex;
    }

    .mobile-brand .brand-mark {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 11px;
        font-size: 0.9rem;
    }

    .mobile-brand strong {
        font-size: 0.76rem;
    }

    .mobile-brand small {
        margin-top: 2px;
        color: var(--muted);
        font-size: 0.6rem;
    }

    .page-identity,
    .profile-trigger-copy,
    .profile-trigger > svg {
        display: none;
    }

    .profile-trigger {
        min-width: 0;
        padding: 2px;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .profile-trigger .user-avatar {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .profile-menu {
        display: none !important;
    }

    .has-app-shell .page-container {
        padding: 20px 14px 28px;
    }

    .has-app-shell .hero-panel {
        border-radius: 21px;
    }

    .mobile-navigation {
        position: fixed;
        right: 10px;
        bottom: 8px;
        left: 10px;
        z-index: 100;
        display: grid;
        min-height: 66px;
        padding:
            7px
            7px
            max(7px, env(safe-area-inset-bottom));
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: end;
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 22px;
        background: rgba(8, 26, 44, 0.95);
        box-shadow: 0 18px 42px rgba(8, 26, 44, 0.32);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .mobile-nav-item {
        display: grid;
        min-width: 0;
        min-height: 48px;
        padding: 5px 2px;
        place-items: center;
        gap: 3px;
        border: 0;
        border-radius: 12px;
        color: #7f9aae;
        background: transparent;
        cursor: pointer;
        font: inherit;
        text-decoration: none;
    }

    .mobile-nav-item svg {
        width: 21px;
        height: 21px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-nav-item span {
        max-width: 100%;
        overflow: hidden;
        font-size: 0.56rem;
        font-weight: 750;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav-item.is-active,
    .mobile-nav-item:hover {
        color: #87f3e8;
        background: rgba(33, 212, 194, 0.07);
    }

    .mobile-scan-action {
        position: relative;
        display: grid;
        min-height: 55px;
        place-items: center;
        gap: 2px;
        color: white;
        text-decoration: none;
        transform: translateY(-18px);
    }

    .mobile-scan-action > span {
        display: grid;
        width: 54px;
        height: 54px;
        place-items: center;
        border: 5px solid var(--navy-950);
        border-radius: 19px;
        background: linear-gradient(135deg, var(--turquoise), var(--purple));
        box-shadow: 0 10px 25px rgba(33, 212, 194, 0.3);
    }

    .mobile-scan-action svg {
        width: 25px;
        height: 25px;
        fill: none;
        stroke: white;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-scan-action small {
        color: #a8bdca;
        font-size: 0.56rem;
        font-weight: 800;
    }

    .mobile-scan-action.is-active > span {
        box-shadow:
            0 0 0 5px rgba(33, 212, 194, 0.14),
            0 12px 30px rgba(33, 212, 194, 0.38);
    }

    .mobile-sheet-backdrop {
        position: fixed;
        inset: 0;
        z-index: 180;
        display: block;
        background: rgba(4, 14, 24, 0.56);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    .mobile-sheet-backdrop[hidden] {
        display: none;
    }

    .mobile-sheet {
        position: fixed;
        right: 10px;
        bottom: 10px;
        left: 10px;
        z-index: 190;
        display: block;
        padding: 10px 16px max(18px, env(safe-area-inset-bottom));
        border: 1px solid rgba(255, 255, 255, 0.13);
        border-radius: 24px;
        color: white;
        background:
            radial-gradient(circle at 90% 0, rgba(124, 92, 255, 0.2), transparent 14rem),
            var(--navy-950);
        box-shadow: 0 25px 65px rgba(4, 14, 24, 0.5);
        transform: translateY(calc(100% + 24px));
        transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .mobile-sheet.is-open {
        transform: translateY(0);
    }

    .sheet-handle {
        width: 38px;
        height: 4px;
        margin: 0 auto 18px;
        border-radius: 99px;
        background: #476174;
    }

    .sheet-user {
        display: flex;
        padding: 5px 2px 18px;
        gap: 11px;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    }

    .sheet-user > div {
        min-width: 0;
        flex: 1;
    }

    .sheet-user strong,
    .sheet-user span {
        display: block;
    }

    .sheet-user strong {
        font-size: 0.82rem;
    }

    .sheet-user > div span {
        margin-top: 4px;
        overflow: hidden;
        color: #8fa7b8;
        font-size: 0.66rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sheet-role {
        padding: 5px 8px;
        border-radius: 99px;
        color: #c9fff9;
        background: rgba(33, 212, 194, 0.12);
        font-size: 0.58rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    .sheet-action {
        display: flex;
        width: 100%;
        min-height: 48px;
        margin-top: 10px;
        padding: 0 12px;
        gap: 11px;
        align-items: center;
        border: 0;
        border-radius: 12px;
        color: #ff9ead;
        background: rgba(255, 93, 115, 0.08);
        cursor: pointer;
        font: inherit;
        font-size: 0.78rem;
        font-weight: 750;
    }

    body.sheet-open {
        overflow: hidden;
    }

    .toast-region {
        right: 14px;
        bottom: calc(94px + env(safe-area-inset-bottom));
        left: 14px;
        width: auto;
    }
}

@media (max-width: 430px) {
    .has-app-shell .hero-panel {
        padding: 26px 20px;
    }

    .has-app-shell .hero-panel h1 {
        font-size: 2rem;
    }

    .mobile-navigation {
        right: 7px;
        bottom: 6px;
        left: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* PROFESSIONAL DASHBOARD, DIRECTORY AND AUTH EXPERIENCE ---------------- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.primary-button svg,
.secondary-button svg,
.text-action svg,
.directory-scan-button svg,
.directory-refresh svg,
.directory-view-button svg,
.contact-drawer svg,
.dashboard-stat svg,
.masterlist-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.primary-button,
.secondary-button,
.text-action {
    gap: 9px;
}

.secondary-button {
    display: inline-flex;
    min-height: 42px;
    padding: 0 17px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d5e0e8;
    border-radius: 11px;
    color: var(--navy-900);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-sm);
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
}

.secondary-button:hover {
    border-color: #abd9d4;
    background: white;
    transform: translateY(-2px);
}

/* Dashboard */

.dashboard-welcome {
    position: relative;
    display: flex;
    min-height: 176px;
    padding: clamp(28px, 4vw, 42px);
    gap: 28px;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: white;
    background:
        radial-gradient(circle at 86% 20%, rgba(124, 92, 255, 0.45), transparent 16rem),
        radial-gradient(circle at 18% 140%, rgba(33, 212, 194, 0.25), transparent 20rem),
        linear-gradient(125deg, #081a2c, #103c56 62%, #1b3158);
    box-shadow: 0 24px 60px rgba(8, 26, 44, 0.18);
}

.dashboard-welcome::after {
    position: absolute;
    top: -160px;
    right: 21%;
    width: 100px;
    height: 480px;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: rotate(31deg);
}

.dashboard-welcome > * {
    position: relative;
    z-index: 1;
}

.dashboard-welcome .eyebrow {
    color: #72f2e4;
}

.dashboard-welcome h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.045em;
}

.dashboard-welcome p:not(.eyebrow) {
    max-width: 650px;
    margin: 13px 0 0;
    color: #bdd0dd;
    line-height: 1.65;
}

.dashboard-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 11px;
}

.dashboard-actions .secondary-button {
    border-color: rgba(255, 255, 255, 0.18);
    color: white;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.dashboard-stat {
    position: relative;
    display: block;
    min-width: 0;
    min-height: 136px;
    padding: 22px 72px 22px 24px;
    overflow: hidden;
    border: 1px solid rgba(215, 225, 235, 0.92);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.dashboard-stat::after {
    content: none;
}

.dashboard-stat-icon {
    display: grid;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 43px;
    height: 43px;
    place-items: center;
    border-radius: 11px;
    color: var(--blue-600);
    background: #e7f7f6;
}

.dashboard-stat-icon svg {
    width: 21px;
    height: 21px;
}

.dashboard-stat > div {
    min-width: 0;
}

.stat-pending .dashboard-stat-icon {
    color: #ad6b04;
    background: #fff4dc;
}

.stat-synced .dashboard-stat-icon {
    color: #12815d;
    background: #e0f8ee;
}

.stat-today .dashboard-stat-icon {
    color: #674ee0;
    background: #eeeaff;
}

.dashboard-stat small,
.dashboard-stat span {
    display: block;
}

.dashboard-stat small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dashboard-stat strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 2rem;
    letter-spacing: -0.04em;
    line-height: 1;
}

.dashboard-stat span:not(.dashboard-stat-icon) {
    color: #82909d;
    font-size: 0.66rem;
    line-height: 1.4;
}

/* Keep the icon centred. This must come after the general
   `.dashboard-stat span { display: block; }` rule above. */
.dashboard-stat span.dashboard-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 0;
}

.dashboard-stat span.dashboard-stat-icon > svg {
    display: block;
    margin: 0;
    flex: 0 0 21px;
    transform: none;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
    gap: 20px;
    margin-top: 20px;
}

.admin-action-centre {
    margin-top: 22px;
    padding: 24px;
    border: 1px solid #dbe6ed;
    border-radius: 19px;
    background: white;
    box-shadow: 0 14px 34px rgba(17, 48, 72, 0.06);
}

.admin-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    margin-top: 18px;
    gap: 12px;
}

.admin-action-card {
    position: relative;
    display: grid;
    min-height: 142px;
    padding: 18px;
    align-content: start;
    overflow: hidden;
    border: 1px solid #e1e9ee;
    border-radius: 15px;
    color: #17364c;
    background: #f8fafb;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.admin-action-card::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: #0ea59e;
    content: "";
}

.admin-action-card:hover,
.admin-action-card:focus-visible {
    border-color: #9eddd8;
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(17, 48, 72, 0.09);
}

.admin-action-card span {
    color: #536b7b;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-action-card strong {
    margin-top: 8px;
    color: var(--navy-950);
    font-size: 1.8rem;
}

.admin-action-card small {
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.45;
}

.admin-action-card.action-pending::after { background: #e6a100; }
.admin-action-card.action-update::after { background: #3478cf; }
.admin-action-card.action-failed::after { background: #c74659; }
.admin-action-card.action-duplicate::after { background: #7458c5; }
.admin-action-card.action-request::after { background: #0c9d83; }

.contact-admin-actions p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.5;
}

.contact-admin-actions p.is-reviewed {
    padding: 10px 12px;
    border-radius: 10px;
    color: #087150;
    background: #e5f8ef;
}

.contact-admin-actions button {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #b8d6db;
    border-radius: 10px;
    color: #146873;
    background: #f2fbfb;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 850;
    cursor: pointer;
}

.contact-admin-actions button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.contact-admin-action-success,
.contact-admin-action-error {
    margin: 0 0 14px;
    padding: 11px 13px;
    border-radius: 10px;
    color: #087150;
    background: #e7f8ef;
    font-size: 0.72rem;
    line-height: 1.5;
}

.contact-admin-action-error {
    color: #a52f42;
    background: #fff0f2;
}

.dashboard-card,
.directory-panel {
    border: 1px solid rgba(215, 225, 235, 0.92);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-sm);
}

.dashboard-card {
    padding: 25px;
}

.dashboard-card-heading {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
}

.dashboard-card-heading h2,
.masterlist-sync-intro h2 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.dashboard-card-heading > span {
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--muted);
    background: #f1f5f8;
    font-size: 0.65rem;
    font-weight: 750;
}

.activity-chart {
    display: grid;
    height: 214px;
    margin-top: 27px;
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: clamp(8px, 2vw, 18px);
    align-items: end;
}

.activity-column {
    display: grid;
    min-width: 0;
    gap: 7px;
    justify-items: center;
}

.activity-column > strong {
    color: #4d6071;
    font-size: 0.68rem;
}

.activity-column > small {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 750;
}

.activity-track {
    position: relative;
    width: min(30px, 72%);
    height: 150px;
    overflow: hidden;
    border-radius: 9px;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 36px,
            rgba(211, 222, 231, 0.6) 37px,
            transparent 38px
        ),
        #f4f7f9;
}

.activity-track span {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 4px;
    height: var(--activity-height);
    border-radius: 9px;
    background: linear-gradient(180deg, var(--purple), var(--turquoise-deep));
    box-shadow: 0 -6px 18px rgba(33, 212, 194, 0.2);
}

.system-health {
    display: inline-flex !important;
    gap: 6px;
    align-items: center;
    color: #187354 !important;
    background: #e5f7ef !important;
}

.system-health i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22a06b;
    box-shadow: 0 0 0 4px rgba(34, 160, 107, 0.12);
}

.system-metric-list {
    display: grid;
    margin-top: 22px;
    border-top: 1px solid #edf1f4;
}

.system-metric-list > div {
    display: flex;
    min-height: 47px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #edf1f4;
}

.system-metric-list span {
    color: var(--muted);
    font-size: 0.73rem;
}

.system-metric-list strong {
    font-size: 0.9rem;
}

.latest-sync {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #e1e8ef;
    border-radius: 14px;
    background: #f8fafc;
}

.latest-sync span,
.latest-sync strong,
.latest-sync small {
    display: block;
}

.latest-sync span {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.latest-sync strong {
    margin-top: 7px;
    font-size: 0.86rem;
}

.latest-sync small {
    margin-top: 4px;
    color: #71808e;
    font-size: 0.65rem;
    line-height: 1.5;
}

.masterlist-sync-panel,
.recent-contact-card {
    margin-top: 20px;
}

.masterlist-sync-intro {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 17px;
    align-items: center;
}

.masterlist-sync-intro p:not(.eyebrow) {
    max-width: 700px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.55;
}

.masterlist-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    color: #13806f;
    background: #e2f7f3;
}

.masterlist-sync-result {
    margin-top: 20px;
    padding: 17px;
    border: 1px solid #a9d8c0;
    border-radius: 14px;
    background: #eef9f4;
}

.masterlist-sync-result[hidden] {
    display: none;
}

.masterlist-sync-result.is-error {
    border-color: #efb2bc;
    background: #fff1f3;
}

.masterlist-sync-result h3,
.masterlist-sync-result p {
    margin: 0;
}

.masterlist-sync-result > p {
    margin-top: 6px;
    color: #516879;
    font-size: 0.73rem;
}

.masterlist-result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.masterlist-result-grid > div {
    padding: 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    text-align: center;
}

.masterlist-result-grid strong,
.masterlist-result-grid span {
    display: block;
}

.masterlist-result-grid span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.62rem;
}

.text-action {
    display: inline-flex;
    align-items: center;
    color: var(--blue-600);
    font-size: 0.73rem;
    font-weight: 800;
    text-decoration: none;
}

.text-action svg {
    width: 16px;
    height: 16px;
}

.dashboard-contact-table {
    margin-top: 17px;
}

.dashboard-contact-table td {
    font-size: 0.75rem;
}

.sync-duplicate {
    color: #6549bd;
    background: #eee9ff;
}

.sync-failed,
.sync-error {
    color: #a52f42;
    background: #ffe8ec;
}

.sync-update_required {
    color: #1856a5;
    background: #e6f0ff;
}

/* Contact directory */

.directory-hero {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    justify-content: space-between;
}

.directory-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.7rem);
    letter-spacing: -0.045em;
}

.directory-hero p:not(.eyebrow) {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.directory-scan-button svg {
    width: 18px;
    height: 18px;
}

.directory-panel {
    margin-top: 24px;
    overflow: hidden;
}

.directory-toolbar {
    display: flex;
    padding: 20px;
    gap: 14px;
    align-items: stretch;
    flex-direction: column;
    border-bottom: 1px solid #e9eef2;
    background: #fbfcfd;
}

.directory-search {
    position: relative;
    display: flex;
    min-width: 280px;
    max-width: none;
    flex: 1;
    align-items: center;
}

.directory-search svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #748596;
    stroke-width: 1.8;
}

.directory-search input,
.directory-filters select,
.directory-filters input {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d4dfe7;
    border-radius: 11px;
    outline: none;
    color: var(--navy-950);
    background: white;
    font: inherit;
    font-size: 0.75rem;
}

.directory-search input {
    padding: 0 15px 0 43px;
}

.directory-search input:focus,
.directory-filters select:focus,
.directory-filters input:focus {
    border-color: var(--turquoise-deep);
    box-shadow: 0 0 0 4px rgba(33, 212, 194, 0.1);
}

.directory-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 11px;
}

.directory-filters label {
    display: grid;
    min-width: 145px;
    gap: 5px;
}

.directory-filters label > span {
    color: var(--muted);
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.directory-filters select {
    padding: 0 35px 0 12px;
}

.directory-filters input {
    padding: 0 12px;
}

.directory-clear-filters {
    min-height: 44px;
    align-self: end;
    border: 1px solid #cbd9e3;
    border-radius: 11px;
    color: #25435a;
    background: white;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}

.directory-clear-filters:hover,
.directory-clear-filters:focus-visible {
    border-color: var(--turquoise-deep);
    color: var(--turquoise-deep);
}

.directory-summary {
    display: flex;
    min-height: 58px;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #edf1f4;
}

.directory-summary > div {
    display: flex;
    gap: 7px;
    align-items: baseline;
}

.directory-summary strong {
    font-size: 1rem;
}

.directory-summary span {
    color: var(--muted);
    font-size: 0.7rem;
}

.directory-refresh {
    display: inline-flex;
    padding: 8px 10px;
    gap: 7px;
    align-items: center;
    border: 0;
    border-radius: 9px;
    color: #526779;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 750;
}

.directory-refresh:hover {
    color: var(--navy-950);
    background: #eff4f7;
}

.directory-panel.is-loading .directory-refresh svg {
    animation: directory-spin 850ms linear infinite;
}

.directory-table-wrap {
    overflow-x: auto;
}

.directory-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
}

.directory-table th,
.directory-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #edf1f4;
    text-align: left;
    vertical-align: middle;
}

.directory-table th {
    color: #718292;
    background: #f8fafb;
    font-size: 0.61rem;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.directory-table tbody tr {
    transition: background-color 150ms ease;
}

.directory-table tbody tr:hover {
    background: #f9fbfc;
}

.directory-table td {
    color: #2d4355;
    font-size: 0.72rem;
}

.directory-table td > strong,
.directory-table td > small,
.directory-table td > a {
    display: block;
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.directory-table td > strong {
    color: var(--navy-950);
    font-size: 0.75rem;
}

.directory-table td > small,
.directory-contact-cell small {
    margin-top: 4px;
    color: #82919e;
    font-size: 0.64rem;
}

.directory-table td > a {
    color: #187c94;
    text-decoration: none;
}

.directory-table td > a[aria-disabled="true"] {
    color: #82919e;
    pointer-events: none;
}

.directory-contact-cell {
    display: flex;
    min-width: 180px;
    gap: 11px;
    align-items: center;
}

.directory-contact-cell > span:last-child,
.directory-contact-cell strong,
.directory-contact-cell small {
    display: block;
    min-width: 0;
}

.directory-contact-cell strong {
    max-width: 185px;
    overflow: hidden;
    color: var(--navy-950);
    font-size: 0.77rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.directory-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border: 1px solid #d2e6e4;
    border-radius: 11px;
    color: #16786d;
    background: linear-gradient(135deg, #e0faf6, #ece9ff);
    font-size: 0.65rem;
    font-weight: 900;
}

.directory-view-button {
    display: inline-flex;
    padding: 8px 10px;
    gap: 5px;
    align-items: center;
    border: 1px solid #d9e3ea;
    border-radius: 9px;
    color: #3d576a;
    background: white;
    cursor: pointer;
    font: inherit;
    font-size: 0.65rem;
    font-weight: 800;
}

.directory-view-button:hover {
    border-color: #9fd6d1;
    color: #087e76;
    background: #f4fcfb;
}

.directory-view-button svg {
    width: 14px;
    height: 14px;
}

.directory-skeleton-row span,
.directory-skeleton-row small {
    display: block;
    width: 120px;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, #edf1f4, #f8fafb, #edf1f4);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.3s ease infinite;
}

.directory-skeleton-row small {
    width: 75px;
    height: 8px;
    margin-top: 7px;
}

.directory-empty,
.directory-error {
    padding: 64px 20px;
    text-align: center;
}

.directory-empty[hidden],
.directory-error[hidden] {
    display: none;
}

.directory-empty-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: auto;
    place-items: center;
    border-radius: 16px;
    color: var(--blue-600);
    background: #e8f7f7;
}

.directory-empty-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.directory-empty h2,
.directory-error strong {
    display: block;
    margin: 14px 0 7px;
    font-size: 1rem;
}

.directory-empty p,
.directory-error span {
    color: var(--muted);
    font-size: 0.73rem;
}

.directory-error button {
    display: block;
    margin: 15px auto 0;
    padding: 9px 13px;
    border: 0;
    border-radius: 9px;
    color: white;
    background: var(--blue-600);
    cursor: pointer;
    font-weight: 750;
}

.directory-pagination {
    display: flex;
    min-height: 68px;
    padding: 0 20px;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    background: #fbfcfd;
}

.directory-pagination[hidden] {
    display: none;
}

.directory-pagination p,
.directory-pagination span {
    color: var(--muted);
    font-size: 0.69rem;
}

.directory-pagination > div {
    display: flex;
    gap: 10px;
    align-items: center;
}

.directory-pagination button {
    padding: 8px 12px;
    border: 1px solid #d7e1e8;
    border-radius: 9px;
    color: #3d5668;
    background: white;
    cursor: pointer;
    font: inherit;
    font-size: 0.67rem;
    font-weight: 750;
}

.directory-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.contact-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(6, 20, 33, 0.46);
    backdrop-filter: blur(2px);
}

.contact-drawer-backdrop[hidden] {
    display: none;
}

.contact-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 210;
    width: min(540px, 100vw);
    overflow-y: auto;
    background: #f7f9fb;
    box-shadow: -28px 0 70px rgba(8, 26, 44, 0.22);
    transform: translateX(103%);
    transition: transform 240ms ease;
}

.contact-drawer.is-open {
    transform: translateX(0);
}

.contact-drawer-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    min-height: 126px;
    padding: 24px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 15px;
    align-items: center;
    color: white;
    background:
        radial-gradient(circle at 90% 10%, rgba(124, 92, 255, 0.44), transparent 14rem),
        linear-gradient(125deg, #081a2c, #17455d);
}

.contact-drawer-avatar {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    color: #0d3d4a;
    background: linear-gradient(135deg, white, var(--turquoise));
    font-size: 1.15rem;
    font-weight: 900;
}

.contact-drawer-header p,
.contact-drawer-header h2,
.contact-drawer-header span {
    margin: 0;
}

.contact-drawer-header p {
    color: #73e8dc;
    font-size: 0.59rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.contact-drawer-header h2 {
    margin-top: 5px;
    font-size: 1.2rem;
}

.contact-drawer-header span {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: #afc5d3;
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-drawer-header button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 11px;
    color: white;
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
}

.contact-drawer-body {
    display: grid;
    padding: 20px;
    gap: 15px;
}

.contact-detail-section {
    padding: 19px;
    border: 1px solid #dfe7ed;
    border-radius: 16px;
    background: white;
    box-shadow: 0 7px 22px rgba(8, 26, 44, 0.045);
}

.contact-card-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.contact-card-image {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: #f4f8fa;
}

.contact-card-image img {
    display: block;
    width: 100%;
    aspect-ratio: 1.65 / 1;
    object-fit: contain;
    background: #edf3f6;
}

.contact-card-image figcaption {
    padding: 9px 11px;
    color: #536b7b;
    font-size: 0.68rem;
    font-weight: 800;
}

.contact-image-empty,
.contact-image-privacy {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.55;
}

.contact-image-privacy {
    margin-top: 10px;
}

.contact-image-actions {
    display: flex;
    margin-top: 12px;
    gap: 8px;
    flex-wrap: wrap;
}

.contact-image-actions button {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #cbd9e3;
    border-radius: 10px;
    color: #25435a;
    background: white;
    font: inherit;
    font-size: 0.69rem;
    font-weight: 800;
    cursor: pointer;
}

.contact-image-actions button:hover,
.contact-image-actions button:focus-visible {
    border-color: var(--turquoise-deep);
    color: var(--turquoise-deep);
}

.contact-image-actions button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.contact-image-message {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    color: #6f4a00;
    background: #fff4d8;
    font-size: 0.7rem;
    line-height: 1.5;
}

.contact-detail-section h3 {
    margin: 0 0 15px;
    color: #456071;
    font-size: 0.68rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.contact-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.contact-detail-item.is-full {
    grid-column: 1 / -1;
}

.contact-detail-item small,
.contact-detail-item span,
.contact-detail-item a {
    display: block;
}

.contact-detail-item small {
    color: #84929f;
    font-size: 0.61rem;
    font-weight: 750;
}

.contact-detail-item span,
.contact-detail-item a {
    margin-top: 5px;
    overflow-wrap: anywhere;
    color: var(--navy-900);
    font-size: 0.75rem;
    line-height: 1.45;
    text-decoration: none;
}

body.contact-drawer-open {
    overflow: hidden;
}

/* Authentication experience */

.public-layout .public-container {
    width: min(1320px, calc(100% - 40px));
    padding-top: 28px;
}

.auth-experience {
    display: grid;
    min-height: calc(100vh - 132px);
    overflow: hidden;
    grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
    border: 1px solid rgba(210, 222, 232, 0.88);
    border-radius: 26px;
    background: white;
    box-shadow: 0 28px 80px rgba(8, 26, 44, 0.16);
}

.auth-visual {
    position: relative;
    display: flex;
    min-height: 650px;
    padding: clamp(34px, 5vw, 60px);
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    color: white;
    background:
        radial-gradient(circle at 80% 25%, rgba(124, 92, 255, 0.31), transparent 20rem),
        radial-gradient(circle at 18% 90%, rgba(33, 212, 194, 0.2), transparent 23rem),
        linear-gradient(145deg, #061523, #0b2d40 55%, #132d52);
}

.auth-visual::before {
    position: absolute;
    inset: 0;
    content: "";
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, black, transparent 84%);
}

.auth-visual > * {
    position: relative;
    z-index: 1;
}

.auth-product-label {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    color: #8fb0c3;
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.14em;
}

.auth-product-label i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--turquoise);
    box-shadow: 0 0 0 5px rgba(33, 212, 194, 0.11), 0 0 18px var(--turquoise);
}

.auth-visual-copy h1 {
    max-width: 620px;
    margin: 17px 0 0;
    font-size: clamp(2.2rem, 4.2vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.auth-visual-copy p {
    max-width: 560px;
    margin: 19px 0 0;
    color: #abc2d1;
    line-height: 1.7;
}

.laser-scanner-scene {
    position: relative;
    display: grid;
    min-height: 270px;
    place-items: center;
}

.laser-frame {
    position: relative;
    width: min(430px, 88%);
    aspect-ratio: 1.62;
    padding: 21px;
    border: 1px solid rgba(80, 231, 217, 0.13);
    border-radius: 22px;
    background: rgba(6, 22, 34, 0.43);
    box-shadow: inset 0 0 42px rgba(33, 212, 194, 0.06), 0 28px 70px rgba(0, 0, 0, 0.25);
    transform: perspective(900px) rotateX(4deg) rotateY(-5deg);
}

.demo-business-card {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 14px;
    color: #0b2233;
    background:
        radial-gradient(circle at 110% -10%, rgba(33, 212, 194, 0.31), transparent 12rem),
        linear-gradient(145deg, #ffffff, #eaf0f4);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.demo-business-card::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 29%;
    height: 100%;
    content: "";
    background: linear-gradient(155deg, transparent 0 28%, #102f48 29% 100%);
}

.demo-card-brand {
    position: absolute;
    top: 18%;
    left: 8%;
    display: flex;
    gap: 8px;
    align-items: center;
}

.demo-card-brand .edag-brand-logo {
    width: 82px;
}

.demo-card-brand span {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 7px;
    color: #073443;
    background: var(--turquoise);
    font-size: 0.7rem;
    font-weight: 950;
}

.demo-card-brand strong {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
}

.demo-card-person {
    position: absolute;
    bottom: 25%;
    left: 8%;
}

.demo-card-person strong,
.demo-card-person span {
    display: block;
}

.demo-card-person strong {
    font-size: clamp(0.75rem, 1.4vw, 1rem);
}

.demo-card-person span {
    margin-top: 4px;
    color: #6b7d89;
    font-size: 0.54rem;
}

.demo-card-lines {
    position: absolute;
    bottom: 10%;
    left: 8%;
    display: grid;
    gap: 4px;
}

.demo-card-lines i {
    width: 92px;
    height: 3px;
    border-radius: 3px;
    background: #bdc8cf;
}

.demo-card-lines i:nth-child(2) { width: 74px; }
.demo-card-lines i:nth-child(3) { width: 82px; }

.demo-card-code {
    position: absolute;
    right: 8%;
    bottom: 12%;
    z-index: 1;
    width: 38px;
    height: 38px;
    opacity: 0.68;
    background:
        linear-gradient(90deg, white 25%, transparent 25% 50%, white 50% 75%, transparent 75%),
        linear-gradient(white 25%, transparent 25% 50%, white 50% 75%, transparent 75%);
    background-size: 10px 10px;
}

.laser-line,
.laser-glow {
    position: absolute;
    right: 11px;
    left: 11px;
    z-index: 4;
    pointer-events: none;
    animation: laser-scan 3.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.laser-line {
    top: 12%;
    height: 2px;
    background: #ff405a;
    box-shadow: 0 0 7px #ff405a, 0 0 18px rgba(255, 64, 90, 0.86);
}

.laser-glow {
    top: calc(12% - 16px);
    height: 35px;
    background: linear-gradient(to bottom, transparent, rgba(255, 64, 90, 0.22), transparent);
    filter: blur(5px);
}

.scan-corner {
    position: absolute;
    z-index: 5;
    width: 28px;
    height: 28px;
    border-color: var(--turquoise);
    opacity: 0.86;
}

.corner-top-left { top: 8px; left: 8px; border-top: 2px solid; border-left: 2px solid; }
.corner-top-right { top: 8px; right: 8px; border-top: 2px solid; border-right: 2px solid; }
.corner-bottom-left { bottom: 8px; left: 8px; border-bottom: 2px solid; border-left: 2px solid; }
.corner-bottom-right { right: 8px; bottom: 8px; border-right: 2px solid; border-bottom: 2px solid; }

.laser-orbit {
    position: absolute;
    width: 510px;
    height: 210px;
    border: 1px solid rgba(33, 212, 194, 0.12);
    border-radius: 50%;
    transform: rotate(-12deg);
}

.laser-orbit-two {
    width: 420px;
    height: 340px;
    border-color: rgba(124, 92, 255, 0.11);
    transform: rotate(18deg);
}

.scan-readout {
    position: absolute;
    right: 2%;
    bottom: 0;
    width: 190px;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(7, 27, 42, 0.82);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
}

.scan-readout > span {
    display: flex;
    gap: 7px;
    align-items: center;
    color: #72e9dc;
    font-size: 0.51rem;
    font-weight: 850;
    letter-spacing: 0.09em;
}

.scan-readout > span i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #72e9dc;
    box-shadow: 0 0 9px #72e9dc;
}

.scan-readout strong {
    display: block;
    margin-top: 7px;
    color: #dce8ef;
    font-size: 0.62rem;
}

.scan-readout > div {
    height: 3px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.scan-readout b {
    display: block;
    width: 64%;
    height: 100%;
    background: linear-gradient(90deg, var(--turquoise), var(--purple));
    animation: scan-progress 3.2s ease-in-out infinite;
}

.auth-visual-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-visual-metrics span {
    display: block;
    padding: 17px 15px 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    color: #7797aa;
    font-size: 0.57rem;
}

.auth-visual-metrics span:first-child {
    padding-left: 0;
    border-left: 0;
}

.auth-visual-metrics strong {
    display: block;
    margin-bottom: 5px;
    color: #cde0e9;
    font-size: 0.66rem;
}

.auth-form-panel {
    display: grid;
    padding: clamp(34px, 5vw, 68px);
    place-items: center;
    background:
        radial-gradient(circle at 110% -10%, rgba(33, 212, 194, 0.1), transparent 16rem),
        white;
}

.auth-form-wrap {
    width: min(100%, 490px);
}

.auth-mobile-brand {
    display: none;
}

.auth-mobile-brand .edag-brand-logo {
    width: 104px;
}

.auth-form-wrap .auth-heading {
    margin-bottom: 28px;
}

.auth-form-wrap .auth-heading h2 {
    margin: 0;
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    letter-spacing: -0.045em;
}

.auth-form-wrap .auth-heading p:not(.eyebrow) {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.auth-form-panel .auth-form {
    gap: 17px;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-label-row span {
    color: #8796a2;
    font-size: 0.59rem;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap > svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #8192a0;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-form-panel .form-group input {
    min-height: 48px;
    padding: 0 45px 0 43px;
    border-radius: 12px;
    background: #fbfcfd;
}

.password-toggle {
    position: absolute;
    right: 8px;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: #83929f;
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle.is-visible {
    color: #167f86;
    background: #eaf7f6;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-form-panel .auth-submit {
    display: flex;
    min-height: 49px;
    padding: 0 18px;
    align-items: center;
    justify-content: space-between;
    font: inherit;
    font-size: 0.78rem;
}

.auth-submit svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.auth-register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.auth-security-note {
    display: flex;
    margin-top: 24px;
    padding-top: 18px;
    gap: 8px;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #edf1f4;
    color: #84929e;
    font-size: 0.61rem;
}

.auth-security-note svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #438c84;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes laser-scan {
    0%, 8% { transform: translateY(0); opacity: 0.45; }
    45%, 55% { transform: translateY(190px); opacity: 1; }
    92%, 100% { transform: translateY(0); opacity: 0.45; }
}

@keyframes scan-progress {
    0%, 10% { width: 8%; }
    48% { width: 92%; }
    70%, 100% { width: 100%; }
}

@keyframes skeleton-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@keyframes directory-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1180px) {
    .dashboard-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-experience {
        grid-template-columns: minmax(0, 1fr) minmax(390px, 0.85fr);
    }

    .auth-visual {
        padding: 38px;
    }
}

@media (max-width: 920px) {
    .dashboard-welcome {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .directory-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .directory-search {
        max-width: none;
    }

    .auth-experience {
        display: block;
    }

    .auth-visual {
        display: none;
    }

    .auth-form-panel {
        min-height: calc(100vh - 170px);
    }

    .auth-mobile-brand {
        display: flex;
        margin-bottom: 34px;
        gap: 11px;
        align-items: center;
    }

    .auth-mobile-brand strong,
    .auth-mobile-brand small {
        display: block;
    }

    .auth-mobile-brand strong {
        font-size: 0.8rem;
        letter-spacing: 0.14em;
    }

    .auth-mobile-brand small {
        margin-top: 3px;
        color: var(--muted);
        font-size: 0.62rem;
    }
}

@media (max-width: 760px) {
    .dashboard-actions,
    .directory-hero {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-actions > *,
    .directory-scan-button {
        width: 100%;
    }

    .dashboard-stat-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stat {
        min-height: 118px;
    }

    .masterlist-sync-intro {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .masterlist-sync-intro .primary-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .masterlist-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .directory-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .directory-filters label {
        min-width: 0;
    }

    .directory-pagination {
        padding: 14px;
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

    .directory-pagination > div {
        justify-content: center;
    }

    .contact-drawer {
        top: 4vh;
        width: 100%;
        border-radius: 22px 22px 0 0;
    }

    .activity-chart {
        gap: 6px;
    }

    .activity-track {
        width: 23px;
    }
}

@media (max-width: 560px) {
    .public-layout .public-container {
        width: min(100% - 20px, 1320px);
        padding-top: 12px;
    }

    .auth-experience {
        border-radius: 20px;
    }

    .auth-form-panel {
        min-height: calc(100vh - 120px);
        padding: 30px 20px;
    }

    .auth-register-grid {
        grid-template-columns: 1fr;
    }

    .directory-search {
        min-width: 0;
    }

    .contact-detail-grid {
        grid-template-columns: 1fr;
    }

    .contact-detail-item.is-full {
        grid-column: auto;
    }

    .contact-drawer-header {
        padding: 19px 16px;
    }

    .contact-drawer-body {
        padding: 12px;
    }
}

/* Step 11: locked dashboard redesign + focused UX fixes */

/* Chromium/Edge may render a native password reveal control. The application
   already provides its own accessible reveal button, so keep exactly one. */
.auth-input-wrap input[type="password"]::-ms-reveal,
.auth-input-wrap input[type="password"]::-ms-clear {
    display: none;
}

.dashboard-stat-grid-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-company .dashboard-stat-icon {
    color: #215f8e;
    background: #e9f3fb;
}

.stat-event .dashboard-stat-icon {
    color: #8a5a13;
    background: #fff3df;
}

.stat-duplicate-detection .dashboard-stat-icon {
    color: #6846ad;
    background: #f0ebfb;
}

.dashboard-admin-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    margin-top: 20px;
    align-items: center;
}

.dashboard-admin-tools-copy h2 {
    margin: 0;
    color: var(--navy-950);
    font-size: 1.2rem;
    letter-spacing: -0.025em;
}

.dashboard-admin-tools-copy > p:not(.eyebrow) {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.55;
}

.dashboard-admin-sync-state {
    display: inline-flex;
    margin-top: 12px;
    padding: 6px 9px;
    border-radius: 999px;
    color: #426073;
    background: #f1f5f8;
    font-size: .66rem;
    font-weight: 800;
}

.dashboard-admin-tool-actions {
    display: flex;
    max-width: 520px;
    gap: 9px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.dashboard-admin-tool-actions .primary-button,
.dashboard-admin-tool-actions .secondary-button {
    min-height: 42px;
}

.dashboard-sync-history-link {
    width: 100%;
    justify-content: flex-end;
}

.dashboard-admin-result {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    padding: 11px 13px;
    border: 1px solid #a9d8c0;
    border-radius: 11px;
    color: #285d4b;
    background: #eef9f4;
    font-size: .72rem;
    line-height: 1.45;
}

.dashboard-admin-result[hidden] {
    display: none;
}

.dashboard-admin-result.is-error {
    border-color: #efb2bc;
    color: #8e3141;
    background: #fff1f3;
}

.dashboard-admin-result strong {
    flex: 0 0 auto;
}

.recent-contact-card {
    margin-top: 20px;
}

.directory-refresh-toolbar {
    min-height: 44px;
    align-self: end;
    justify-content: center;
    border: 1px solid #cbd9e3;
    border-radius: 11px;
    color: #25435a;
    background: #fff;
    font-size: .72rem;
    font-weight: 800;
}

.directory-refresh-toolbar:hover,
.directory-refresh-toolbar:focus-visible {
    border-color: var(--turquoise-deep);
    color: var(--turquoise-deep);
    background: #fff;
}

@media (max-width: 1320px) {
    .dashboard-stat-grid-five {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .dashboard-stat-grid-five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-admin-tools {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .dashboard-admin-tool-actions {
        max-width: none;
        justify-content: flex-start;
    }

    .dashboard-sync-history-link {
        width: auto;
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .dashboard-stat-grid-five {
        grid-template-columns: 1fr;
    }
}


/* STEP 11D — PRODUCTION UI CORRECTION */
.primary-action,
.secondary-action,
.gallery-action,
.primary-button,
.secondary-button,
.directory-clear-filters,
.directory-refresh-toolbar {
    display: inline-flex;
    min-height: 44px;
    padding: 10px 15px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: .79rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.primary-action,
.primary-button {
    border: 1px solid #087e84;
    color: #fff;
    background: #087e84;
    box-shadow: 0 4px 10px rgba(8, 126, 132, .16);
}

.primary-action:hover:not(:disabled),
.primary-button:hover:not(:disabled) {
    border-color: #066c72;
    background: #066c72;
    box-shadow: 0 6px 14px rgba(8, 108, 114, .20);
    transform: translateY(-1px);
}

.secondary-action,
.gallery-action,
.secondary-button,
.directory-clear-filters,
.directory-refresh-toolbar {
    border: 1px solid #b9cbd6;
    color: #173b54;
    background: #fff;
    box-shadow: 0 2px 5px rgba(8, 34, 54, .04);
}

.secondary-action:hover:not(:disabled),
.gallery-action:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.directory-clear-filters:hover,
.directory-refresh-toolbar:hover {
    border-color: #79aeb7;
    color: #075f68;
    background: #f5fafb;
    transform: translateY(-1px);
}

.primary-action:focus-visible,
.primary-button:focus-visible,
.secondary-action:focus-visible,
.gallery-action:focus-visible,
.secondary-button:focus-visible,
.directory-clear-filters:focus-visible,
.directory-refresh-toolbar:focus-visible {
    outline: 3px solid rgba(8, 126, 132, .17);
    outline-offset: 2px;
}

.primary-action:active:not(:disabled),
.primary-button:active:not(:disabled),
.secondary-action:active:not(:disabled),
.gallery-action:active:not(:disabled),
.secondary-button:active:not(:disabled),
.directory-clear-filters:active,
.directory-refresh-toolbar:active {
    transform: translateY(0);
}

.primary-action:disabled,
.secondary-action:disabled,
.primary-button:disabled,
.secondary-button:disabled,
.gallery-action.is-disabled {
    cursor: not-allowed;
    opacity: .52;
    box-shadow: none;
}

/* Clear but non-distracting destructive action */
.remove-side {
    border-color: #e1bbc2 !important;
    color: #9a3343 !important;
    background: #fff8f9 !important;
}
.remove-side:hover:not(:disabled) {
    border-color: #cd8996 !important;
    background: #fff1f3 !important;
}

/* Refresh should read as a normal toolbar action, not a floating icon control. */
.directory-refresh-toolbar {
    min-width: 154px;
    align-self: end;
    white-space: nowrap;
}
.directory-refresh-icon {
    display: inline-flex;
    width: 17px;
    height: 17px;
    align-items: center;
    justify-content: center;
    color: currentColor;
}
.directory-refresh-icon svg {
    width: 17px;
    height: 17px;
}
.directory-panel.is-loading .directory-refresh-icon svg {
    animation: directory-spin 850ms linear infinite;
}

.scan-side-actions .secondary-action,
.scan-side-actions .choose-another,
.camera-dialog-actions .secondary-action,
.duplicate-dialog-actions .secondary-action,
.duplicate-dialog-actions .primary-action,
.review-form-actions .secondary-action,
.review-form-actions .primary-action {
    min-height: 44px;
}

@media (max-width: 700px) {
    .directory-refresh-toolbar {
        width: 100%;
        min-width: 0;
    }
}

/* =========================================================
   GLOBAL UI SYSTEM — 2026 CONSISTENCY PASS
   Visual-only: standardizes hierarchy, affordance and spacing.
   ========================================================= */
:root {
    --ui-primary: #087e84;
    --ui-primary-hover: #066b71;
    --ui-primary-soft: #eef9f9;
    --ui-text: #173b54;
    --ui-muted: #64798a;
    --ui-border: #c8d6df;
    --ui-border-soft: #dfe7ed;
    --ui-surface: #ffffff;
    --ui-surface-subtle: #f7f9fb;
    --ui-danger: #9a3343;
    --ui-danger-soft: #fff4f5;
    --ui-warning: #79560e;
    --ui-warning-soft: #fff8e8;
    --ui-success: #17613d;
    --ui-success-soft: #eef9f3;
    --ui-control-height: 42px;
    --ui-radius: 10px;
    --ui-radius-card: 14px;
    --ui-shadow-control: 0 2px 6px rgba(8, 34, 54, .05);
    --ui-shadow-card: 0 8px 24px rgba(8, 34, 54, .055);
}

/* Shared action language: one shape, one height, clear hierarchy. */
.primary-button,
.primary-action,
.secondary-button,
.secondary-action,
.gallery-action,
.directory-clear-filters,
.directory-refresh-toolbar,
.auth-submit,
.account-password-form .primary-button,
.account-danger-button,
.view-activity-link,
.scanner-back-link,
.activity-back,
.sync-history-back,
.sync-history-view,
.sync-history-footer button {
    min-height: var(--ui-control-height);
    border-radius: var(--ui-radius);
    font-weight: 800;
    letter-spacing: 0;
}

.primary-button,
.primary-action,
.auth-submit,
.account-password-form .primary-button {
    border: 1px solid var(--ui-primary) !important;
    color: #fff !important;
    background: var(--ui-primary) !important;
    box-shadow: 0 3px 9px rgba(8, 126, 132, .15) !important;
}

.primary-button:hover:not(:disabled),
.primary-action:hover:not(:disabled),
.auth-submit:hover:not(:disabled),
.account-password-form .primary-button:hover:not(:disabled) {
    border-color: var(--ui-primary-hover) !important;
    background: var(--ui-primary-hover) !important;
    box-shadow: 0 5px 13px rgba(8, 108, 114, .18) !important;
    transform: translateY(-1px);
}

.secondary-button,
.secondary-action,
.gallery-action,
.directory-clear-filters,
.directory-refresh-toolbar,
.view-activity-link,
.scanner-back-link,
.activity-back {
    border: 1px solid var(--ui-border) !important;
    color: var(--ui-text) !important;
    background: #fff !important;
    box-shadow: var(--ui-shadow-control) !important;
}

.secondary-button:hover,
.secondary-action:hover:not(:disabled),
.gallery-action:hover:not(:disabled),
.directory-clear-filters:hover,
.directory-refresh-toolbar:hover,
.view-activity-link:hover,
.scanner-back-link:hover,
.activity-back:hover {
    border-color: #7faeb6 !important;
    color: #075f68 !important;
    background: #f5fafb !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

.primary-button:focus-visible,
.primary-action:focus-visible,
.secondary-button:focus-visible,
.secondary-action:focus-visible,
.gallery-action:focus-visible,
.directory-clear-filters:focus-visible,
.directory-refresh-toolbar:focus-visible,
.auth-submit:focus-visible,
.account-danger-button:focus-visible,
.view-activity-link:focus-visible,
.scanner-back-link:focus-visible,
.activity-back:focus-visible,
.sync-history-back:focus-visible,
.sync-history-view:focus-visible,
.sync-history-footer button:focus-visible {
    outline: 3px solid rgba(8, 126, 132, .18) !important;
    outline-offset: 2px;
}

/* Navigation that is visually promoted still remains an anchor semantically. */
.scanner-back-link,
.activity-back {
    display: inline-flex !important;
    padding: 0 13px !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap;
    font-size: .78rem !important;
    text-decoration: none !important;
}

.scanner-back-link svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Icon-only controls are reserved for universally understood close/menu actions. */
.camera-dialog-close,
.duplicate-close,
.contact-edit-modal-close,
#contactDrawerClose,
.sync-history-close {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    cursor: pointer;
}

/* Scanner page: page-level navigation and status should never resemble loose text. */
.scanner-heading {
    align-items: flex-start;
}

.scanner-status:empty {
    display: none !important;
}

.scan-side-card,
.event-selection-dialog,
.camera-capture-dialog,
.duplicate-contact-dialog,
.contact-edit-dialog {
    border-radius: var(--ui-radius-card) !important;
}

/* Contact drawer: cleaner enterprise treatment and clearly discoverable Edit action. */
.contact-drawer {
    background: #f5f7f9;
}

.contact-drawer-header {
    background: linear-gradient(120deg, #082237 0%, #123f5b 100%);
}

.contact-drawer-header-stacked .contact-edit-trigger {
    min-height: 42px !important;
    padding: 0 15px !important;
    gap: 8px !important;
    border-radius: 10px !important;
    font-size: .78rem !important;
    font-weight: 800 !important;
}

.contact-drawer-header-stacked .contact-edit-trigger svg {
    width: 16px !important;
    height: 16px !important;
}

.contact-detail-section {
    padding: 17px;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(8, 26, 44, .035);
}

.contact-image-empty {
    padding: 13px 14px;
    border: 1px dashed #cbd9e2;
    border-radius: 10px;
    background: #f8fafb;
}

.contact-image-privacy {
    color: #748592;
}

/* Make table row actions read as actions, not random text links. */
.view-activity-link,
.sync-history-view {
    display: inline-flex;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.contact-link {
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* Form controls share the same geometry and focus treatment. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
    border-radius: 10px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(8, 126, 132, .12);
    outline-offset: 0;
    border-color: #6caeb3;
}

/* Destructive controls use one reserved red treatment. */
.account-danger-button,
.remove-side,
.sheet-logout {
    border-color: #dfb5bc !important;
    color: var(--ui-danger) !important;
    background: var(--ui-danger-soft) !important;
    box-shadow: none !important;
}

.account-danger-button:hover,
.remove-side:hover:not(:disabled),
.sheet-logout:hover {
    border-color: #c98994 !important;
    color: #84283a !important;
    background: #ffecee !important;
}

/* Toolbar actions should align and not float like orphan icons. */
.directory-refresh-toolbar,
.directory-clear-filters {
    min-width: 132px;
    white-space: nowrap;
}

.directory-refresh-icon {
    display: none !important;
}

/* Consistent surface system for admin/user pages. */
.events-hero,
.events-card,
.user-directory-hero,
.user-directory-card,
.activity-hero,
.activity-card,
.account-card,
.directory-panel,
.directory-hero {
    border-color: var(--ui-border-soft) !important;
    box-shadow: var(--ui-shadow-card) !important;
}

/* Avoid overly flashy action gradients; reserve gradients for brand/navigation chrome. */
.primary-button,
.primary-action,
.auth-submit {
    background-image: none !important;
}

/* Desktop and mobile tap targets. */
@media (max-width: 700px) {
    .scanner-back-link,
    .activity-back,
    .directory-refresh-toolbar,
    .directory-clear-filters {
        width: 100%;
    }

    .contact-drawer-header-stacked .contact-drawer-header-actions {
        padding-left: 0 !important;
    }
}

/* Page-heading consistency: page navigation belongs inside a defined header region. */
.scanner-heading {
    margin-bottom: 16px;
    padding: 22px 24px;
    border: 1px solid var(--ui-border-soft);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--ui-shadow-card);
}

.scanner-heading .scanner-back-link {
    flex: 0 0 auto;
}

/* Tertiary navigation stays visibly interactive without competing with primary actions. */
.text-action,
.contact-link {
    color: #08717c;
    text-underline-offset: 3px;
}

.text-action:hover,
.contact-link:hover {
    color: #055c64;
}

.dashboard-sync-history-link {
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

/* Standardize miscellaneous action controls that do not use the main utility classes. */
#directoryRetry,
#directoryPrevious,
#directoryNext,
.contact-admin-actions button {
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    color: var(--ui-text);
    background: #fff;
    box-shadow: var(--ui-shadow-control);
    cursor: pointer;
    font: inherit;
    font-size: .76rem;
    font-weight: 800;
}

#directoryRetry:hover,
#directoryPrevious:hover:not(:disabled),
#directoryNext:hover:not(:disabled),
.contact-admin-actions button:hover:not(:disabled) {
    border-color: #7faeb6;
    color: #075f68;
    background: #f5fafb;
}

/* More conventional compact card/table geometry across operational screens. */
.events-hero,
.user-directory-hero,
.activity-hero {
    border-radius: 16px !important;
}

.events-card,
.user-directory-card,
.activity-card,
.account-card {
    border-radius: 14px !important;
}

@media (max-width: 760px) {
    .scanner-heading {
        padding: 18px;
        flex-direction: column;
        align-items: stretch;
    }
}
