/* =========================================================================
   Surfnstein Manager — design system
   Tokens extracted from the official site (surfnstein.com.br):
   black canvas, dark olive surfaces, neon lime accent,
   Archivo (body) + Space Grotesk (display).
   ========================================================================= */

:root {
    --bg: #000000;
    --surface: #0A0B08;
    --panel: #15160E;
    --panel-2: #1B1D12;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #FFFFFF;
    --text-soft: #C7CCBE;
    --text-muted: #8B9080;
    --accent: #C8FC11;
    --accent-soft: rgba(200, 252, 17, 0.12);
    --accent-border: rgba(200, 252, 17, 0.35);
    --accent-ink: #0A0C05;
    --danger: #FF5D5D;
    --danger-soft: rgba(255, 93, 93, 0.12);
    --font-body: 'Archivo', system-ui, sans-serif;
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-w: 264px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    margin: 0;
    line-height: 1.15;
}

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

#app { min-height: 100vh; }

/* ---------- boot screen (index.html loader) ---------- */

.boot-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: var(--bg);
}

.boot-logo { width: min(320px, 70vw); height: auto; }

.boot-tag {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0.55em;
    padding-left: 0.55em;
    color: var(--text-muted);
}

.boot-bar {
    width: min(320px, 70vw);
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.boot-bar-fill {
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.2s ease;
}

/* ---------- generic ui ---------- */

.eyebrow {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--accent);
}

.page {
    padding: 40px 48px 64px;
    max-width: 1280px;
}

.page-head { margin-bottom: 32px; }

.page-head h1 {
    font-size: 34px;
    font-weight: 700;
    margin-top: 6px;
}

.page-head .lead { color: var(--text-muted); margin: 10px 0 0; max-width: 640px; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.card h3 { font-size: 18px; margin-bottom: 6px; }
.card .muted { color: var(--text-muted); font-size: 14px; margin: 0; }

.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; }
.card-link .card { transition: border-color 0.15s ease, transform 0.15s ease; height: 100%; }
.card-link:hover .card { border-color: var(--accent-border); transform: translateY(-2px); }

.card-num {
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.2em;
    margin-bottom: 14px;
}

.badge {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    padding: 4px 12px;
}

.placeholder-panel {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 48px 32px;
    text-align: center;
    color: var(--text-muted);
}

.placeholder-panel .badge { margin-bottom: 16px; }
.placeholder-panel p { margin: 0; }

/* ---------- forms ---------- */

.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 8px;
}

.input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    padding: 12px 22px;
    cursor: pointer;
    transition: filter 0.15s ease, background 0.15s ease;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
    border-color: var(--border-strong);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); }

.btn-block { width: 100%; }

.form-error {
    background: var(--danger-soft);
    border: 1px solid rgba(255, 93, 93, 0.4);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 18px;
}

/* ---------- login ---------- */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 60% 40% at 50% -10%, rgba(200, 252, 17, 0.07), transparent),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
}

.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand img { width: 240px; max-width: 100%; height: auto; }

.login-brand .boot-tag { margin-top: 10px; }

.login-foot {
    margin-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ---------- app shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand img { width: 100%; height: auto; display: block; }

.sidebar-brand .boot-tag {
    font-size: 10px;
    margin-top: 8px;
    text-align: center;
}

.sidebar-nav { flex: 1; padding: 20px 14px; overflow-y: auto; }

.nav-section {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 18px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 14.5px;
    font-weight: 500;
    border-left: 2px solid transparent;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.05); text-decoration: none; }

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-left-color: var(--accent);
}

.nav-item .ico { font-size: 16px; width: 20px; text-align: center; }

.sidebar-user {
    border-top: 1px solid var(--border);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-user .who { flex: 1; min-width: 0; }
.sidebar-user .who .name {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user .who .role { font-size: 11.5px; color: var(--text-muted); }

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}
.logout-btn:hover { color: var(--danger); background: var(--danger-soft); }

.main { flex: 1; min-width: 0; background: var(--bg); }

/* ---------- tables (base for later phases) ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.data th {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

table.data td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: rgba(255, 255, 255, 0.025); }

/* ---------- blazor error ui ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--panel-2);
    border: 1px solid rgba(255, 93, 93, 0.5);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

#blazor-error-ui .reload { margin-left: 10px; }
#blazor-error-ui .dismiss { margin-left: 12px; cursor: pointer; color: var(--text-muted); }

/* ---------- products / management screens ---------- */

.muted-line { color: var(--text-muted); font-size: 13.5px; margin: 12px 0; }

.alert-success {
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 18px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 8px;
}

.toolbar-field { min-width: 170px; }
.toolbar-field label {
    display: block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.toolbar-grow { flex: 1; min-width: 220px; }
.toolbar-actions { display: flex; gap: 10px; margin-left: auto; }

.status-badge {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 3px 10px;
    border: 1px solid var(--border-strong);
    color: var(--text-soft);
}

.status-available { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.status-paused { color: #FFC94D; background: rgba(255, 201, 77, 0.12); border-color: rgba(255, 201, 77, 0.4); }
.status-sold { color: var(--text-muted); background: rgba(255, 255, 255, 0.05); }

.cell-thumb { width: 56px; }
.thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
}
.thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
}

.link-flag {
    margin-left: 8px;
    font-family: var(--font-display);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
}

.table-actions { white-space: nowrap; text-align: right; }

.btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-left: 6px;
    border-radius: 7px;
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-soft);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}
.btn-mini:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; }
.btn-mini:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-mini-danger:hover { color: var(--danger); border-color: rgba(255, 93, 93, 0.5); background: var(--danger-soft); }

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.edit-grid {
    display: grid;
    grid-template-columns: minmax(340px, 1.2fr) minmax(300px, 1fr);
    gap: 16px;
    align-items: start;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { color: var(--text-muted); font-size: 12.5px; margin-top: 6px; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

textarea.input { resize: vertical; min-height: 90px; }

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238B9080'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.media-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}
.media-item img { width: 100%; height: 90px; object-fit: cover; display: block; }
.media-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 0;
}
.media-kind { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.media-item-actions { display: flex; justify-content: flex-end; padding: 4px 6px 8px; }

.import-preview th { min-width: 150px; vertical-align: top; }
.import-col-name {
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-soft);
    margin-bottom: 6px;
}
.import-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.input-compact { padding: 7px 10px; font-size: 13px; }

@media (max-width: 1000px) {
    .edit-grid { grid-template-columns: 1fr; }
    .toolbar-actions { margin-left: 0; width: 100%; }
}

/* ---------- analytics ---------- */

.page-wide { max-width: 1480px; }

.chip-group {
    display: inline-flex;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px;
}

.chip {
    border: none;
    background: transparent;
    color: var(--text-soft);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}
.chip:hover { color: var(--text); }
.chip-active { background: var(--accent); color: var(--accent-ink); }
.chip-active:hover { color: var(--accent-ink); }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.kpi { padding: 18px 20px; }
.kpi-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.kpi-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--text); line-height: 1.1; }
.kpi-value-sm { font-size: 20px; }
.kpi-sub { font-size: 16px; color: var(--text-muted); font-weight: 500; }
.kpi-note { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; }
.kpi-plans { display: flex; flex-direction: column; gap: 4px; }
.kpi-plan-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-soft); }

.analytics-two-col {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
}
@media (max-width: 1000px) { .analytics-two-col { grid-template-columns: 1fr; } }

.analytics-section { margin-top: 28px; }
.section-title {
    font-size: 20px;
    margin-bottom: 14px;
    padding-left: 12px;
    border-left: 3px solid var(--accent);
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.chart-card { padding: 16px 18px 12px; }
.chart-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}
.chart-title { font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.chart-total { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--accent); }
.chart-foot {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 11.5px;
    margin-top: 6px;
}

.linechart-wrap { position: relative; width: 100%; height: 90px; }
.linechart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.linechart-area { fill: rgba(200, 252, 17, 0.12); stroke: none; }
.linechart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.linechart-dots { pointer-events: all; }
.linechart-dot { fill: transparent; }
.linechart-dot:hover { fill: var(--accent); }

.barlist { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.barlist-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr 120px; align-items: center; gap: 12px; }
.barlist-label {
    font-size: 13.5px;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.barlist-track { height: 14px; background: rgba(255, 255, 255, 0.06); border-radius: 999px; overflow: hidden; }
.barlist-fill { height: 100%; background: var(--accent); border-radius: 999px; min-width: 2px; }
.barlist-value { font-size: 13.5px; color: var(--text); text-align: right; white-space: nowrap; }
.barlist-rate { color: var(--text-muted); margin-left: 6px; font-size: 12px; }

table.data tfoot td { border-top: 1px solid var(--border-strong); background: var(--surface); }

.billing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
}

/* ---------- messaging ---------- */

.msg-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 1000px) { .msg-layout { grid-template-columns: 1fr; } }

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

.msg-item {
    text-align: left;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color 0.15s ease;
    width: 100%;
}
.msg-item:hover { border-color: var(--border-strong); }
.msg-item-active { border-color: var(--accent-border); background: var(--panel-2); }

.msg-item-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.msg-user { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.msg-item-mid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.msg-preview {
    color: var(--text-muted);
    font-size: 13px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.msg-detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }

.msg-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-top: 14px;
    white-space: pre-wrap;
    font-size: 14.5px;
    line-height: 1.6;
}
.msg-bubble-reply { border-color: var(--accent-border); background: var(--accent-soft); }
.msg-bubble-tag {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.user-pick {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
    padding: 10px 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font-body);
}
.user-pick:last-child { border-bottom: none; }
.search-row { display: flex; gap: 8px; }
.search-row .input { flex: 1; }
.user-pick:hover { color: var(--accent); }
.user-pick .muted { color: var(--text-muted); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
    .shell { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sidebar-brand { padding: 18px 20px 14px; }
    .sidebar-brand img { width: 200px; }
    .sidebar-nav { padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 4px; }
    .nav-section { display: none; }
    .nav-item { border-left: none; }
    .page { padding: 24px 20px 48px; }
}
