* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    margin: 0;
    min-height: 100vh;
    background: #0f172a;
    color: #e2e8f0;
}

.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.card {
    background: #1e293b;
    border-radius: 12px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.page-login .card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
}

.success-email-notice {
    background: rgba(5, 150, 105, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #a7f3d0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.error {
    background: #7f1d1d;
    color: #fecaca;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.form label {
    display: block;
    margin-bottom: 1rem;
}

.form label span {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form input[type="file"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 1rem;
}

.form input:focus {
    outline: none;
    border-color: #3b82f6;
}

.form button[type="submit"] {
    margin-top: 0.5rem;
    width: 100%;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.header h1 {
    margin: 0;
    font-size: 1.25rem;
    flex: 1;
}

.header .user {
    color: #94a3b8;
    font-size: 0.9rem;
}

.main {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.main .card {
    max-width: none;
}

.main .card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.main .card p {
    color: #94a3b8;
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary {
    background: #3b82f6;
    color: #fff;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-ghost {
    background: transparent;
    color: #94a3b8;
}

.btn-ghost:hover {
    color: #e2e8f0;
}

.btn-ghost-active {
    color: #06b6d4;
    font-weight: 500;
}

.btn-danger {
    background: #b91c1c;
    color: #fee2e2;
}

.btn-danger:hover {
    background: #7f1d1d;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.form-send .form-actions {
    margin-top: 1.25rem;
}

.result-box {
    background: #0f172a;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.result-box label {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.result-box input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.result-box .url-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.result-box .url-row input {
    flex: 1;
    margin-bottom: 0;
}

.success-card .result-box label:last-of-type {
    margin-top: 0.5rem;
}

.result-box-multi .result-signer-block {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.result-box-multi .result-signer-block:last-child {
    border-bottom: none;
}

.result-signer-block .url-row {
    margin-top: 0.5rem;
}

.signer-2-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.signer-2-block .card-subtitle {
    margin-top: 0;
}

/* Signing page (customer) */
.page-sign {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.sign-card {
    max-width: 1100px;
}

.sign-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}

.doc-preview {
    margin-bottom: 1.5rem;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
}

.doc-iframe {
    display: block;
    width: 100%;
    height: 640px;
    border: none;
}

/* Placement preview: letter proportion so click position matches PDF */
.place-doc-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #e2e8f0;
}

.place-doc {
    margin-bottom: 0.5rem;
}

.place-doc-frame {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 80vh;
    min-height: 750px;
    max-height: 1000px;
    border: 2px solid rgba(56, 189, 248, 0.5);
    border-radius: 8px;
    background: #1e293b;
    overflow: hidden;
    isolation: isolate;
}

.place-doc-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.95rem;
    z-index: 1;
}

.place-doc-loading.is-hidden {
    display: none;
}

.place-doc-frame .doc-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: 6px;
}

/* Make canvas readable if PDF fails to render */
.place-doc-frame canvas.doc-iframe {
    background: #fff;
}

/* Clicks go to overlay for placement; iframe must not capture them */
.place-doc-frame #place-iframe {
    pointer-events: none;
}

.place-doc-frame #place-canvas {
    cursor: crosshair;
}

/* Sign page: document preview + open in new tab */
.sign-doc-preview {
    margin-bottom: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    overflow: hidden;
    background: #1e293b;
}

.sign-doc-iframe {
    display: block;
    width: 100%;
    height: 80vh;
    min-height: 650px;
    max-height: 900px;
    border: none;
    background: #fff;
}

/* Side-by-side sign flow: scroll inside PDF panel, not the whole browser page */
.page-sign.page-tech.page-sign-flow {
    align-items: flex-start;
    justify-content: center;
    padding: 0.65rem 1rem 1rem;
    min-height: 100dvh;
    box-sizing: border-box;
}

.page-sign.page-tech.page-sign-flow .sign-doc-preview {
    /* Make preview taller so users can comfortably view one PDF page at a time. */
    max-height: min(72vh, calc(100dvh - 200px));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.page-sign.page-tech.page-sign-flow .sign-doc-iframe {
    height: auto !important;
    min-height: 280px !important;
    max-height: none !important;
}

@media (max-width: 900px) {
    .page-sign.page-tech.page-sign-flow .sign-doc-preview {
        max-height: min(56vh, calc(100dvh - 230px));
    }
}

.sign-doc-open {
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.sign-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
    gap: 1.75rem;
    align-items: flex-start;
}

.sign-form-col {
    min-width: 0;
}

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

.sign-doc-open a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.doc-fallback {
    padding: 0.5rem 1rem;
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
    background: #1e293b;
}

.doc-fallback a {
    color: #3b82f6;
}

/* Place signature (admin) - Step 2 advanced */
.preview-place-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.preview-place-grid-advanced {
    grid-template-columns: 2.5fr 1fr;
    gap: 2rem;
    align-items: start;
}

.place-doc-wrap {
    min-width: 0;
    min-height: 750px;
}

.place-doc-heading {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
}

@media (max-width: 800px) {
    .preview-place-grid,
    .preview-place-grid-advanced {
        grid-template-columns: 1fr;
    }
}

/* Placed fields panel - always visible feedback */
.placed-fields-panel {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.placed-fields-title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #94a3b8;
}

.placed-fields-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.placed-fields-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.placed-fields-list li::before {
    content: '✓';
    color: #22c55e;
    font-weight: 700;
}

.placed-fields-list .placed-page {
    margin-left: auto;
    font-size: 0.8rem;
    color: #64748b;
}

.placed-fields-empty {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}

.placed-fields-panel:not(.has-placed) .placed-fields-list {
    display: none;
}

.placed-fields-panel.has-placed .placed-fields-empty {
    display: none;
}

/* Toast: instant feedback when placing */
.placement-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    background: #22c55e;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.placement-toast.is-visible {
    opacity: 1;
}


.place-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    cursor: crosshair;
    background: transparent;
    z-index: 999;
    pointer-events: auto;
}

.place-overlay:hover {
    background: rgba(56, 189, 248, 0.03);
}

.place-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.8);
    border: 2px solid #0f172a;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 4;
}

.place-marker-company {
    background: rgba(34, 197, 94, 0.85);
    border-color: #0f172a;
}

.place-marker-date {
    /* base; overridden by -company and -customer */
}
.place-marker-date-company {
    background: rgba(249, 115, 22, 0.9);
    border-color: #0f172a;
}
.place-marker-date-customer {
    background: rgba(168, 85, 247, 0.9);
    border-color: #0f172a;
}

/* Box overlays: must sit above canvas so placements are clearly visible */
.place-boxes-layer {
    position: absolute;
    inset: 0;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    z-index: 10;
}

.place-box-overlay {
    position: absolute;
    border: 4px solid #38bdf8;
    background: rgba(56, 189, 248, 0.35);
    pointer-events: auto;
    box-sizing: border-box;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.6), inset 0 0 12px rgba(56, 189, 248, 0.15);
    min-width: 48px;
    min-height: 28px;
}

.place-box-overlay.is-selected {
    outline: 3px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.place-box-overlay .place-box-label {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 3px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    background: #38bdf8;
    border-radius: 3px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.place-box-overlay.place-box-customer { border-color: #38bdf8; background: rgba(56, 189, 248, 0.28); }
.place-box-overlay.place-box-customer .place-box-label { background: #38bdf8; }
.place-box-overlay.place-box-customer_date { border-color: #a78bfa; background: rgba(167, 139, 250, 0.28); }
.place-box-overlay.place-box-customer_date .place-box-label { background: #a78bfa; }
.place-box-overlay.place-box-company { border-color: #22c55e; background: rgba(34, 197, 94, 0.28); }
.place-box-overlay.place-box-company .place-box-label { background: #22c55e; }
.place-box-overlay.place-box-company_date { border-color: #f97316; background: rgba(249, 115, 22, 0.28); }
.place-box-overlay.place-box-company_date .place-box-label { background: #f97316; }
.place-box-overlay.place-box-signer2 { border-color: #06b6d4; background: rgba(6, 182, 212, 0.28); }
.place-box-overlay.place-box-signer2 .place-box-label { background: #06b6d4; }
.place-box-overlay.place-box-signer2_date { border-color: #ec4899; background: rgba(236, 72, 153, 0.28); }
.place-box-overlay.place-box-signer2_date .place-box-label { background: #ec4899; }

.place-instruction {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.place-instruction-prominent {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 6px;
    font-size: 0.9rem;
}

.step1-next {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.placement-mode {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.placement-mode-label {
    font-weight: 600;
    color: #e2e8f0;
}

.placement-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.placement-option input {
    margin: 0;
}

.company-sig-section {
    margin-bottom: 1rem;
}

.company-sig-section .muted {
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

.signature-wrap {
    border: 2px solid #334155;
    border-radius: 8px;
    background: #fff;
    margin: 0.5rem 0 0;
    width: 400px;
    height: 160px;
    min-width: 400px;
    min-height: 160px;
    box-sizing: border-box;
    contain: layout paint;
}

.staff-sig-preview-img,
.staff-sig-thumb-send {
    max-height: 72px;
    width: auto;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}
.staff-sig-preview-wrap {
    margin: 0.5rem 0 1rem;
}
.company-sig-saved-notice {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}
.staff-sig-card {
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    background: rgba(15, 23, 42, 0.4);
}

/* Shared spacing utility for the settings page */
.settings-section-spacer {
    margin-bottom: 1.5rem;
}

.signature-wrap svg {
    display: block;
    width: 400px;
    height: 160px;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

.signature-actions {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.signature-actions .btn {
    pointer-events: auto;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

/* Dashboard – clean layout */
.dashboard-main {
    padding-bottom: 2.5rem;
}

/* Staff/admin dashboard should use more horizontal space */
.page-dashboard .main.dashboard-main {
    max-width: 1400px;
}

.dashboard-split-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

/* Stack sections on smaller screens */
@media (max-width: 1100px) {
    .dashboard-split-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-hero {
    margin-bottom: 2rem;
}

.dashboard-shell {
    display: grid;
    grid-template-columns: 170px 7fr;
    gap: 1.25rem;
    align-items: start;
}

.dashboard-sidebar {
    position: sticky;
    top: 0.75rem;
    align-self: start;
    padding: 0.75rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(6, 182, 212, 0.12);
    backdrop-filter: blur(8px);
}

.dashboard-sidebar-title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin: 0 0 0.65rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.dashboard-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dashboard-side-link {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    text-decoration: none;
    color: #cbd5e1;
    font-size: 0.82rem;
    border: 1px solid rgba(148, 163, 184, 0.10);
    background: rgba(15, 23, 42, 0.25);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-side-link:hover {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(6, 182, 212, 0.25);
    color: #e2e8f0;
}

.dashboard-side-link.is-active {
    border-color: rgba(6, 182, 212, 0.35);
    background: rgba(6, 182, 212, 0.08);
    color: #e2e8f0;
}

.pin-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pin-random-btn {
    white-space: nowrap;
}

.pin-input.is-pin-disabled {
    opacity: 0.55;
    filter: grayscale(0.2);
    pointer-events: none;
}

.dashboard-content {
    min-width: 0;
}

.dashboard-page-title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.15rem;
    color: #e2e8f0;
    margin: 0 0 0.35rem;
}

.dashboard-welcome {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0 0 1rem;
    line-height: 1.4;
}

.dashboard-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}

.dashboard-action-card {
    display: block;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.dashboard-action-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(15, 23, 42, 0.7);
}

.dashboard-action-primary {
    border-left: 3px solid #06b6d4;
    background: rgba(6, 182, 212, 0.05);
}

.dashboard-action-primary:hover {
    background: rgba(6, 182, 212, 0.08);
}

.dashboard-action-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.95rem;
    color: #e2e8f0;
    margin-bottom: 0.2rem;
}

.dashboard-action-desc {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.dashboard-action-cta {
    font-size: 0.8rem;
    color: #06b6d4;
    font-weight: 500;
}

.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section-title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin: 0 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.dashboard-accounts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.dashboard-card {
    padding: 1.25rem 1.5rem;
    max-width: none;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.dashboard-card-title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.95rem;
    color: #e2e8f0;
    margin: 0 0 0.2rem;
}

.dashboard-card-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0 0 0.75rem;
    line-height: 1.35;
}

.dashboard-toast {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    margin: 0 0 0.5rem;
}

.dashboard-toast:last-child {
    margin-bottom: 0;
}

.dashboard-toast-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.dashboard-toast-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.dashboard-create-form {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.dashboard-create-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

.dashboard-create-fields label {
    margin: 0;
    min-width: 110px;
}

.dashboard-create-fields label span {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 0.15rem;
}

.dashboard-create-fields input {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    width: 100%;
    min-width: 120px;
}

/* Staff create form: keep 4 fields visually balanced after adding Company */
.dashboard-create-fields-staff label {
    flex: 0 1 190px;
    min-width: 145px;
    max-width: 200px;
}

.dashboard-inline-form-company-edit {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.dashboard-staff-company-input {
    min-width: 145px;
    width: min(100%, 190px);
}

.dashboard-table-wrap {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.dashboard-table thead {
    background: rgba(15, 23, 42, 0.4);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.dashboard-table th {
    text-align: left;
    padding: 0.45rem 0.6rem;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.dashboard-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    color: #e2e8f0;
}

.dashboard-table tbody tr:last-child td {
    border-bottom: none;
}

.dashboard-table tbody tr:hover {
    background: rgba(6, 182, 212, 0.03);
}

.dashboard-table-email {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #94a3b8;
}

.dashboard-link {
    color: #06b6d4;
    font-size: 0.8rem;
    text-decoration: none;
}

.dashboard-link:hover {
    text-decoration: underline;
}

.dashboard-empty {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
    font-style: italic;
}

.dashboard-expiry {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #94a3b8;
}

.dashboard-expiry-soon {
    color: #fbbf24;
}

.dashboard-signed-section {
    padding: 1.25rem 1.5rem;
    max-width: none;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.dashboard-signed-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.dashboard-signed-header .dashboard-section-title {
    margin: 0;
    padding: 0;
    border: none;
}

.dashboard-signed-count {
    font-size: 0.75rem;
    color: #64748b;
}

.dashboard-flash-wrap {
    margin-bottom: 0.75rem;
}

.dashboard-flash-wrap .dashboard-toast {
    margin-bottom: 0.35rem;
}

/* Rate-limit cooldown display (staff dashboard) */
.dashboard-cooldowns-wrap {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.dashboard-cooldowns-title {
    margin: 0 0 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dashboard-cooldowns-block {
    margin-top: 0.5rem;
}

.dashboard-signed-tabs-wrap {
    margin-top: 0.5rem;
}

.dashboard-signed-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding-bottom: 0.5rem;
}

.dashboard-signed-tab {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.dashboard-signed-tab:hover {
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.4);
}

.dashboard-signed-tab.is-active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}

.dashboard-signed-tab-count {
    font-weight: 600;
    color: inherit;
    opacity: 0.9;
}

.dashboard-signed-panel {
    display: none;
}

.dashboard-signed-panel.is-active {
    display: block;
}

.dashboard-signed-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-signed-block {
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.25);
}

.dashboard-signed-block-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.4);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.dashboard-signed-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.dashboard-signed-email {
    font-size: 0.8rem;
    color: #94a3b8;
}

.dashboard-signed-company {
    font-weight: 600;
    font-size: 0.95rem;
    color: #e2e8f0;
    display: block;
}

.dashboard-signed-contact {
    font-size: 0.8rem;
    color: #94a3b8;
}

.dashboard-signed-badge {
    font-size: 0.7rem;
    color: #64748b;
    margin-left: auto;
}

.dashboard-table-signed {
    font-size: 0.8rem;
}

.dashboard-table-signed thead {
    background: transparent;
}

.dashboard-table-signed td {
    padding: 0.45rem 0.75rem;
}

.dashboard-table-actions {
    white-space: nowrap;
}

.dashboard-table-actions .btn {
    margin-right: 0.25rem;
}

.dashboard-inline-form {
    display: inline;
}

.dashboard-signed-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

.dashboard-signed-table-scroll .dashboard-table-signed {
    min-width: 320px;
}

/* Admin dashboard – pending signs improvements */
.dashboard-pending-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: baseline;
}

.dashboard-kpi-badge {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    color: #e2e8f0;
    border-radius: 8px;
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
}

.dashboard-pending-toolbar {
    margin: 0 0 0.9rem;
}

.dashboard-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.dashboard-filter-row label {
    min-width: 200px;
    flex: 1 1 200px;
}

.dashboard-filter-row label > span {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.dashboard-filter-row input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.dashboard-filter-row select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.9rem;
    cursor: pointer;
}

.dashboard-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.dashboard-pending-bulk-form {
    margin-top: 0.25rem;
}

.dashboard-pending-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
    margin: 0.25rem 0 0.8rem;
}

.dashboard-pending-help {
    color: #64748b;
    font-size: 0.8rem;
}

.dashboard-bulk-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dashboard-table-checkbox-col {
    width: 44px;
    text-align: center;
}

.dashboard-table-checkbox-col input[type="checkbox"] {
    transform: translateY(1px);
    accent-color: #06b6d4;
}

.dashboard-select-all {
    accent-color: #06b6d4;
}

/* Admin dashboard: signed/pending pagination UI */
.dashboard-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
    margin: 0.8rem 0 0.25rem;
}

.dashboard-pagination-meta {
    color: #64748b;
    font-size: 0.8rem;
}

.dashboard-pagination-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.dashboard-signed-toolbar {
    margin: 0 0 0.75rem;
}

.dashboard-signed-company-select {
    min-width: 220px;
    max-width: 420px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
}

.dashboard-signed-pagination-top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: baseline;
    justify-content: space-between;
    margin: 0.2rem 0 0.75rem;
}

.dashboard-client-search {
    margin: 0.75rem 0 1rem;
}

@media (max-width: 900px) {
    .dashboard-quick-actions {
        grid-template-columns: 1fr;
    }
    .dashboard-accounts-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-shell {
        grid-template-columns: 1fr;
    }
    .dashboard-sidebar {
        position: static;
    }
}

/* Admin dashboard – phones & small tablets */
@media (max-width: 768px) {
    .header-tech {
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 0.65rem;
        padding: 0.65rem 1rem;
    }

    .header-tech .header-brand {
        flex: 1 1 45%;
        min-width: 0;
    }

    .header-tech .header-brand .app-logo-header {
        height: auto;
        max-height: 88px;
        max-width: min(160px, 42vw);
    }

    .header-tech .header-logo {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        font-size: 0.9rem;
        margin: 0;
    }

    .header-tech .user-badge {
        flex: 0 1 auto;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }

    .header-tech > a.btn {
        padding: 0.45rem 0.55rem;
        font-size: 0.78rem;
        flex: 0 1 auto;
    }

    .page-dashboard .main.dashboard-main {
        padding: 1rem 0.85rem 2rem;
        max-width: 100%;
    }

    .dashboard-hero {
        margin-bottom: 1.25rem;
    }

    .dashboard-welcome {
        font-size: 0.85rem;
    }

    .dashboard-card,
    .dashboard-signed-section {
        padding: 1rem 0.85rem;
    }

    .dashboard-card-desc {
        font-size: 0.78rem;
        line-height: 1.45;
    }

    .dashboard-create-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-create-fields label {
        min-width: 0;
        width: 100%;
    }

    .dashboard-create-fields input {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .dashboard-create-fields-staff label {
        min-width: 0;
        width: 100%;
    }

    .dashboard-staff-company-input {
        min-width: 0;
        width: 100%;
    }

    .dashboard-table-wrap {
        margin-left: -0.35rem;
        margin-right: -0.35rem;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    .dashboard-table {
        font-size: 0.8rem;
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 0.45rem 0.5rem;
    }

    .dashboard-signed-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .dashboard-signed-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        gap: 0.35rem;
        padding-bottom: 0.65rem;
        margin-bottom: 0.75rem;
        scrollbar-width: thin;
    }

    .dashboard-signed-tab {
        flex: 0 0 auto;
        font-size: 0.8rem;
        padding: 0.45rem 0.65rem;
    }

    .dashboard-signed-block-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .dashboard-signed-badge {
        margin-left: 0;
    }

    .dashboard-table-actions {
        white-space: normal;
    }

    .dashboard-table-actions .btn {
        display: inline-block;
        margin: 0.2rem 0.35rem 0.2rem 0;
        vertical-align: middle;
    }

    .dashboard-inline-form {
        display: inline-block;
        vertical-align: middle;
    }

    .dashboard-table-email,
    .dashboard-table td:first-child {
        word-break: break-word;
        max-width: 50vw;
    }

    .dashboard-table-signed td:first-child {
        max-width: 40vw;
    }
}

@media (max-width: 400px) {
    .header-tech > a.btn {
        font-size: 0.72rem;
        padding: 0.4rem 0.45rem;
    }
}

.card-clients .form-inline-create {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.card-clients .form-inline-create label {
    margin: 0;
    min-width: 140px;
}

.card-clients .form-inline-create input {
    display: block;
    margin-top: 0.25rem;
}

/* Settings page layout – override .page-dashboard .main */
.page-dashboard .main.main-settings {
    max-width: 1400px;
}

.main-settings .card-settings {
    max-width: none;
    padding: 1.75rem;
}

/* Reduce vertical scrolling on settings page: 2-column layout */
.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 1.5rem;
    align-items: start;
}

.settings-grid-left,
.settings-grid-right {
    min-width: 0;
}

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

/* Reset fieldset/legend so our layout isn’t broken by browser defaults */
.card-settings .form-settings .settings-group {
    border: none;
    margin: 0 0 1.25rem;
    padding: 0;
    min-width: 0;
}

.card-settings .settings-group legend.settings-legend {
    float: none;
    width: auto;
}

.card-settings .settings-header {
    margin-bottom: 1.75rem;
}

.card-settings .settings-header .card-title-tech {
    margin: 0 0 0.35rem;
}

.card-settings .settings-intro {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.card-settings .settings-alerts {
    margin-bottom: 1.5rem;
}

.card-settings .settings-alerts .success-msg,
.card-settings .settings-alerts .error {
    margin-bottom: 0.75rem;
}

.card-settings .settings-alerts .success-msg:last-child,
.card-settings .settings-alerts .error:last-child {
    margin-bottom: 0;
}

/* Section groups – divider between General and SMTP */
.card-settings .form-settings .settings-group-general {
    padding-bottom: 1.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.card-settings .form-settings .settings-group-smtp {
    margin-bottom: 0;
}

.card-settings .settings-legend {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #06b6d4;
    margin: 0 0 1rem;
    padding: 0 0 0 0.75rem;
    border-left: 3px solid #06b6d4;
    display: block;
}

.card-settings .settings-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0 0 1rem;
    line-height: 1.45;
}

/* Field rows – labels inside rows don’t need extra bottom margin */
.card-settings .settings-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.card-settings .settings-fields-row label {
    margin-bottom: 0;
}

.card-settings .form-settings .settings-group label {
    margin-bottom: 1rem;
}

.card-settings .form-settings .settings-group label:last-of-type {
    margin-bottom: 0;
}

.card-settings .settings-fields-smtp {
    grid-template-columns: 1fr auto auto;
}

.card-settings .settings-fields-smtp .field-port {
    min-width: 90px;
}

.card-settings .settings-fields-smtp .field-encryption {
    min-width: 120px;
}

@media (max-width: 640px) {
    .card-settings .settings-fields-row {
        grid-template-columns: 1fr;
    }
    .card-settings .settings-fields-smtp {
        grid-template-columns: 1fr;
    }
}

/* SMTP group – panel style */
.card-settings .settings-group-smtp {
    background: rgba(6, 182, 212, 0.06);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 12px;
    padding: 1.5rem 1.5rem 1.75rem;
    margin-bottom: 0;
}

.card-settings .settings-group-smtp .settings-legend {
    margin-top: 0;
}

.card-settings .label-checkbox-smtp {
    margin-bottom: 1.25rem;
}

/* Select in settings */
.card-settings .form select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 1rem;
    cursor: pointer;
}

.card-settings .form select:focus {
    outline: none;
    border-color: #06b6d4;
}

/* Form actions */
.card-settings .form-actions-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

/* Test email block */
.card-settings .settings-test {
    margin-top: 1.25rem;
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
}

/* Email template preview (signing email) */
.settings-email-preview {
    margin-top: 1.25rem;
}

.settings-preview-details {
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.settings-preview-details summary {
    cursor: pointer;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
}

.email-preview-frame {
    margin-top: 1rem;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.email-preview-iframe {
    width: 100%;
    height: 520px;
    border: 0;
}

@media (max-width: 640px) {
    .email-preview-iframe {
        height: 460px;
    }
}

/* Settings layout utilities (avoid inline spacing styles) */
.settings-mt-1 {
    margin-top: 1rem;
}

.email-preview-meta p {
    margin: 0 0 0.35rem;
}

.email-preview-meta p:last-child {
    margin-bottom: 0;
}

.settings-display-block {
    display: block;
}

.card-settings .settings-test-header {
    margin-bottom: 1rem;
}

.card-settings .settings-test-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 0.25rem;
}

.card-settings .settings-test-desc {
    color: #94a3b8;
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.45;
}

.card-settings .form-inline-test {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}

.card-settings .form-inline-test label {
    margin: 0;
    min-width: 200px;
    flex: 1;
}

.card-settings .form-inline-test .btn {
    flex-shrink: 0;
}

.label-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.label-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: #06b6d4;
}

.label-checkbox span {
    margin-bottom: 0;
}

.card-subtitle {
    font-size: 0.95rem;
    margin: 1rem 0 0.5rem;
    color: #94a3b8;
}

.success-msg {
    color: #34d399;
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
}

.step-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #06b6d4;
    margin-bottom: 0.5rem;
}

.send-step-card .card-title-tech {
    margin-top: 0;
}

.card-lead {
    margin-bottom: 1.25rem;
}

/* Send wizard steps – need wide layout for document preview */
.page-send .main {
    max-width: 1400px;
    padding: 2rem 1.5rem;
}

.send-wizard {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.send-steps-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}

.send-step {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #64748b;
}

.send-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.25);
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.8rem;
}

.send-step-active .send-step-num {
    background: #38bdf8;
    color: #0f172a;
}

.send-step-done .send-step-num {
    background: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.send-step-done {
    color: #94a3b8;
}

.send-steps-nav .send-step:not(:last-child)::after {
    content: '';
    width: 1.5rem;
    height: 2px;
    background: rgba(148, 163, 184, 0.3);
    margin-left: 0.25rem;
}

/* Form sections (Step 1) */
.form-send-advanced .form-section {
    margin-bottom: 1.75rem;
    padding: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.3);
}

.form-section-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
}

.form-section-title .optional-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-section .muted {
    margin-bottom: 0.75rem;
}

.form-section label {
    display: block;
    margin-bottom: 0.75rem;
}

.form-section label:last-of-type {
    margin-bottom: 0;
}

.form-actions-step1 {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* Placement summary (Step 2) */
/* Placement workflow (DocuSign-style) */
.placement-workflow {
    margin-bottom: 1.25rem;
}

.workflow-progress {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.workflow-progress-item {
    white-space: nowrap;
}

.workflow-progress-item.is-done {
    color: #22c55e;
}

.workflow-progress-item.is-current {
    color: #38bdf8;
    font-weight: 500;
}

.workflow-optional {
    color: #64748b;
    font-weight: normal;
}

.workflow-sep {
    color: #475569;
    margin: 0 0.2rem;
}

.workflow-instruction {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #e2e8f0;
}

.workflow-actions {
    margin-bottom: 0.75rem;
}

.workflow-page-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.workflow-page-label {
    font-size: 0.9rem;
    color: #94a3b8;
}

.workflow-page-input {
    width: 4rem;
    padding: 0.35rem 0.5rem;
}

.workflow-page-of {
    font-size: 0.85rem;
    color: #64748b;
}

.workflow-page-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

.workflow-place-default-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.workflow-place-hint {
    font-size: 0.85rem;
    color: #94a3b8;
}

.workflow-placed-on-page {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: #94a3b8;
    min-height: 1.25rem;
}

.form-subsection-title {
    margin: 1.25rem 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
}

.placement-summary {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.placement-summary-title {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
}

.placement-summary-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.placement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.875rem;
}

.placement-item-required .placement-label {
    font-weight: 500;
    color: #e2e8f0;
}

.placement-status {
    color: #64748b;
    white-space: nowrap;
}

.placement-item.is-placed .placement-status {
    color: #22c55e;
    font-weight: 500;
}

.placement-item.is-placed .placement-status::before {
    content: '✓ ';
}

.client-picker {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
}

.recipient-fields {
    margin-top: 0.5rem;
}

.send-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    font-size: 0.9rem;
}

.result-actions {
    margin-bottom: 1rem;
}

.result-actions .copy-link-pin {
    margin-right: 0.5rem;
}

.signed-section {
    margin-top: 2rem;
}

.signed-section h2 {
    margin-top: 0;
}

.muted {
    color: #64748b;
    margin: 0;
}

.signed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.signed-table th,
.signed-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #334155;
}

.signed-table th {
    color: #94a3b8;
    font-weight: 500;
}

.signed-table .email {
    font-size: 0.85rem;
    color: #64748b;
}

/* View signed (admin preview) */
.view-signed-card h2 {
    margin-top: 0;
}

/* Make the viewer use more horizontal space on view-signed.php */
.page-tech.page-view-signed .main {
    max-width: 1400px;
}

.signed-meta {
    color: #94a3b8;
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

.download-package {
    margin: 0 0 1.5rem;
}

.download-package .btn {
    margin-right: 0.5rem;
}

.package-hint {
    font-size: 0.9rem;
    color: #64748b;
}

.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

.preview-block h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #94a3b8;
}

.preview-iframe {
    width: 100%;
    height: 400px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
}

/* View Signed (tabs + bigger previews) */
.view-signed-tabs-wrap {
    margin-top: 1rem;
}

.view-signed-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.view-signed-tab {
    background: #334155;
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font-weight: 600;
}

.view-signed-tab:hover {
    background: #475569;
}

.view-signed-tab.is-active {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.6);
    color: #ffffff;
}

.view-signed-panel {
    display: block;
}

.view-signed-panel[hidden] {
    display: none !important;
}

.view-signed-preview-iframe {
    height: 650px;
}

/* Use the same “tall PDF preview” feel as send-document.php */
.view-signed-place-doc-frame {
    /* override only if needed; base .place-doc-frame already defines min/max height */
    margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
    .view-signed-preview-iframe {
        height: 460px;
    }
}

.preview-block p {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
}

.preview-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.link-sep {
    color: #64748b;
}

.preview-block a {
    color: #3b82f6;
}

.signature-preview {
    border: 1px solid #334155;
    border-radius: 8px;
    background: #fff;
    padding: 1rem;
    min-height: 120px;
}

.signature-preview img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Debug section (generated links / view signed) */
.debug-section {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: #0f172a;
    border-radius: 8px;
    border: 1px solid #334155;
}
.debug-section summary {
    cursor: pointer;
    font-size: 0.9rem;
    color: #94a3b8;
}
.debug-list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.6;
}
.debug-list code {
    background: #1e293b;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.8rem;
}
.debug-error {
    color: #fca5a5;
}

/* ========== Tech theme (login + dashboard) ========== */
.page-tech {
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

/* Login: grid background + glass card */
.page-login.page-tech {
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    background: #0a0e17;
    z-index: 0;
}

.login-spotlight {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 220ms ease;
    background: radial-gradient(
        420px 320px at var(--login-mx, 50%) var(--login-my, 40%),
        rgba(56, 189, 248, 0.10),
        rgba(6, 182, 212, 0.05) 35%,
        transparent 70%
    );
}

.page-login.page-tech:hover .login-spotlight {
    opacity: 1;
}

.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    z-index: 0;
    animation: loginGridDrift 18s linear infinite;
}

.login-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(6, 182, 212, 0.15), transparent),
                radial-gradient(ellipse 60% 40% at 100% 100%, rgba(14, 165, 233, 0.08), transparent);
    z-index: 0;
    animation: loginGlowPulse 6.5s ease-in-out infinite;
}

.page-login.page-tech::before {
    /* subtle “paper” texture overlay */
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.45;
    background-image:
        radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.08) 0 1px, transparent 2px),
        radial-gradient(circle at 70% 65%, rgba(255, 255, 255, 0.06) 0 1px, transparent 2px);
    background-size: 180px 180px, 220px 220px;
    animation: loginPaperDrift 22s linear infinite;
}

.page-login .login-card {
    position: relative;
    z-index: 1;
    max-width: 400px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 16px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03),
                0 25px 50px -12px rgba(0, 0, 0, 0.5),
                0 0 80px -20px rgba(6, 182, 212, 0.15);
}

.page-login .login-card::before,
.page-login .login-card::after {
    /* floating “document pages” behind the card */
    content: '';
    position: absolute;
    inset: -18px -18px auto auto;
    width: 160px;
    height: 210px;
    border-radius: 14px;
    background:
        conic-gradient(from 180deg at 100% 0%, rgba(255,255,255,0.22), rgba(255,255,255,0) 18%),
        linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04)),
        repeating-linear-gradient(180deg, rgba(226,232,240,0.10), rgba(226,232,240,0.10) 1px, transparent 1px, transparent 10px);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 25px 55px -22px rgba(0,0,0,0.65);
    transform: rotate(10deg);
    z-index: -1;
    opacity: 0.95;
    animation: loginDocFloatA 8.5s ease-in-out infinite;
}

.page-login .login-card::after {
    inset: auto auto -22px -22px;
    width: 150px;
    height: 195px;
    transform: rotate(-8deg);
    opacity: 0.75;
    animation: loginDocFloatB 10.5s ease-in-out infinite;
}

.page-login .login-card h1.login-logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    color: #f1f5f9;
    margin-bottom: 0.25rem;
}

.page-login .login-card h1.login-logo::before {
    content: '>';
    color: #06b6d4;
    margin-right: 0.35rem;
}

.page-login .login-card::before {
    /* top-right “fold” highlight */
    box-shadow:
        0 25px 55px -22px rgba(0,0,0,0.65),
        inset -22px 18px 0 -20px rgba(255,255,255,0.18);
}

.page-login .login-card::after {
    box-shadow:
        0 25px 55px -22px rgba(0,0,0,0.65),
        inset 18px -18px 0 -20px rgba(255,255,255,0.10);
}

.app-logo-login {
    /* subtle “ink shimmer” for logo image */
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.35));
}

@supports (-webkit-mask-image: linear-gradient(#000, #000)) {
    .app-logo-login {
        -webkit-mask-image: linear-gradient(110deg,
            rgba(0,0,0,0.25) 0%,
            rgba(0,0,0,1) 30%,
            rgba(0,0,0,1) 55%,
            rgba(0,0,0,0.25) 78%,
            rgba(0,0,0,1) 100%);
        -webkit-mask-size: 260% 100%;
        -webkit-mask-position: 0% 0%;
        animation: loginLogoShimmer 5.5s ease-in-out infinite;
    }
}

.page-login .login-card .subtitle {
    position: relative;
}

.page-login .login-card .subtitle::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 1.05em;
    margin-left: 0.35rem;
    vertical-align: -0.15em;
    border-radius: 3px;
    background: rgba(6, 182, 212, 0.9);
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.35);
    animation: loginCaretBlink 1.15s steps(2, end) infinite;
}

.page-login .login-card .subtitle::after {
    /* “signature stroke” accent */
    content: '';
    display: block;
    height: 2px;
    width: 138px;
    margin: 0.55rem auto 0;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.95), rgba(56, 189, 248, 0.65), transparent);
    border-radius: 999px;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.35));
    transform-origin: left center;
    animation: loginSignature 2.6s ease-in-out infinite;
}

.page-login .login-card .subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.page-login .login-card .form input[type="text"],
.page-login .login-card .form input[type="password"] {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.page-login .login-card .form input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.page-login .login-card .form button[type="submit"] {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    border: none;
    cursor: pointer;
    transition: filter 0.2s, box-shadow 0.2s;
}

.page-login .login-card .form button[type="submit"]:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 20px -5px rgba(6, 182, 212, 0.5);
}

.page-login .login-card .form button[type="submit"] {
    position: relative;
    overflow: hidden;
}

.page-login .login-card .form button[type="submit"]::after {
    /* subtle “scanner” sweep */
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-120%);
    background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.22) 45%, transparent 70%);
    opacity: 0.0;
}

.page-login .login-card .form button[type="submit"]:hover::after {
    opacity: 1;
    animation: loginSweep 0.85s ease-out 1;
}

.page-login .login-card .error {
    background: rgba(127, 29, 29, 0.4);
    border: 1px solid rgba(248, 113, 113, 0.3);
    position: relative;
    transform-origin: 50% 0;
    animation: loginStampIn 520ms cubic-bezier(0.2, 0.95, 0.25, 1.1) both;
}

.page-login .login-card .error::before {
    content: '!';
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    color: rgba(248, 113, 113, 0.85);
    transform: rotate(-10deg);
}

@keyframes loginGridDrift {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 120px 120px, -140px 80px; }
}

@keyframes loginGlowPulse {
    0%, 100% { opacity: 0.95; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}

@keyframes loginPaperDrift {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-40px, 30px, 0); }
}

@keyframes loginDocFloatA {
    0%, 100% { transform: translateY(0) rotate(10deg); }
    50% { transform: translateY(10px) rotate(8deg); }
}

@keyframes loginDocFloatB {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50% { transform: translateY(-12px) rotate(-10deg); }
}

@keyframes loginSignature {
    0%, 100% { transform: scaleX(0.85); opacity: 0.85; }
    50% { transform: scaleX(1); opacity: 1; }
}

@keyframes loginSweep {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

@keyframes loginCaretBlink {
    0%, 49% { opacity: 0; }
    50%, 100% { opacity: 1; }
}

@keyframes loginStampIn {
    0% { transform: translateY(-6px) scale(0.98); opacity: 0; filter: saturate(0.9); }
    60% { transform: translateY(0) scale(1.02); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; filter: saturate(1); }
}

@keyframes loginLogoShimmer {
    0%, 100% { -webkit-mask-position: 0% 0%; }
    50% { -webkit-mask-position: 100% 0%; }
}

@media (prefers-reduced-motion: reduce) {
    .login-bg::before,
    .login-bg::after,
    .page-login.page-tech::before,
    .page-login .login-card::before,
    .page-login .login-card::after,
    .page-login .login-card .subtitle::after,
    .page-login .login-card .subtitle::before,
    .page-login .login-card .error,
    .app-logo-login {
        animation: none !important;
    }
    .login-spotlight {
        display: none !important;
    }
}

/* Client portal (index) — staff link de-emphasized */
.login-card-portal .login-portal-footer {
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.login-portal-secondary,
.page-staff-login .login-portal-secondary {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.45;
    text-align: center;
}

.login-portal-secondary a,
.page-staff-login .login-portal-secondary a {
    color: #94a3b8;
    font-weight: 500;
}

.login-portal-secondary a:hover,
.page-staff-login .login-portal-secondary a:hover {
    color: #38bdf8;
}

.login-portal-note {
    margin-top: 1rem;
    font-size: 0.85rem;
}

.page-staff-login .login-portal-secondary {
    margin-top: 1.25rem;
    text-align: center;
}

/* Shared tech background (dashboard, send-document, view-signed) */
.page-tech.page-dashboard,
.page-tech.page-send,
.page-tech.page-view-signed {
    position: relative;
}

.dashboard-bg {
    position: fixed;
    inset: 0;
    background: #0a0e17;
    z-index: -1;
}

.dashboard-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.02) 1px, transparent 1px);
    background-size: 24px 24px;
}

.header-tech {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(6, 182, 212, 0.15);
    padding: 0.875rem 1.5rem;
}

.header-tech .header-logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    color: #f1f5f9;
}

.header-tech .header-logo::before {
    content: '>';
    color: #06b6d4;
    margin-right: 0.25rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
}

.header-brand .header-logo {
    margin: 0;
    font-size: 1.15rem;
}

.header-tech .header-logo--with-logo::before {
    content: none;
    margin: 0;
}

.app-logo-header {
    width: auto;
    height: auto;
    max-height: 88px;
    max-width: min(180px, 44vw);
    object-fit: contain;
    flex-shrink: 0;
}

.app-logo-login {
    max-height: 88px;
    max-width: 100%;
    width: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.app-logo-login-wrap {
    text-align: center;
    margin-bottom: 0.35rem;
}

.app-logo-sign {
    max-height: 64px;
    max-width: 100%;
    width: auto;
    display: block;
    margin: 0 auto 0.25rem;
    object-fit: contain;
}

.app-logo-sign-wrap {
    text-align: center;
    margin-bottom: 0.35rem;
}

.header-tech .user-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #94a3b8;
    background: rgba(51, 65, 85, 0.5);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(71, 85, 105, 0.5);
}

.header-tech .btn-outline {
    border: 1px solid #334155;
    border-radius: 8px;
}

.header-tech .btn-outline:hover {
    border-color: #06b6d4;
    color: #06b6d4;
}

/* Tech cards (dashboard, send-document, view-signed) */
.page-tech .card-tech {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(6, 182, 212, 0.12);
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.page-tech .card-tech.card-cta {
    border-top: 2px solid #06b6d4;
}

.page-tech .card-title-tech {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1.1rem;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.page-tech .btn-tech {
    border-radius: 8px;
    transition: box-shadow 0.2s, filter 0.2s;
}

.page-tech .btn-primary.btn-tech {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: none;
}

.page-tech .btn-primary.btn-tech:hover {
    box-shadow: 0 0 20px -5px rgba(6, 182, 212, 0.4);
    filter: brightness(1.05);
}

.page-tech .btn-secondary.btn-tech {
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.5);
}

.page-tech .btn-secondary.btn-tech:hover {
    border-color: #06b6d4;
    color: #06b6d4;
}

/* Signed table tech style (dashboard only) */
.page-dashboard .signed-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9rem;
}

.page-dashboard .signed-table thead {
    border-bottom: 1px solid rgba(6, 182, 212, 0.25);
}

.page-dashboard .signed-table th {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    text-align: left;
    padding: 0.75rem 1rem;
}

.page-dashboard .signed-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    color: #e2e8f0;
}

.page-dashboard .signed-table tbody tr:hover {
    background: rgba(6, 182, 212, 0.04);
}

.page-dashboard .signed-table .email {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #94a3b8;
}

.page-dashboard .main {
    max-width: 960px;
}

.page-dashboard .signed-section .muted {
    color: #64748b;
    font-size: 0.9rem;
}

/* Customer sign page (sign.php) tech style */
.page-sign.page-tech {
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sign-bg {
    position: fixed;
    inset: 0;
    background: #0a0e17;
    z-index: -1;
}

.sign-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
}

.page-sign .sign-card.card-tech {
    position: relative;
    z-index: 1;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(6, 182, 212, 0.2);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.page-sign .sign-card .sign-logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: #f1f5f9;
}

.page-sign .sign-card .sign-logo::before {
    content: '>';
    color: #06b6d4;
    margin-right: 0.35rem;
}

.page-sign .sign-card .form input[type="text"],
.page-sign .sign-card .form input[type="password"] {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    border-radius: 10px;
}

.page-sign .sign-card .form input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

/* Thank-you: placement + audit record */
.sign-completion-record {
    margin: 1.75rem 0 1.5rem;
}

.sign-placement-card {
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem 1.1rem;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.85));
    border: 1px solid rgba(34, 211, 238, 0.22);
    box-shadow: 0 4px 24px -12px rgba(34, 211, 238, 0.15);
}

.sign-placement-card__head {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

.sign-placement-card__icon {
    font-size: 1.35rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.4));
}

.sign-placement-card__title {
    margin: 0 0 0.2rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #e2e8f0;
}

.sign-placement-card__hint {
    margin: 0;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.4;
}

.sign-placement-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sign-placement-list__item {
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    background: rgba(6, 182, 212, 0.08);
    border-left: 3px solid #06b6d4;
}

.sign-placement-list__label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #22d3ee;
    margin-bottom: 0.25rem;
}

.sign-placement-list__value {
    font-size: 0.88rem;
    color: #f1f5f9;
    line-height: 1.45;
}

.sign-placement-tech {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.sign-placement-tech summary {
    cursor: pointer;
    color: #94a3b8;
}

.sign-placement-tech__pre {
    margin: 0.5rem 0 0;
    padding: 0.5rem 0.65rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    font-size: 0.68rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    color: #94a3b8;
}

.sign-completion-record .sign-audit-trail {
    margin-top: 0;
}

/* Thank-you page: audit trail timeline */
.sign-audit-trail {
    margin: 1.75rem 0 1.5rem;
    padding: 1.25rem 1.15rem 1.35rem;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(15, 23, 42, 0.6) 45%, rgba(15, 23, 42, 0.75) 100%);
    border: 1px solid rgba(6, 182, 212, 0.28);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 12px 40px -16px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.sign-audit-trail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #06b6d4, #22d3ee, #06b6d4, #0891b2);
    background-size: 200% 100%;
    animation: sign-audit-shimmer 8s ease infinite;
}

@keyframes sign-audit-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .sign-audit-trail::before {
        animation: none;
        background: linear-gradient(90deg, #06b6d4, #22d3ee);
    }
}

.sign-audit-trail__head {
    text-align: center;
    margin-bottom: 1.15rem;
    position: relative;
    z-index: 1;
}

.sign-audit-trail__badge {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #67e8f9;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(6, 182, 212, 0.45);
    background: rgba(6, 182, 212, 0.12);
    margin-bottom: 0.5rem;
}

.sign-audit-trail__title {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.02em;
}

.sign-audit-trail__desc {
    margin: 0;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.45;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.sign-audit-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.25rem;
    position: relative;
    z-index: 1;
}

.sign-audit-timeline__item {
    position: relative;
    padding-left: 1.65rem;
    margin-bottom: 0.65rem;
}

.sign-audit-timeline__item:last-child {
    margin-bottom: 0;
}

.sign-audit-timeline__rail {
    position: absolute;
    left: 0.45rem;
    top: 0.5rem;
    bottom: -0.65rem;
    width: 2px;
    background: linear-gradient(180deg, rgba(6, 182, 212, 0.7), rgba(6, 182, 212, 0.15));
    border-radius: 2px;
}

.sign-audit-timeline__item:last-child .sign-audit-timeline__rail {
    display: none;
}

.sign-audit-timeline__dot {
    position: absolute;
    left: 0.15rem;
    top: 0.45rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #22d3ee, #06b6d4);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.25), 0 0 14px -2px rgba(34, 211, 238, 0.5);
    z-index: 2;
}

.sign-audit-timeline__item--document_signed .sign-audit-timeline__dot {
    background: linear-gradient(145deg, #4ade80, #22c55e);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3), 0 0 14px -2px rgba(74, 222, 128, 0.45);
}

.sign-audit-timeline__card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 10px;
    padding: 0.65rem 0.85rem 0.7rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sign-audit-timeline__card:hover {
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow: 0 4px 20px -8px rgba(6, 182, 212, 0.2);
}

.sign-audit-timeline__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.35rem;
}

.sign-audit-timeline__time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #64748b;
}

.sign-audit-timeline__event {
    font-weight: 600;
    font-size: 0.88rem;
    color: #e2e8f0;
}

.sign-audit-timeline__detail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    font-size: 0.78rem;
    color: #94a3b8;
}

.sign-audit-timeline__actor {
    color: #cbd5e1;
}

.sign-audit-timeline__ip code,
.sign-audit-timeline__ip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #64748b;
}

.sign-audit-timeline__ua {
    margin-top: 0.45rem;
    font-size: 0.72rem;
    color: #64748b;
}

.sign-audit-timeline__ua summary {
    cursor: pointer;
    color: #06b6d4;
    font-weight: 500;
}

.sign-audit-timeline__ua summary:hover {
    color: #22d3ee;
}

.sign-audit-timeline__ua-text {
    display: block;
    margin-top: 0.35rem;
    padding: 0.45rem 0.55rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    word-break: break-word;
    line-height: 1.4;
    font-size: 0.68rem;
    color: #94a3b8;
}

/* Customer sections (signed docs grouped by customer) */
.customer-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.customer-block {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(6, 182, 212, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.customer-block-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
    background: rgba(6, 182, 212, 0.06);
    border-bottom: 1px solid rgba(6, 182, 212, 0.15);
    font-family: 'JetBrains Mono', monospace;
}

.customer-block-header .customer-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #e2e8f0;
}

.customer-block-header .customer-email {
    font-size: 0.8rem;
    color: #94a3b8;
}

.customer-block-header .customer-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.signed-table-nested {
    margin: 0;
}

.signed-table-nested thead th {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
}

.signed-table-nested td {
    padding: 0.65rem 1rem;
}

.signed-table-nested .signed-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #94a3b8;
}

.signed-table-nested .actions-col {
    text-align: right;
}

.signed-table-nested .signed-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.inline-form {
    display: inline;
}
