*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: #111827;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header app */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-weight: 700;
    font-size: 1.05rem;
    max-width: 220px;
}

.main-nav a {
    margin-right: 1rem;
    font-size: 0.9rem;
    padding-bottom: 0.2rem;
    border-bottom: 2px solid transparent;
}

.main-nav a.nav-active {
    border-color: #2563eb;
    font-weight: 600;
}

.main-nav a:last-child {
    margin-right: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

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

.main-footer {
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
    background: #f9fafb;
}

/* Auth */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #dbeafe, #f5f7fb);
}

.auth-card {
    background: #ffffff;
    padding: 2rem 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(15,23,42,0.12);
    max-width: 380px;
    width: 100%;
}

.auth-card h1 {
    margin: 0;
    font-size: 1.8rem;
    text-align: center;
}

.auth-card h1 span {
    color: #2563eb;
}

.auth-card .subtitle {
    margin-top: 0.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form label {
    font-size: 0.85rem;
    color: #4b5563;
}

.form input,
.form textarea,
.form select {
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
    border-color: #2563eb;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-primary:hover {
    opacity: 0.92;
    text-decoration: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid #c4c9d5;
    background: #ffffff;
    color: #111827;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-outline {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-link {
    border: none;
    background: none;
    color: #2563eb;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-small {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 999px;
    border: 1px solid #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

/* Landing */
.landing-body {
    background: radial-gradient(circle at top, #dbeafe, #f5f7fb);
    margin: 0;
}

.landing-header {
    background: transparent;
    padding: 1rem 0;
}

.landing-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.landing-nav a {
    margin-left: 1rem;
    font-size: 0.9rem;
}

.hero {
    padding: 3rem 0 2.5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 2rem;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
}

.hero h1 span {
    color: #2563eb;
}

.hero-subtitle {
    color: #4b5563;
    max-width: 520px;
    font-size: 0.98rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.hero-footnote {
    font-size: 0.85rem;
    color: #6b7280;
}

.hero-card {
    background: #0f172a;
    color: #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem 1.6rem;
    box-shadow: 0 18px 40px rgba(15,23,42,0.7);
}

.hero-card h2 {
    margin-top: 0;
}

.hero-card ul {
    padding-left: 1.2rem;
    font-size: 0.9rem;
}

.pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    padding-bottom: 2rem;
}

.pillar-card {
    background: #ffffff;
    border-radius: 0.9rem;
    padding: 1rem 1.1rem;
    box-shadow: 0 10px 20px rgba(15,23,42,0.08);
}

.landing-footer {
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 1.5rem 0;
    font-size: 0.85rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

/* Legal */
.legal-body {
    background: #f5f7fb;
    margin: 0;
    padding: 2rem 0;
}

.legal-card {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 15px 30px rgba(15,23,42,0.08);
    font-size: 0.95rem;
}

.legal-card h1 {
    margin-top: 0;
}

/* Layout app */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.4rem;
}

.page-header p {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: #ffffff;
    border-radius: 0.9rem;
    padding: 1rem 1.1rem;
    box-shadow: 0 10px 20px rgba(15,23,42,0.08);
}

.card h2,
.card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.card p {
    margin: 0.1rem 0;
}

.kpi {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

.muted {
    color: #6b7280;
    font-size: 0.85rem;
}

.two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1rem;
}

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

/* Tables */
.table-wrapper {
    background: #ffffff;
    border-radius: 0.9rem;
    box-shadow: 0 10px 20px rgba(15,23,42,0.05);
    padding: 0.75rem;
    overflow-x: auto;
}

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

th, td {
    padding: 0.5rem 0.6rem;
    text-align: left;
}

th {
    background: #f9fafb;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
}

tbody tr:nth-child(even) {
    background: #f9fafb;
}

.status {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved,
.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-paused {
    background: #e5e7eb;
    color: #374151;
}

.status-finished {
    background: #fee2e2;
    color: #991b1b;
}

/* Misc */
.steps {
    padding-left: 1.2rem;
    font-size: 0.9rem;
}

.steps li + li {
    margin-top: 0.25rem;
}

.code-block {
    background: #111827;
    color: #e5e7eb;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8rem;
    overflow-x: auto;
}

.thumb {
    max-width: 120px;
    max-height: 80px;
    border-radius: 0.5rem;
    margin-top: 0.25rem;
    object-fit: cover;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.form-inline select,
.form-inline input {
    min-width: 140px;
}

.two-columns .form > div {
    margin-bottom: 0.75rem;
}

.react-root { margin-top: 0.5rem; }


.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.market-card {
    background: #ffffff;
    border-radius: 0.9rem;
    box-shadow: 0 10px 20px rgba(15,23,42,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.market-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.market-card-body {
    padding: 0.9rem 1rem 1rem;
    font-size: 0.9rem;
}

.market-card-body h2 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
}

.market-location {
    margin: 0;
    color: #6b7280;
    font-size: 0.85rem;
}

.market-type {
    margin: 0.3rem 0;
    color: #4b5563;
    font-size: 0.85rem;
}

.market-price {
    margin: 0.4rem 0 0.6rem;
    font-weight: 500;
}

.market-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    align-items: flex-end;
}

.market-filters-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.alert {
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

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

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}


.status-new {
    background: #dbeafe;
    color: #1d4ed8;
}
.status-contacted {
    background: #e0f2fe;
    color: #0369a1;
}
.status-won {
    background: #dcfce7;
    color: #166534;
}
.status-lost {
    background: #fee2e2;
    color: #991b1b;
}
.status-archived {
    background: #f3f4f6;
    color: #4b5563;
}

.logo-img {
    max-height: 32px;
    display: block;
}

@media (max-width: 640px) {
    .logo-img {
        max-height: 28px;
    }
}

.links-list {
    list-style: none;
    margin: 0;
    padding-left: 0;
    font-size: 0.9rem;
}

.links-list li + li {
    margin-top: 0.75rem;
}

.link-title {
    font-weight: 600;
}

.links-list .code-block {
    margin-top: 0.25rem;
}

/* ===== UrbanAdMarket Airbnb-like Marketplace Layout ===== */
.market-layout {
  display: grid;
  grid-template-columns: minmax(0,2fr) minmax(300px,1fr);
  gap: 1.2rem;
  margin-top: 1rem;
}

.market-side { position: sticky; top: 1rem; }

.market-map-card {
  background: #fff;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.10);
}

#market-map {
  width: 100%;
  height: 350px;
  border-radius: 1rem;
  overflow: hidden;
}

/* Improved cards */
.market-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform .2s;
}
.market-card:hover { transform: translateY(-4px); }

.market-card-image {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 1rem 1rem 0 0;
}
.market-card-body {
  padding: .9rem;
}
.market-location { font-size: .85rem; opacity: .7; }
.market-meta { font-size: .8rem; opacity: .65; margin-top:.3rem; }
.market-price { font-size: 1rem; font-weight: 600; margin-top:.4rem; }

@media (max-width: 900px) {
  .market-layout {
    grid-template-columns: 1fr;
  }
  .market-side { position: static; }
  #market-map { height: 260px; }
}
