/* InstaWow — tema claro unico. Sem build step: CSS servido direto, para o
   sistema carregar rapido na hospedagem compartilhada. */

:root {
    --ink: #14101f;
    --ink-soft: #4a4459;
    --muted: #7c7690;
    --line: #e7e3f0;
    --bg: #faf8fd;
    --surface: #ffffff;

    --purple: #7c3aed;
    --purple-dark: #6025d1;
    --pink: #ec4899;
    --orange: #f97316;
    --green: #10b981;
    --red: #ef4444;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(20, 16, 31, .04), 0 12px 32px -12px rgba(20, 16, 31, .12);
    --shadow-lg: 0 2px 4px rgba(20, 16, 31, .04), 0 24px 56px -20px rgba(20, 16, 31, .2);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-family: "Space Grotesk", Manrope, sans-serif;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: 0;
}

a {
    color: var(--purple);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ── Layout de autenticacao ─────────────────────────────────────────────── */

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
}

/* A logomarca e sempre a imagem oficial, nunca um substituto em texto, e vive
   sobre fundo branco para preservar o contraste do desenho. */
.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 26px;
}

.auth-brand img {
    width: auto;
    height: 34px;
    display: block;
}

.app-brand {
    display: inline-flex;
    align-items: center;
}

.app-brand img {
    width: auto;
    height: 30px;
    display: block;
}

.auth-title {
    font-size: 22px;
    margin-bottom: 6px;
}

.auth-lead {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 24px;
}

.auth-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--muted);
    text-align: center;
}

/* ── Formularios ────────────────────────────────────────────────────────── */

.field {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.input {
    width: 100%;
    padding: 11px 13px;
    font: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}

.input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

.input[aria-invalid="true"] {
    border-color: var(--red);
}

.field-error {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--red);
}

.field-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--ink-soft);
    cursor: pointer;
    user-select: none;
}

.checkbox input {
    width: 15px;
    height: 15px;
    accent-color: var(--purple);
    margin: 0;
}

/* ── Botoes ─────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    font: inherit;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform .12s, box-shadow .15s, background .15s;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
    color: #fff;
    box-shadow: 0 8px 20px -8px rgba(124, 58, 237, .55);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--purple-dark), #5019b8);
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink-soft);
}

.btn-ghost:hover {
    border-color: var(--purple);
    color: var(--purple);
    text-decoration: none;
}

/* ── Avisos ─────────────────────────────────────────────────────────────── */

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, .08);
    border-color: rgba(16, 185, 129, .28);
    color: #067a55;
}

.alert-error {
    background: rgba(239, 68, 68, .07);
    border-color: rgba(239, 68, 68, .26);
    color: #b91c1c;
}

.alert-info {
    background: rgba(124, 58, 237, .06);
    border-color: rgba(124, 58, 237, .22);
    color: var(--purple-dark);
}

/* ── Area interna: sidebar fixa e conteudo ──────────────────────────────── */

:root {
    --sidebar-w: 248px;
}

.iw-layout {
    min-height: 100vh;
    display: flex;
}

.iw-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.iw-sidebar-brand {
    padding: 18px 18px 14px;
    display: block;
}

.iw-sidebar-brand img {
    width: auto;
    height: 28px;
    display: block;
}

.iw-nav {
    padding: 4px 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.iw-nav-group {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 16px 10px 6px;
}

.iw-nav-group-admin {
    color: var(--orange);
    border-top: 1px solid var(--line);
    margin-top: 8px;
}

.iw-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 500;
    transition: background .14s, color .14s;
}

.iw-nav-link:hover {
    background: rgba(124, 58, 237, .06);
    color: var(--purple-dark);
    text-decoration: none;
}

.iw-nav-link.active {
    background: rgba(124, 58, 237, .1);
    color: var(--purple-dark);
    font-weight: 600;
}

.iw-nav-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.iw-nav-link span {
    flex: 1;
    min-width: 0;
}

.iw-nav-link.locked {
    color: var(--muted);
}

.iw-nav-link.locked:hover {
    background: rgba(20, 16, 31, .04);
    color: var(--ink-soft);
}

.iw-lock {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: .65;
}

.iw-sidebar-foot {
    padding: 14px 18px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.iw-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.iw-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 11px 16px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.iw-topbar-logo {
    width: auto;
    height: 24px;
}

.iw-sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
    font-size: 13px;
    color: var(--ink-soft);
}

.iw-logout {
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
}

.iw-logout:hover {
    color: var(--red);
}

.iw-menu-toggle {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 6px;
    cursor: pointer;
    color: var(--ink-soft);
    display: grid;
    place-items: center;
}

.iw-menu-toggle svg {
    width: 19px;
    height: 19px;
}

.iw-content {
    padding: 26px 26px 48px;
    max-width: 1180px;
    width: 100%;
}

/* No desktop a sidebar basta; a topbar existe apenas no mobile. */
@media (max-width: 999px) {
    .iw-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: var(--shadow-lg);
    }

    .iw-sidebar.open {
        transform: translateX(0);
    }

    .iw-topbar {
        display: flex;
    }

    .iw-content {
        padding: 18px 16px 40px;
    }
}

/* ── Componentes de conteudo ────────────────────────────────────────────── */

.page-head {
    margin-bottom: 22px;
}

.page-title {
    font-size: 23px;
    margin-bottom: 5px;
}

.page-sub {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.kpi-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
}

.kpi-value {
    font-family: "Space Grotesk", sans-serif;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.02em;
    margin-top: 5px;
}

.kpi-hint {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 3px;
}

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.data th,
table.data td {
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

table.data th {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--bg);
}

table.data tbody tr:last-child td {
    border-bottom: 0;
}

table.data tbody tr:hover {
    background: rgba(124, 58, 237, .03);
}

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: rgba(20, 16, 31, .06);
    color: var(--ink-soft);
}

.badge-green {
    background: rgba(16, 185, 129, .12);
    color: #067a55;
}

.badge-red {
    background: rgba(239, 68, 68, .1);
    color: #b91c1c;
}

.badge-orange {
    background: rgba(249, 115, 22, .12);
    color: #c2410c;
}

.badge-purple {
    background: rgba(124, 58, 237, .1);
    color: var(--purple-dark);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.section-sep {
    margin: 26px 0 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.btn-danger {
    background: transparent;
    border-color: rgba(239, 68, 68, .4);
    color: var(--red);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, .06);
    text-decoration: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.locked-panel {
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 40px 28px;
    text-align: center;
}

.locked-panel svg {
    width: 34px;
    height: 34px;
    color: var(--muted);
}

.locked-panel h2 {
    font-size: 19px;
    margin: 12px 0 6px;
}

.locked-panel p {
    color: var(--muted);
    margin: 0 auto 18px;
    max-width: 46ch;
    font-size: 14px;
}

.toggle-list {
    display: grid;
    gap: 7px;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
}

.toggle-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--purple);
    margin: 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.plan-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(124, 58, 237, .08);
    color: var(--purple-dark);
    font-size: 12.5px;
    font-weight: 600;
}

.muted {
    color: var(--muted);
}
