/* DoorTrack — base styles */

:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f7f8f9;
    --color-surface: #ffffff;
    --color-border: #e2e5e9;
    --color-text: #111827;
    --color-text-muted: #52565e;
    --color-primary: #12543a;
    --color-primary-hover: #0e422c;
    --color-primary-light: #e8f3ee;
    --color-accent: #b91c1c;
    --color-accent-hover: #991b1b;
    --color-success: #15803d;
    --color-warning: #b45309;
    --color-error: #b91c1c;
    --color-info: #1d4ed8;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.05);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size: 15px;
    --line-height: 1.55;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg-alt);
    line-height: var(--line-height);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-hover);
}

code {
    font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
    background: var(--color-bg-alt);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

/* Layout */

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */

.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.logo:hover {
    color: var(--color-text);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-links a {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--color-text);
}

.nav-links a.btn-small {
    color: #fff;
}

.nav-links a.btn-small:hover {
    color: #fff;
    background: var(--color-primary-hover);
}

.btn-small {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
}

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

/* Buttons */

.btn-primary,
.btn-secondary,
.btn-card,
.btn-card-primary {
    display: inline-block;
    text-align: center;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    transition: background 0.12s ease, transform 0.05s ease;
}

.btn-primary,
.btn-card-primary {
    background: var(--color-primary);
    color: #fff;
    padding: 10px 20px;
}

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

.btn-primary:active,
.btn-card-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
}

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

.btn-secondary.btn-small {
    padding: 6px 14px;
}

.btn-card {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    padding: 10px 18px;
    width: 100%;
    margin-top: 12px;
}

.btn-card:hover {
    background: var(--color-bg-alt);
    border-color: #cbd0d6;
}

.btn-full {
    width: 100%;
    margin-top: 8px;
    padding: 11px 18px;
}

/* Hero */

.hero {
    background: var(--color-surface);
    padding: 56px 0 48px;
    border-bottom: 1px solid var(--color-border);
}

.hero .container {
    text-align: center;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 16px;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 520px;
    margin: 0 auto 24px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.hero-note {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.hero-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    text-align: left;
}

.hero-split .hero-sub {
    margin-left: 0;
}

.hero-split .hero-actions {
    justify-content: flex-start;
}

.video-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm, 8px);
    overflow: hidden;
    border: 1px solid var(--color-border);
    background: var(--color-bg-alt);
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 760px) {
    .hero-split {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-split .hero-sub {
        margin: 0 auto 24px;
    }
    .hero-split .hero-actions {
        justify-content: center;
    }
}

/* Sections */

.how-section,
.features-section {
    padding: 48px 0;
}

.how-section h2,
.features-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.step {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.step h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.step p {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.feature {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.feature h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.feature p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Footer */

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: 16px 0;
}

.site-footer .container {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Auth pages */

.auth-page {
    flex: 1;
    padding: 48px 0;
}

.auth-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    width: 100%;
    max-width: 720px;
    box-shadow: var(--shadow-md);
}

.auth-header {
    margin-bottom: 20px;
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.auth-sub {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.auth-form .form-group {
    margin-bottom: 14px;
}

.auth-form label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-text);
}

.auth-form input {
    width: 100%;
    padding: 9px 11px;
    font-size: 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.auth-form input::placeholder {
    color: #9aa1a8;
}

.auth-terms,
.auth-forgot {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-top: 14px;
    text-align: center;
}

.auth-forgot {
    text-align: left;
}

.auth-terms a,
.auth-forgot a {
    color: var(--color-primary);
    font-weight: 500;
}

.auth-footer {
    margin-top: 18px;
    font-size: 0.92rem;
    color: var(--color-text-muted);
    text-align: center;
}

.auth-footer a {
    font-weight: 600;
}

/* Flash messages */

.flash-messages {
    margin-bottom: 16px;
}

.flash {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.flash-error {
    background: #fef2f2;
    color: var(--color-error);
    border: 1px solid #fecaca;
}

.flash-success {
    background: #f0fdf4;
    color: var(--color-success);
    border: 1px solid #bbf7d0;
}

.flash-info {
    background: #eff6ff;
    color: var(--color-info);
    border: 1px solid #bfdbfe;
}

/* Pricing page */

.pricing-page {
    padding: 48px 0 64px;
}

.pricing-page h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.pricing-sub {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    margin-bottom: 32px;
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.pricing-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
}

.pricing-card-featured {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    position: relative;
}

.card-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-header {
    margin-bottom: 12px;
}

.card-tier {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.card-price {
    margin: 8px 0;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-amount {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.price-unit {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.card-doors {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
    flex: 1;
}

.card-features li {
    padding: 5px 0;
    font-size: 0.92rem;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.card-features li:last-child {
    border-bottom: none;
}

.card-features li::before {
    content: "✓";
    color: var(--color-success);
    font-weight: 700;
    margin-right: 8px;
}

.pricing-note {
    background: var(--color-primary-light);
    color: var(--color-primary);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.92rem;
    text-align: center;
    margin-bottom: 32px;
}

/* FAQ */

.faq {
    border-top: 1px solid var(--color-border);
    padding-top: 24px;
}

.faq h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
    padding: 14px 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.faq-item p {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

/* Responsive */

@media (max-width: 760px) {
    .hero h1 {
        font-size: 1.7rem;
    }

    .hero-sub {
        font-size: 1rem;
    }

    .steps,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .pricing-cards {
        grid-template-columns: 1fr;
    }

    .pricing-card-featured {
        order: -1;
    }

    .nav-links a:not(.btn-small) {
        display: none;
    }
}

/* Role badges */

.role-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 999px;
    line-height: 1.4;
}

.role-owner {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.role-manager {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.role-maintenance {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.role-receptionist {
    background: #faf5ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

/* Page header actions */

.page-header-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Property cards on dashboard */

.property-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.property-card {
    position: relative;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
}

.property-card:hover {
    background: var(--color-bg-alt);
    border-color: var(--color-primary);
    border-radius: var(--radius);
}

.property-card-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.property-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.property-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Card is clickable via the name link's overlay; buttons sit above it. */
.property-card-link {
    color: inherit;
    text-decoration: none;
}

.property-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
}

.property-card-actions {
    position: relative;
    z-index: 1;
}

.property-card-stats {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.property-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 600;
}

.property-stat-value {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Dashboard stats cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 16px 0 24px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-card-billing {
    border-color: var(--color-primary-light);
    background: var(--color-primary-light);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 600;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.stat-card-billing .stat-value {
    font-size: 1rem;
}

.billing-plan-trial {
    color: var(--color-primary);
}

.billing-plan-ends {
    font-size: 0.75rem;
    font-weight: 400;
}

.billing-plan-expired {
    color: var(--color-error);
}

.billing-plan-small {
    color: #2563eb;
}

.billing-plan-medium {
    color: #7c3aed;
}

.billing-plan-large {
    color: var(--color-text-muted);
}

.btn-link-stat {
    font-size: 0.75rem;
    color: var(--color-primary);
    text-decoration: underline;
    margin-top: 4px;
    align-self: flex-start;
}

.btn-link-stat:hover {
    color: var(--color-primary-hover);
}

/* Account page (M4) */
.account-page {
    padding: 32px 0 48px;
}

.account-page h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.account-page .section {
    margin-top: 32px;
}

.account-page .section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.account-page .section-sub {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.card-large {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 8px;
}

.card-large .card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.card-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 600;
}

.plan-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
}

.plan-badge.plan-trial {
    background: var(--color-primary);
}

.plan-badge.plan-small {
    background: #2563eb;
}

.plan-badge.plan-medium {
    background: #7c3aed;
}

.plan-badge.plan-large {
    background: var(--color-text-muted);
}

.billing-details {
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
    margin-bottom: 16px;
}

.billing-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.95rem;
}

.billing-label {
    color: var(--color-text-muted);
}

.billing-value {
    font-weight: 600;
}

.billing-row-warning {
    color: var(--color-warning);
}

.billing-row-error {
    color: var(--color-error);
}

.billing-plan-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.billing-plan-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.plan-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.plan-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.plan-item-price {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-primary);
}

.plan-item-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.plan-item-example {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.section-trial {
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}

.section-trial-expired {
    background: #fef2f2;
    border-color: var(--color-error);
}

.trial-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.trial-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.trial-icon-expired {
    background: var(--color-error);
}

.trial-card p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.trial-card p:first-child {
    font-weight: 600;
    margin-bottom: 2px;
}

.trial-card p:last-child {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.account-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
}

.account-detail-row:last-child {
    border-bottom: none;
}

.account-detail-label {
    color: var(--color-text-muted);
}

.account-detail-value {
    font-weight: 600;
}

.help-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* Work order detail — verify button */
.verify-work-order-btn {
    margin-top: 12px;
    flex-shrink: 0;
    align-self: flex-start;
}
}

/* Link variants */



.contact-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.contact-trade {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    flex-basis: 180px;
}

.contact-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}

.link-delete {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link-delete:hover {
    color: var(--color-accent-hover);
}

/* Inline forms */

.inline-form {
    display: inline;
}

/* Team list */

.team-card {
    max-width: 580px;
}

.team-section {
    margin-bottom: 22px;
    padding: 18px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.team-section:last-of-type {
    margin-bottom: 14px;
}

.team-section + .team-section {
    margin-top: 20px;
}

.team-section-add {
    background: var(--color-primary-light);
    border-color: #86efac;
}

.team-section-resolved {
    background: #f0fdf4;
    border-color: #86efac;
}

.team-section-pending {
    background: #fffbeb;
    border-color: #fcd34d;
}

.team-section h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-section h2::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    margin-right: 8px;
}

.team-section-pending h2::before {
    background: var(--color-warning);
}

.team-section-resolved h2::before {
    background: var(--color-success);
}

.team-section-add h2::before {
    background: var(--color-primary);
}

.team-section-pending {
    background: #fffbeb;
    border-color: #fcd34d;
}

.team-section-resolved {
    background: #f0fdf4;
    border-color: #86efac;
}

.team-section-add {
    background: var(--color-primary-light);
    border-color: #86efac;
}

.team-section-pending .team-list,
.team-section-resolved .team-list {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

|.team-section-pending .team-member {
    background: #fffbeb;
    border: 1px dashed #fcd34d;
    color: #92400e;
}

|.team-section-resolved .team-member {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

|.team-empty {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin: 6px 0 0;
}

|.team-help {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.team-help strong {
    color: var(--color-text);
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.team-member-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.team-member-name {
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-member-email {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-member-role {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-member-pending {
    opacity: 0.85;
}

.invite-pending {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    border: 1px dashed var(--color-border);
    margin-right: 8px;
}

.team-empty {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.remove-form {
    margin: 0;
}

/* Checkbox label */

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500 !important;
    cursor: pointer;
    padding: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Work orders — M2 */

.work-orders-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.toolbar-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-sans);
}

.filter-select:focus {
    outline: 2px solid var(--color-primary-light);
    border-color: var(--color-primary);
}

.work-orders-summary {
    margin-bottom: 16px;
}

.summary-bars {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.summary-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.summary-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.summary-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
}

.work-orders-table-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.work-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.work-orders-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
}

.work-orders-table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

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

.work-orders-table tbody tr:hover {
    background: var(--color-bg-alt);
    cursor: pointer;
}

.work-orders-table tbody tr td:last-child {
    width: 0;
    padding: 0;
}



.wo-row.wo-new td {
    font-weight: 500;
}

/* Compact meta line: Due / Source / Created */
.wo-meta-line {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    display: block;
}

.wo-meta-line .meta-label {
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    margin-right: 2px;
}

.status-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 999px;
    line-height: 1.4;
}

.status-new {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.status-assigned {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.status-in_progress {
    background: #fefce8;
    color: #b45309;
    border: 1px solid #fde68a;
}

.status-done {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.urgency-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    line-height: 1.4;
}

.urgency-Emergency {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.urgency-High {
    background: #fefce8;
    color: #b45309;
    border: 1px solid #fde68a;
}

.urgency-Normal {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.urgency-Low {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 0.88rem;
    font-weight: 500;
}

.btn-link:hover {
    color: var(--color-primary-hover);
}

/* Work order form — M2 */

.work-order-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group-half {
    flex: 1;
    min-width: 200px;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.full-width {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-surface);
}

.full-width:focus {
    outline: 2px solid var(--color-primary-light);
    border-color: var(--color-primary);
}

.full-width::placeholder {
    color: var(--color-text-muted);
}

.field-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Helper text under form fields (e.g. "One door = one unit.") */
.help-text {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0.35rem 0 0;
}

/* De-emphasized table cells and empty-state messages */
.muted {
    color: var(--color-text-muted);
}

.field-label-meta {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.meta-line {
    font-size: 0.92rem;
    color: var(--color-text);
}

.meta-value {
    font-weight: 600;
}

.meta-hint {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-left: 6px;
}

.due-date-preview {
    padding: 10px 14px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
}

.due-date-preview .label {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-right: 6px;
}

.due-date-preview .value {
    font-weight: 600;
    color: var(--color-text);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.delete-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.btn-text-delete {
    background: none;
    border: none;
    color: var(--color-accent);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
}

.btn-text-delete:hover {
    color: var(--color-accent-hover);
}

.work-order-log-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.work-order-log-section h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.log-entry {
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-action {
    font-weight: 500;
    font-size: 0.9rem;
}

.log-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-left: 8px;
}

.log-notes {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin: 2px 0 0 16px;
    font-style: italic;
}

/* Responsive work orders table */

@media (max-width: 760px) {
    .work-orders-table th:nth-child(5),
    .work-orders-table td:nth-child(5),
    .work-orders-table th:nth-child(6),
    .work-orders-table td:nth-child(6),
    .work-orders-table th:nth-child(7),
    .work-orders-table td:nth-child(7) {
        display: none;
    }

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

    .toolbar-actions {
        display: flex;
        justify-content: flex-end;
    }
}

/* Units page (M5) */

.units-page {
    padding: 32px 0 48px;
}

.units-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.units-page h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.units-page .page-sub {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.units-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin-top: 12px;
}

.units-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
}

.units-table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    vertical-align: middle;
}

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

.units-table tbody tr:hover {
    background: var(--color-bg-alt);
}

.units-table .edit-row {
    background: var(--color-primary-light);
}

.units-table .edit-row td {
    padding: 12px 14px;
}

.units-table .hidden {
    display: none;
}

.units-table .inline-form-wide {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.units-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 16px;
}

.units-section h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.units-section .auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.units-section .btn-primary {
    margin-top: 4px;
}

.inline-form {
    display: inline;
}

/* ---------------------------------------------------------------------------
   Page shells, cards, tables, and wizard steps referenced by templates.
   Added so the class audit (scripts/audit_template_classes.py) reports 0 undefined.
   --------------------------------------------------------------------------- */

/* Generic button modifiers used with .btn-primary / .btn-secondary */
.btn {
    display: inline-block;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-card-secondary {
    color: var(--color-primary);
}

/* Form inputs used outside the .form-group shell (e.g. feedback form) */
.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Generic card (account page, billing) */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

/* Dashboard / work orders / properties page shells */
.dashboard-page,
.properties-page {
    padding: 24px 0 48px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.dashboard-sub {
    color: var(--color-text-muted);
    margin: 4px 0 0;
    font-size: 0.95rem;
}

.dashboard-section {
    margin-bottom: 32px;
}

.dashboard-empty,
.empty-state {
    text-align: center;
    padding: 32px 20px;
    background: var(--color-bg-alt);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
}

.empty-state .btn-primary {
    margin-top: 12px;
}

/* Property list table */
.property-table-wrap {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.property-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.property-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
}

.property-table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

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

/* Small label + value pairs shown on each dashboard property card */
.property-stat {
    display: inline-flex;
    flex-direction: column;
    margin-right: 16px;
}

.property-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.property-stat-value {
    font-weight: 600;
    color: var(--color-text);
}

/* Expired-trial variant of the trial notice card */
.trial-card-expired {
    border-left: 3px solid var(--color-error);
    padding-left: 12px;
}

/* Terms / privacy body text */
.terms-content {
    color: var(--color-text);
}

.terms-content h2 {
    font-size: 1.1rem;
    margin: 1.5em 0 0.5em;
}

/* Onboarding wizard progress bar */
.wizard-progress {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    gap: 8px;
}

.wizard-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    border-bottom: 3px solid var(--color-border);
}

.wizard-step.active {
    color: var(--color-text);
    font-weight: 600;
    border-bottom-color: var(--color-primary);
}

.wizard-step.done {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.wizard-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid currentColor;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.wizard-step.done .wizard-step-num {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.wizard-step-label {
    line-height: 1.2;
}

/* Checkbox row inside a form-group (onboarding inbox) */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Optional "pick from contacts" select on the work order forms */
.contacts-dropdown select {
    width: 100%;
}

/* ---------------------------------------------------------------------------
   Printable work order sheet (/work-orders/<id>/print)
   --------------------------------------------------------------------------- */
.print-sheet {
    max-width: 780px;
    margin: 24px auto;
    padding: 0 16px;
}

.print-sheet-header h1 {
    margin: 0 0 4px 0;
    font-size: 1.6rem;
}

.print-sub {
    margin: 0 0 16px 0;
    color: #555;
}

.print-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
    margin: 0 0 24px 0;
}

.print-field {
    margin: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 6px;
}

.print-field-wide {
    grid-column: 1 / -1;
}

.print-field dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}

.print-field dd {
    margin: 2px 0 0 0;
    white-space: normal;
}

.print-multiline {
    white-space: pre-wrap;
}




.print-footer-note {
    margin-top: 24px;
    font-size: 0.8rem;
    color: #666;
}

@media print {
    .no-print {
        display: none !important;
    }

    body.print-page {
        background: #fff;
        color: #000;
    }

    .print-sheet {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .print-field {
        border-color: #999;
    }

}


/* ---------------------------------------------------------------------------
   Phone layout (<= 760px) for the work order list and detail pages.
   Scoped with page classes so other pages are unchanged.
   --------------------------------------------------------------------------- */
@media (max-width: 760px) {
    /* List header: logo on top, nav as two columns beneath it.
       Column 1: Dashboard, Add work order. Column 2: Properties, Sign out. */
    .wo-list-header .container {
        height: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .wo-list-nav {
        display: grid;
        grid-template-rows: auto auto;
        grid-auto-flow: column;
        grid-template-columns: 1fr 1fr;
        gap: 6px 8px;
        width: 100%;
    }

    .wo-list-nav a {
        text-align: center;
        width: 100%;
    }

    .wo-list-nav a[href="/dashboard"] { order: 1; }
    .wo-list-nav a[href="/work-orders/add"] { order: 2; }
    .wo-list-nav a[href="/properties"] { order: 3; }
    .wo-list-nav a[href="/logout"] { order: 4; }

    /* List toolbar: filter fields in a 2-column grid, then one row holding
       Filter, Check inbox now, and New work order. */
    .wo-list-main .work-orders-toolbar {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 8px;
    }

    .wo-list-main .toolbar-filters,
    .wo-list-main .filter-form,
    .wo-list-main .toolbar-actions {
        display: contents;
    }

    .wo-list-main .filter-form .filter-select,
    .wo-list-main .filter-form a.btn-small {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        box-sizing: border-box;
        order: 1;
    }

    .wo-list-main .filter-form button[type="submit"],
    .wo-list-main .toolbar-actions .inline-form,
    .wo-list-main .toolbar-actions a.btn-primary {
        flex: 1 1 0;
        min-width: max-content;
        order: 2;
        text-align: center;
        white-space: nowrap;
        box-sizing: border-box;
    }

    .wo-list-main .toolbar-actions .inline-form button {
        width: 100%;
        white-space: nowrap;
    }

    .wo-list-main .filter-form button[type="submit"],
    .wo-list-main .toolbar-actions .inline-form button,
    .wo-list-main .toolbar-actions a.btn-primary {
        padding: 8px 8px;
        font-size: 0.85rem;
        height: 36px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Detail page: stack the card and the activity log so the card is centred. */
    .wo-detail-page .auth-container {
        flex-direction: column;
        align-items: stretch;
    }

    .wo-detail-page .wo-meta-line {
        white-space: normal;
    }
}

/* Email-verification banner (shown under the header to unverified accounts) */
.verify-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff8e1;
    border-bottom: 1px solid #f0d98a;
    color: #5c4700;
    font-size: 0.95rem;
}
.verify-banner-form { margin: 0; }
