:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #0f172a;
    --accent: #14b8a6;

    --background: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --text: #172033;
    --muted: #64748b;
    --border: #e2e8f0;

    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;

    --sidebar: #0f172a;
    --sidebar-text: #f8fafc;

    --shadow:
        0 12px 32px rgba(15, 23, 42, .07);

    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);
    background: var(--background);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.eyebrow {
    margin-bottom: 7px;
    color: var(--primary);
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .11em;
}

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

.brand-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: var(--primary);
    color: white;
    font-size: 23px;
    font-weight: 900;
    box-shadow:
        0 15px 35px rgba(37, 99, 235, .27);
}

.brand-mark.small {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 16px;
}

/* LOGIN */

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(
            135deg,
            #eef4ff 0%,
            #f8fafc 55%,
            #ecfeff 100%
        );
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns:
        minmax(420px, 1.25fr)
        minmax(380px, .75fr);
}

.login-brand {
    padding: 70px clamp(48px, 7vw, 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    background:
        radial-gradient(
            circle at 10% 15%,
            rgba(59,130,246,.42),
            transparent 35%
        ),
        linear-gradient(
            145deg,
            #0f172a 0%,
            #111f42 58%,
            #123e5d 100%
        );
}

.login-brand h1 {
    margin: 24px 0 14px;
    font-size: clamp(46px, 6vw, 78px);
    line-height: .98;
    letter-spacing: -.045em;
}

.login-brand .eyebrow {
    margin-top: 40px;
    color: #93c5fd;
}

.brand-copy {
    max-width: 620px;
    margin-bottom: 40px;
    color: #cbd5e1;
    font-size: 19px;
    line-height: 1.6;
}

.brand-features {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 16px;
    max-width: 760px;
}

.brand-features > div {
    padding: 18px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    background: rgba(255,255,255,.05);
}

.brand-features strong,
.brand-features span {
    display: block;
}

.brand-features strong {
    margin-bottom: 5px;
}

.brand-features span {
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.45;
}

.login-card {
    width: min(450px, calc(100% - 48px));
    margin: auto;
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-card h2 {
    margin-bottom: 8px;
    font-size: 32px;
}

.login-mobile-brand {
    display: none;
    gap: 12px;
    align-items: center;
    margin-bottom: 28px;
}

.login-card label {
    display: block;
    margin: 18px 0 7px;
    font-size: 13px;
    font-weight: 700;
}

.login-card input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: var(--text);
    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.login-card input:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(37,99,235,.10);
}

.button {
    border: 0;
    border-radius: 11px;
    padding: 11px 16px;
    font-weight: 750;
}

.button-primary {
    background: var(--primary);
    color: white;
}

.button-primary:hover {
    background: var(--primary-hover);
}

.button-full {
    width: 100%;
    min-height: 48px;
    margin-top: 24px;
}

.button-light {
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
}

.alert {
    margin: 20px 0;
    padding: 13px 15px;
    border-radius: 11px;
    font-size: 14px;
}

.alert-danger {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.login-footer {
    margin: 28px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

/* APP */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    color: var(--sidebar-text);
    background: var(--sidebar);
}

.sidebar-brand {
    min-height: 82px;
    padding: 18px 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom:
        1px solid rgba(255,255,255,.08);
}

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand span {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 12px;
}

.sidebar-nav {
    flex: 1;
    padding: 18px 12px;
    overflow: auto;
}

.nav-section {
    padding: 20px 12px 8px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .10em;
}

.nav-item {
    min-height: 44px;
    margin: 4px 0;
    padding: 0 12px;
    display: flex;
    gap: 11px;
    align-items: center;
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 650;
}

.nav-item.active {
    background: rgba(37,99,235,.22);
    color: white;
}

.nav-item.disabled {
    opacity: .48;
    cursor: default;
}

.nav-icon {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 18px 20px 22px;
    border-top:
        1px solid rgba(255,255,255,.08);
}

.sidebar-footer span,
.sidebar-footer small {
    display: block;
}

.sidebar-footer small {
    margin-top: 3px;
    color: #94a3b8;
}

.main-area {
    grid-column: 2;
    min-width: 0;
}

.topbar {
    min-height: 72px;
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.92);
}

.topbar-company {
    font-weight: 800;
}

.topbar-user {
    display: flex;
    gap: 11px;
    align-items: center;
}

.user-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 900;
}

.user-copy strong,
.user-copy span {
    display: block;
}

.user-copy strong {
    font-size: 13px;
}

.user-copy span {
    color: var(--muted);
    font-size: 11px;
}

.mobile-menu-button {
    display: none;
    border: 0;
    background: transparent;
    font-size: 24px;
}

.content {
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: 30px;
}

.page-heading {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.page-heading h1 {
    margin-bottom: 6px;
    font-size: 30px;
    letter-spacing: -.025em;
}

.status-badge {
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

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

.stats-grid {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card,
.panel {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow:
        0 4px 18px rgba(15,23,42,.035);
}

.stat-card {
    min-height: 148px;
    padding: 21px;
    border-radius: var(--radius);
}

.stat-label {
    display: block;
    margin-bottom: 15px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}

.stat-value {
    display: block;
    margin-bottom: 10px;
    font-size: 32px;
    line-height: 1.1;
}

.stat-value.stat-text {
    font-size: 20px;
}

.stat-meta {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-grid {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(360px, .8fr);
    gap: 20px;
}

.panel {
    padding: 24px;
    border-radius: var(--radius);
}

.panel-heading {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
}

.panel-heading h2 {
    margin-bottom: 0;
    font-size: 20px;
}

.check-list {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.check-item {
    padding: 15px;
    display: flex;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.check {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #dcfce7;
    color: #166534;
    font-weight: 900;
}

.check-item p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.next-step {
    padding: 17px 0;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
}

.next-step:last-child {
    border-bottom: 0;
}

.step-number {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 900;
}

.next-step p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.muted-step {
    opacity: .75;
}

.architecture-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 11px;
}

.architecture-flow span {
    padding: 11px 15px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e40af;
    font-weight: 750;
}

.architecture-flow b {
    color: #94a3b8;
}

.sidebar-overlay {
    display: none;
}

/* TABLET */

@media (max-width: 1050px) {
    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

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

    .brand-features {
        grid-template-columns: 1fr;
    }
}

/* MOBILE */

@media (max-width: 760px) {
    .login-shell {
        display: block;
        padding: 24px 0;
    }

    .login-brand {
        display: none;
    }

    .login-card {
        width: min(94%, 460px);
        padding: 26px 22px;
    }

    .login-mobile-brand {
        display: flex;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        width: min(290px, 85vw);
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(15,23,42,.48);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    .main-area {
        min-width: 0;
    }

    .topbar {
        min-height: 64px;
        padding: 0 14px;
    }

    .mobile-menu-button {
        display: block;
    }

    .topbar-company,
    .user-copy {
        display: none;
    }

    .content {
        padding: 20px 14px 28px;
    }

    .page-heading {
        display: block;
    }

    .status-badge {
        display: inline-block;
        margin-top: 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        min-height: 128px;
        padding: 16px;
    }

    .stat-value {
        font-size: 25px;
    }

    .stat-value.stat-text {
        font-size: 16px;
    }

    .panel {
        padding: 18px;
    }

    .check-list {
        grid-template-columns: 1fr;
    }

    .architecture-flow {
        gap: 7px;
    }

    .architecture-flow span {
        width: 100%;
        text-align: center;
    }

    .architecture-flow b {
        width: 100%;
        text-align: center;
        transform: rotate(90deg);
    }
}

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

    .topbar-user .button {
        padding-left: 11px;
        padding-right: 11px;
    }
}

/* ============================================================
   FASE 2 - IDENTIDADE VISUAL
   ============================================================ */

.login-company-logo {
    width: min(190px, 70%);
    max-height: 100px;
    object-fit: contain;
    object-position: left center;
    margin-bottom: 25px;
}

.login-mobile-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
}

