/* CRD for Realtors — PWA stylesheet */

:root {
    --crd-primary: #0d6efd;
    --crd-primary-dark: #0a58ca;
    --crd-bg: #f7f9fc;
    --crd-text: #212529;
    --crd-muted: #6c757d;
    --crd-border: #dee2e6;
}

html, body {
    margin: 0;
    height: 100%;
    background: var(--crd-bg);
    color: var(--crd-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: env(safe-area-inset-top, 0) 1rem 0.75rem;
    padding-top: max(env(safe-area-inset-top, 0), 0.75rem);
    background: #fff;
    border-bottom: 1px solid var(--crd-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-header img.logo {
    height: 36px;
    width: auto;
}

.app-header h1 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.app-main {
    flex: 1;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
}

.app-card {
    background: #fff;
    border: 1px solid var(--crd-border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    margin-bottom: 1rem;
}

.app-card h2 {
    font-size: 1.15rem;
    margin: 0 0 1rem 0;
}

.tab-bar {
    display: flex;
    background: #fff;
    border-top: 1px solid var(--crd-border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    position: sticky;
    bottom: 0;
}

.tab-bar button {
    flex: 1;
    background: none;
    border: none;
    padding: 0.75rem 0.25rem;
    color: var(--crd-muted);
    font-size: 0.78rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.tab-bar button.active {
    color: var(--crd-primary);
}

.tab-bar button i {
    font-size: 1.4rem;
}

.referral-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.referral-row {
    background: #fff;
    border: 1px solid var(--crd-border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.referral-row:active { background: #f1f3f5; }

.referral-row .who {
    font-weight: 600;
    font-size: 0.95rem;
}

.referral-row .meta {
    font-size: 0.8rem;
    color: var(--crd-muted);
}

.bucket-pill {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.bucket-Sent      { background: #e7f1ff; color: #0d6efd; }
.bucket-Engaged   { background: #fff3cd; color: #856404; }
.bucket-Booked    { background: #d1e7dd; color: #0f5132; }
.bucket-Active    { background: #cfe2ff; color: #084298; }
.bucket-Completed { background: #e2e3e5; color: #41464b; }

.muted-empty {
    text-align: center;
    color: var(--crd-muted);
    padding: 2rem 1rem;
}

.otp-input {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 1.6rem;
    letter-spacing: 0.5em;
    text-align: center;
    padding: 0.75rem;
}

.flash {
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}
.flash.success { background: #d1e7dd; color: #0f5132; }
.flash.error   { background: #f8d7da; color: #842029; }
.flash.info    { background: #cff4fc; color: #055160; }

.detail-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 1rem;
    row-gap: 0.5rem;
    margin: 0;
}
.detail-list dt {
    color: var(--crd-muted);
    font-weight: 500;
    font-size: 0.85rem;
}
.detail-list dd {
    margin: 0;
    font-size: 0.95rem;
}
