/* Sistema Sublime — área privada */
:root {
    --bg: #0c0e12;
    --bg-elevated: #141820;
    --surface: #1a2029;
    --border: rgba(255, 255, 255, 0.08);
    --text: #e8eaef;
    --text-muted: #9aa3b2;
    --accent: #c9a227;
    --accent-soft: rgba(201, 162, 39, 0.15);
    --success: #1ed760;
    --danger: #e85d5d;
    --radius: 12px;
    --font-display: "Outfit", system-ui, sans-serif;
    --font-body: "Source Sans 3", system-ui, sans-serif;
}

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

body.sistema-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 100% 60% at 50% -10%, rgba(201, 162, 39, 0.1), transparent);
}

.sistema-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(12, 14, 18, 0.9);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sistema-header nav {
    white-space: nowrap;
}

.sistema-header a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

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

.sistema-brand {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
}

.sistema-user {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.sistema-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.sistema-main--wide {
    max-width: 1080px;
}

#loading-state[hidden],
#main-content[hidden] {
    display: none !important;
}

.page-calendario .sistema-header {
    border-bottom-color: rgba(201, 162, 39, 0.15);
}

.page-hub .sistema-main h1 {
    background: linear-gradient(90deg, var(--text) 0%, rgba(201, 162, 39, 0.85) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-hub .tool-card h2 {
    color: var(--text);
}

.sistema-main h1 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: 0 0 0.5rem;
}

.sistema-lead {
    color: var(--text-muted);
    margin: 0 0 2rem;
    max-width: 52ch;
}

.sistema-section-title {
    font-family: var(--font-display, "Outfit", system-ui, sans-serif);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

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

.tool-card {
    display: block;
    padding: 1.35rem 1.4rem;
    background: linear-gradient(165deg, var(--surface) 0%, rgba(26, 32, 41, 0.6) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.tool-card:hover {
    border-color: rgba(201, 162, 39, 0.45);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.tool-card--soon {
    opacity: 0.55;
    pointer-events: none;
}

.tool-card h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0 0 0.35rem;
}

.tool-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.badge {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}

.badge--live {
    background: rgba(30, 215, 96, 0.15);
    color: var(--success);
}

.sistema-notice {
    margin-top: 2rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.sistema-notice strong {
    color: var(--text);
}

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin: 0 0 0.25rem;
}

.login-card .login-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.login-form input {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 8px);
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-sistema {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-display);
    color: #111;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
}

.btn-sistema:hover {
    filter: brightness(1.08);
}

.login-back {
    display: block;
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-error {
    margin-top: 1rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    color: var(--danger);
    background: rgba(232, 93, 93, 0.12);
    border-radius: var(--radius-sm, 8px);
    display: none;
}

.login-error.is-visible {
    display: block;
}

.sistema-loading-error {
    max-width: 32rem;
    margin: 1rem auto 0;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--danger);
    background: rgba(232, 93, 93, 0.12);
    border-radius: var(--radius-sm, 8px);
    text-align: center;
}

.sistema-loading-actions {
    text-align: center;
    margin-top: 1.25rem;
}

.sistema-loading-actions a {
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 600;
}

.sistema-loading-actions a:hover {
    text-decoration: underline;
}

.cal-placeholder {
    padding: 2rem;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
}

/* Mobile polish */
@media (max-width: 640px) {
    .sistema-header {
        flex-wrap: wrap;
        align-items: center;
        padding: 0.85rem 1rem;
        gap: 0.65rem;
    }

    .sistema-brand {
        flex: 1 1 auto;
        min-width: 10rem;
    }

    .sistema-user {
        order: 3;
        flex: 1 1 100%;
        text-align: left;
        padding: 0.35rem 0.75rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sistema-header nav {
        order: 2;
        margin-left: auto;
        font-size: 0.85rem;
    }

    .sistema-main {
        padding: 1.35rem 1rem 3rem;
    }

    .sistema-lead {
        margin-bottom: 1.35rem;
    }

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

    .tool-card {
        padding: 1.05rem 1.05rem;
    }

    .tool-card:hover {
        transform: none;
    }
}
