/* ============================================================
   Trio CRE — Oklahoma County Commercial Sales Dashboard
   Dark theme matching triocre.com branding
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
    --bg-primary: #14181F;
    --bg-secondary: #1C212B;
    --bg-card: #232A36;
    --bg-hover: #2A3242;
    --accent: #FF4400;
    --accent-hover: #E63D00;
    --accent-glow: rgba(255, 68, 0, 0.15);
    --text-primary: #FAFAFA;
    --text-secondary: #A0AEC0;
    --text-muted: #6B7A8D;
    --border: #2D3748;
    --border-light: #3A4556;
    --success: #48BB78;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --transition: 0.2s ease;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- Header ---------- */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-phone:hover {
    color: var(--text-primary);
}

.btn-contact {
    background: var(--accent);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: all var(--transition);
    border: none;
    cursor: pointer;
}

.btn-contact:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 68, 0, 0.3);
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 3rem 2rem 2rem;
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.hero-sub {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
    max-width: 700px;
    line-height: 1.6;
}

/* ---------- Stats Bar ---------- */
.stats-bar {
    background: var(--bg-primary);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.stats-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    text-align: center;
    transition: border-color var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ---------- Filters ---------- */
.filters-section {
    background: var(--bg-primary);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.filters-inner {
    max-width: 1400px;
    margin: 0 auto;
}

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

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 160px;
}

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

.filter-group input,
.filter-group select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: var(--font);
    transition: border-color var(--transition);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-group input::placeholder {
    color: var(--text-muted);
}

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

.btn-filter {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--transition);
}

.btn-filter:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-reset {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--transition);
}

.btn-reset:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.result-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.result-count strong {
    color: var(--text-primary);
}

/* ---------- Table ---------- */
.table-section {
    padding: 0 2rem 2rem;
}

.table-wrapper {
    max-width: 1400px;
    margin: 1.5rem auto 0;
    overflow-x: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table th {
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: center;
}

.data-table th.sortable {
    cursor: pointer;
    transition: color var(--transition);
}

.data-table th.sortable:hover {
    color: var(--accent);
}

.data-table th.sort-asc::after {
    content: " ▲";
    color: var(--accent);
}

.data-table th.sort-desc::after {
    content: " ▼";
    color: var(--accent);
}

.data-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
    text-align: center;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr:nth-child(even) {
    background: var(--bg-card);
}

.data-table tbody tr:nth-child(even):hover {
    background: var(--bg-hover);
}

/* ---------- Footer ---------- */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-brand .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
}

.footer-brand .logo-text {
    font-size: 1.1rem;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.footer-contact {
    line-height: 1.8;
    font-size: 0.9rem;
}

.footer-contact p {
    margin: 0;
}

.footer-links {
    text-align: right;
    font-size: 0.9rem;
}

.footer-hours {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.5rem 0 0;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1.25rem 2rem;
    text-align: center;
}

.footer-bottom p {
    max-width: 1400px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---------- Browse by Section (SEO internal links) ---------- */
.browse-section {
    background: var(--bg-primary);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.browse-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.browse-group h2 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.browse-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
}

.pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.pill-active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.pill-active:hover {
    background: var(--accent-hover);
    color: white;
}

/* ---------- Property Links in Table ---------- */
.property-link {
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

.property-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb-bar {
    background: var(--bg-primary);
    padding: 0.85rem 2rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.breadcrumb-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb-inner a {
    color: var(--text-muted);
    transition: color var(--transition);
}

.breadcrumb-inner a:hover {
    color: var(--accent);
}

.breadcrumb-sep {
    color: var(--text-muted);
    opacity: 0.5;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-link {
    color: var(--accent) !important;
    font-weight: 500;
}

/* ---------- Property Detail Page ---------- */
.property-detail {
    padding: 0 2rem 2rem;
}

.property-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 2rem;
}

.property-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.75rem;
}

.property-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.badge {
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-type {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.badge-status {
    background: rgba(72, 187, 120, 0.12);
    color: var(--success);
    border: 1px solid var(--success);
}

/* Price bar */
.property-price-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

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

.price-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--success);
    letter-spacing: -0.02em;
}

.price-meta {
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.meta-label {
    color: var(--text-muted);
    font-weight: 500;
}

/* Detail grid */
.property-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.detail-card h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.detail-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    margin: 0;
}

.detail-list dt {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.detail-list dd {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    text-align: right;
}

/* CTA */
.property-cta {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.property-cta h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.property-cta p {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 1.5rem;
    font-size: 0.95rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cta-buttons .btn-primary,
.cta-buttons .btn-secondary {
    padding: 0.75rem 1.75rem;
    font-size: 0.9rem;
    border-radius: var(--radius);
}

.cta-buttons .btn-primary:hover {
    box-shadow: 0 4px 16px rgba(255, 68, 0, 0.3);
    color: white;
}

/* ---------- Error Page ---------- */
.error-page {
    text-align: center;
    padding: 6rem 2rem;
}

.error-page h1 {
    font-size: 5rem;
    font-weight: 800;
    color: var(--accent);
    margin: 0 0 0.5rem;
}

.error-page p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .stats-inner {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .footer-links {
        text-align: left;
    }

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

    .browse-inner {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0.75rem 1rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .stats-bar {
        padding: 1rem;
    }

    .stats-inner {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-value {
        font-size: 1.15rem;
    }

    .filters-section {
        padding: 1rem;
    }

    .filters-row {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .filter-actions {
        flex-direction: row;
    }

    .table-section {
        padding: 0 1rem 1rem;
    }

    .nav-phone {
        display: none;
    }

    .property-price-bar {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .price-meta {
        text-align: center;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .property-detail {
        padding: 0 1rem 1rem;
    }
}

@media (max-width: 480px) {
    .stats-inner {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.3rem;
    }
}