/* =============================================================================
   ProTrac — app.css
   Mobile-first. ProFamily palette. Touch-optimized. No scrollbars.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Custom Properties
   ----------------------------------------------------------------------------- */
:root {
    /* Brand palette — ProFamily */
    --color-red:          #A43220;
    --color-red-dark:     #8c2a1b;
    --color-red-light:    #fdf2f1;
    --color-bluegray:     #3A4245;
    --color-bluegray-d:   #2c3336;
    --color-blue:         #1187E9;
    --color-blue-dark:    #0d6fc0;
    --color-blue-light:   #eff6ff;

    /* Neutrals */
    --color-white:        #ffffff;
    --color-bg:           #f4f5f7;
    --color-surface:      #ffffff;
    --color-border:       #e5e7eb;
    --color-border-dark:  #d1d5db;
    --color-text:         #111827;
    --color-text-muted:   #6b7280;
    --color-text-subtle:  #9ca3af;

    /* Visit status colors — mirrors ProDispatch */
    --status-draft-text:        #6b21a8;
    --status-draft-bg:          #f3e8ff;
    --status-draft-border:      #d8b4fe;

    --status-dispatched-text:   #1e40af;
    --status-dispatched-bg:     #eff6ff;
    --status-dispatched-border: #93c5fd;

    --status-enroute-text:      #854d0e;
    --status-enroute-bg:        #fefce8;
    --status-enroute-border:    #fde047;

    --status-inprogress-text:   #166534;
    --status-inprogress-bg:     #dcfce7;
    --status-inprogress-border: #4ade80;

    --status-completed-text:    #14532d;
    --status-completed-bg:      #f0fdf4;
    --status-completed-border:  #86efac;

    --status-closed-text:       #111827;
    --status-closed-bg:         #f3f4f6;
    --status-closed-border:     #d1d5db;

    --status-onhold-text:       #9a3412;
    --status-onhold-bg:         #fff7ed;
    --status-onhold-border:     #fdba74;

    /* Spacing */
    --space-xs:   4px;
    --space-sm:   8px;
    --space-md:   16px;
    --space-lg:   24px;
    --space-xl:   32px;

    /* Radius */
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-full: 9999px;

    /* Nav */
    --nav-height: 64px;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.10);
    --shadow-lg:  0 8px 24px rgba(0,0,0,0.12);

    /* Typography */
    --font-body:  'DM Sans', 'Segoe UI', system-ui, sans-serif;
    --font-mono:  'DM Mono', 'Courier New', monospace;
}

/* -----------------------------------------------------------------------------
   Reset & Base
   ----------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    /* Prevent horizontal overflow everywhere */
    overflow-x: hidden;
    /* Match the page background so rubber-band overscroll
       shows the same colour rather than white */
    background: #f4f5f7;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    /* Always fill at least the full viewport so overscroll-behavior fires */
    min-height: 100dvh;
    /* Reserve space for fixed bottom nav */
    padding-bottom: var(--nav-height);
    overflow-x: hidden;
    /* Smooth scrolling */
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbars globally — content still scrolls via touch */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; -ms-overflow-style: none; }

a {
    color: var(--color-blue);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* -----------------------------------------------------------------------------
   Typography helpers
   ----------------------------------------------------------------------------- */
.text-muted  { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 12px; }
.text-lg     { font-size: 17px; }
.font-bold   { font-weight: 700; }
.font-semi   { font-weight: 600; }
.text-center { text-align: center; }
.text-red    { color: var(--color-red); }
.text-blue   { color: var(--color-blue); }

/* -----------------------------------------------------------------------------
   Layout
   ----------------------------------------------------------------------------- */
.page-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: var(--space-md);
}

.page-header {
    margin-bottom: var(--space-lg);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

/* Section labels */
.section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
    margin-bottom: var(--space-sm);
    padding: 0 var(--space-xs);
}

/* -----------------------------------------------------------------------------
   Cards
   ----------------------------------------------------------------------------- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.card-header {
    padding: var(--space-md) var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.card-body {
    padding: var(--space-md);
}

/* Tappable card (visit list items) */
.card-tap {
    display: block;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-decoration: none;
    color: inherit;
    -webkit-user-select: none;
    user-select: none;
}
.card-tap:active {
    background: #f9fafb;
    transform: scale(0.99);
    text-decoration: none;
}
.card-tap:hover { text-decoration: none; }

/* -----------------------------------------------------------------------------
   Visit list cards
   ----------------------------------------------------------------------------- */
.visit-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}
.visit-card:last-child { border-bottom: none; }

.visit-card-left {
    flex: 1;
    min-width: 0;
}

.visit-scheduled {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-red);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visit-customer {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visit-site {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visit-id {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-subtle);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    margin-top: 3px;
}

.visit-date {
    font-size: 12px;
    color: var(--color-text-subtle);
    margin-top: 4px;
}

.visit-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-xs);
    flex-shrink: 0;
}

/* -----------------------------------------------------------------------------
   Status pills
   ----------------------------------------------------------------------------- */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.4;
}

.pill-draft       { color: var(--status-draft-text);        background: var(--status-draft-bg);        border-color: var(--status-draft-border); }
.pill-dispatched  { color: var(--status-dispatched-text);   background: var(--status-dispatched-bg);   border-color: var(--status-dispatched-border); }
.pill-enroute     { color: var(--status-enroute-text);      background: var(--status-enroute-bg);      border-color: var(--status-enroute-border); }
.pill-inprogress  { color: var(--status-inprogress-text);   background: var(--status-inprogress-bg);   border-color: var(--status-inprogress-border); }
.pill-completed   { color: var(--status-completed-text);    background: var(--status-completed-bg);    border-color: var(--status-completed-border); }
.pill-closed      { color: var(--status-closed-text);       background: var(--status-closed-bg);       border-color: var(--status-closed-border); }
.pill-onhold      { color: var(--status-onhold-text);       background: var(--status-onhold-bg);       border-color: var(--status-onhold-border); }

/* Assist pill */
.pill-assist {
    color: #7c3aed;
    background: #f5f3ff;
    border-color: #c4b5fd;
}

/* -----------------------------------------------------------------------------
   Flag pills / badges
   ----------------------------------------------------------------------------- */
/* flags-bar and flag-item retained for legacy compatibility */
.flags-bar { display: none; }

/* -----------------------------------------------------------------------------
   Action bar (bottom-pinned on detail pages)
   ----------------------------------------------------------------------------- */
.action-bar {
    position: fixed;
    bottom: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    gap: var(--space-sm);
    z-index: 100;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}

.action-bar .btn { flex: 1; }
.action-bar-form { flex: 1; display: flex; }
.action-bar-form .btn { flex: 1; }

/* Notice replacing the action bar */
.action-notice {
    position: fixed;
    bottom: var(--nav-height);
    left: 0;
    right: 0;
    background: #f9fafb;
    border-top: 1px solid var(--color-border);
    padding: var(--space-md);
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
    z-index: 100;
}

/* -----------------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px var(--space-md);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s, opacity 0.15s;
    -webkit-user-select: none;
    user-select: none;
    min-height: 48px; /* Touch target */
    white-space: nowrap;
}
.btn:hover, .btn:active, .btn:focus, .btn:visited { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--color-red);
    color: #fff;
}
.btn-primary:hover { background: var(--color-red-dark); }

.btn-secondary {
    background: var(--color-bluegray);
    color: #fff;
}
.btn-secondary:hover { background: var(--color-bluegray-d); }

.btn-blue {
    background: var(--color-blue);
    color: #fff;
}
.btn-blue:hover { background: var(--color-blue-dark); }

.btn-outline {
    background: transparent;
    color: var(--color-bluegray);
    border: 1.5px solid var(--color-border-dark);
}
.btn-outline:hover { background: #f3f4f6; }

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
}
.btn-ghost:hover { background: #f3f4f6; }

.btn-danger {
    background: #dc2626;
    color: #fff;
}
.btn-danger:hover { background: #b91c1c; }

.btn-sm {
    font-size: 13px;
    padding: 8px 14px;
    min-height: 36px;
    border-radius: var(--radius-sm);
}

.btn-full { width: 100%; }

/* Call-to-action button (tel: links) */
.btn-call {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    text-decoration: none;
}
.btn-call:hover  { background: #bbf7d0; text-decoration: none; }
.btn-call:active { text-decoration: none; }
.btn-call:focus  { text-decoration: none; }

/* -----------------------------------------------------------------------------
   Forms
   ----------------------------------------------------------------------------- */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--color-red);
    margin-left: 2px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 13px var(--space-md);
    border: 1.5px solid var(--color-border-dark);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(17,135,233,0.12);
}

.form-control::placeholder { color: var(--color-text-subtle); }

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.form-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--color-red);
    margin-top: 4px;
}

/* Toggle slider */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.toggle {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--color-border-dark);
    border-radius: 28px;
    transition: background 0.2s;
    cursor: pointer;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider { background: var(--color-red); }
.toggle input:checked + .toggle-slider::before { transform: translateX(24px); }

.toggle-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
}

/* -----------------------------------------------------------------------------
   Section today heading
   ----------------------------------------------------------------------------- */
.today-heading {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, var(--color-red) 0%, #c0392b 100%);
    color: white;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.today-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

/* -----------------------------------------------------------------------------
   Empty state
   ----------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: var(--space-md);
    opacity: 0.4;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.empty-state-text {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* -----------------------------------------------------------------------------
   Duration timer
   ----------------------------------------------------------------------------- */
.duration-timer {
    background: var(--status-inprogress-bg);
    border: 2px solid var(--status-inprogress-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: center;
    margin-bottom: var(--space-md);
}

.duration-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--status-inprogress-text);
    margin-bottom: 4px;
}

.duration-value {
    font-size: 36px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--status-inprogress-text);
    letter-spacing: 0.04em;
}

/* -----------------------------------------------------------------------------
   Contact card
   ----------------------------------------------------------------------------- */
.contact-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md);
}

.contact-name {
    font-weight: 600;
    font-size: 15px;
}

.contact-phone {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* -----------------------------------------------------------------------------
   Notes
   ----------------------------------------------------------------------------- */
.note-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}
.note-item:last-child { border-bottom: none; }

.note-meta {
    font-size: 12px;
    color: var(--color-text-subtle);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.note-meta-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.note-author {
    font-weight: 600;
    color: var(--color-text-muted);
}

.note-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.note-actions {
    display: flex;
    gap: 6px;
}

/* -----------------------------------------------------------------------------
   Resource display (pro photo + name)
   ----------------------------------------------------------------------------- */
.resource-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
}

.resource-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-bg);
    flex-shrink: 0;
}

.resource-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.resource-role {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* -----------------------------------------------------------------------------
   Info rows (label + value pairs)
   ----------------------------------------------------------------------------- */
.info-row {
    display: flex;
    gap: var(--space-sm);
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}
.info-row:last-child { border-bottom: none; }

.info-label {
    font-weight: 600;
    color: var(--color-text-muted);
    min-width: 110px;
    flex-shrink: 0;
    font-size: 13px;
}

.info-value {
    color: var(--color-text);
    flex: 1;
    word-break: break-word;
}

/* -----------------------------------------------------------------------------
   Alert / flash messages
   ----------------------------------------------------------------------------- */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: var(--space-md);
    border: 1px solid transparent;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #7f1d1d;
    border-color: #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: var(--color-blue-light);
    color: #1e40af;
    border-color: #93c5fd;
}

/* -----------------------------------------------------------------------------
   Bottom tab navigation
   ----------------------------------------------------------------------------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    display: flex;
    z-index: 200;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text-subtle);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.15s;
    -webkit-user-select: none;
    user-select: none;
    padding: 6px 4px;
    min-height: 44px;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.nav-item.active {
    color: var(--color-red);
}

.nav-item:hover { color: var(--color-bluegray); }
.nav-item.active:hover { color: var(--color-red-dark); }

/* -----------------------------------------------------------------------------
   Login page
   ----------------------------------------------------------------------------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 48px;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    padding-bottom: var(--space-xl);
    background: var(--color-bg);
}

.login-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xl);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--color-red);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.login-logo-mark svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.login-app-name {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.5px;
}

.login-tagline {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.login-heading {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.login-subheading {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

/* OTP input */
.otp-input {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-align: center;
}

/* -----------------------------------------------------------------------------
   Signature canvas
   ----------------------------------------------------------------------------- */
.sig-canvas-wrap {
    border: 2px solid var(--color-border-dark);
    border-radius: var(--radius-md);
    background: #fafafa;
    overflow: hidden;
    position: relative;
    touch-action: none;
}

.sig-canvas-wrap canvas {
    display: block;
    width: 100%;
    cursor: crosshair;
}

.sig-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--color-text-subtle);
    pointer-events: none;
}

.sig-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-sm);
}

/* -----------------------------------------------------------------------------
   eBadge
   ----------------------------------------------------------------------------- */
.badge-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--nav-height) - 40px);
    padding: var(--space-lg) var(--space-md);
    /* Security guilloché pattern — repeating diagonal micro-lines */
    background-color: #eceef0;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(164,50,32,0.06) 4px,
            rgba(164,50,32,0.06) 5px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 4px,
            rgba(58,66,69,0.06) 4px,
            rgba(58,66,69,0.06) 5px
        );
}

.badge-card {
    background: var(--color-surface);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 340px;
    overflow: hidden;
    position: relative;
    animation: badge-glow 2s ease-in-out infinite;
}

@keyframes badge-glow {
    0%   { box-shadow: 0 0 0 0 rgba(164,50,32,0.5),  0 4px 24px rgba(0,0,0,0.12); }
    50%  { box-shadow: 0 0 0 8px rgba(58,66,69,0.25), 0 4px 24px rgba(0,0,0,0.12); }
    100% { box-shadow: 0 0 0 0 rgba(164,50,32,0.5),  0 4px 24px rgba(0,0,0,0.12); }
}

.badge-logo-wrap {
    display: flex;
    justify-content: center;
    padding: var(--space-xl) var(--space-lg) var(--space-sm);
}

.badge-logo {
    max-height: 88px;
    max-width: 85%;
    object-fit: contain;
}

.badge-photo-wrap {
    display: flex;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg) 0;
}

.badge-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: var(--shadow-lg);
}

.badge-band {
    margin: var(--space-md) var(--space-lg) 0;
    padding: 8px var(--space-md);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: white;
}

.badge-band-employee   { background: var(--color-red); }
.badge-band-consultant { background: var(--color-blue); }

.badge-name {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text);
    padding: var(--space-sm) var(--space-lg) 0;
    letter-spacing: -0.3px;
}

.badge-live {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.badge-live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    flex-shrink: 0;
    animation: badge-pulse 1.2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.35; transform: scale(0.65); }
}

.badge-clock {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* -----------------------------------------------------------------------------
   SOW / notes rendered content
   ----------------------------------------------------------------------------- */
.sow-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text);
}

.sow-content p { margin-bottom: var(--space-sm); }
.sow-content p:last-child { margin-bottom: 0; }
.sow-content ul { padding-left: var(--space-lg); margin-bottom: var(--space-sm); }
.sow-content li { margin-bottom: 4px; }
.sow-content strong { font-weight: 700; }
.sow-content em { font-style: italic; }

/* -----------------------------------------------------------------------------
   Completion workflow
   ----------------------------------------------------------------------------- */
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}
.checklist-item:last-child { border-bottom: none; }

.checklist-icon {
    color: var(--color-text-subtle);
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 16px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.summary-cell {
    background: #f9fafb;
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
}

.summary-cell-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-subtle);
    margin-bottom: 2px;
}

.summary-cell-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

/* -----------------------------------------------------------------------------
   Duo / verify pages
   ----------------------------------------------------------------------------- */
.duo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-blue-light);
    border-radius: 50%;
}

.duo-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #dbeafe;
    border-top-color: var(--color-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* -----------------------------------------------------------------------------
   Utility
   ----------------------------------------------------------------------------- */
.d-flex   { display: flex; }
.d-none   { display: none; }
.mt-sm    { margin-top: var(--space-sm); }
.mt-md    { margin-top: var(--space-md); }
.mt-lg    { margin-top: var(--space-lg); }
.mb-sm    { margin-bottom: var(--space-sm); }
.mb-md    { margin-bottom: var(--space-md); }
.mb-lg    { margin-bottom: var(--space-lg); }
.gap-sm   { gap: var(--space-sm); }
.gap-md   { gap: var(--space-md); }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1   { flex: 1; }
.w-full   { width: 100%; }
.rounded  { border-radius: var(--radius-md); }

/* Divider */
.divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-md) 0;
}

/* No-wrap ID badge (monospaced identifier) */
.id-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: #f3f4f6;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 2px 7px;
    white-space: nowrap;
}