/* Open Solutions B1 — Portal: estilo MVP minimalista. */

:root {
    --brand: #0c4a6e;
    --brand-soft: #075985;
    --bg: #f1f5f9;
    --card: #ffffff;
    --border: #cbd5e1;
    --text: #0f172a;
    --muted: #64748b;
    --error: #b91c1c;
    --error-bg: #fee2e2;
}

* {
    box-sizing: border-box;
}

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

.muted {
    color: var(--muted);
}

/* ─── Login ────────────────────────────────────────────────────────────── */

.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-soft) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.login-card h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--brand);
}

.login-card .muted {
    margin: 0.25rem 0 1.5rem 0;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-card label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.login-card input {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

.login-card input:focus {
    outline: 2px solid var(--brand-soft);
    outline-offset: -1px;
    border-color: var(--brand-soft);
}

.login-card button {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.login-card button:hover {
    background: var(--brand-soft);
}

.login-card .alert {
    padding: 0.75rem 1rem;
    background: var(--error-bg);
    color: var(--error);
    border-radius: 6px;
    font-size: 0.875rem;
}

/* ─── Layout principal ────────────────────────────────────────────────── */

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--brand);
    color: #fff;
}

.topbar .brand {
    font-weight: 600;
    font-size: 1.05rem;
}

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

.user-info .display-name {
    font-weight: 600;
}

.user-info .tenant-name {
    opacity: 0.85;
}

.user-info .logout {
    margin-left: 1rem;
    color: #fff;
    text-decoration: underline;
}

.content {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.topnav {
    display: flex;
    gap: 1.25rem;
    margin: 0 auto 0 1.5rem;
}

.topnav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
}

.topnav a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ─── Tabelas + forms internos ─────────────────────────────────────────── */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--brand-soft);
}

.btn.secondary {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--border);
}

.btn.secondary:hover {
    background: var(--bg);
}

table.entities {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

table.entities th, table.entities td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

table.entities th {
    background: var(--bg);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

table.entities tbody tr:last-child td {
    border-bottom: 0;
}

.entity-form {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.entity-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.entity-form input,
.entity-form select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

.secret-card {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #78350f;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.secret-card code {
    display: block;
    background: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.validation-summary {
    color: var(--error);
    font-size: 0.875rem;
}

#blazor-error-ui {
    background: var(--error-bg);
    color: var(--error);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui.show {
    display: block;
}
