/* ==========================================================================
   iLoveXML — sistema visual das áreas logadas (conta, admin, auth, planos).
   Tema escuro coeso com a landing (Home.razor). Construído sobre o Bootstrap,
   mas com identidade própria: superfícies em camadas, verde da marca como
   única cor de ação, tipografia com peso.
   ========================================================================== */

:root {
    --ix-verde: #8cc63f;
    --ix-verde-hover: #7ab033;
    --ix-verde-fade: rgba(140, 198, 63, .12);
    --ix-azul: #29abe2;
    --ix-vermelho: #f85149;
    --ix-amarelo: #fbbf24;
    --ix-roxo: #a371f7;
    --ix-fundo: #0d1117;
    --ix-fundo-2: #0a0e14;
    --ix-card-bg: #161b22;
    --ix-card-bg-2: #1c2230;
    --ix-borda: #30363d;
    --ix-borda-suave: #21262d;
    --ix-texto: #e6edf3;
    --ix-texto-2: #c9d1d9;
    --ix-sub: #8b949e;
    --ix-sombra: 0 8px 24px rgba(0, 0, 0, 0.4);
    --ix-sombra-forte: 0 24px 60px rgba(0, 0, 0, 0.55);
    --ix-radius: 14px;
}

/* ---- Reset suave para as áreas ix ------------------------------------- */
.ix-page * { box-sizing: border-box; }

.ix-page {
    min-height: 100vh;
    color: var(--ix-texto-2);
    background:
        radial-gradient(1100px 500px at 50% -10%, rgba(140, 198, 63, 0.08), transparent 60%),
        radial-gradient(900px 600px at 100% 0%, rgba(41, 171, 226, 0.05), transparent 55%),
        var(--ix-fundo);
    padding: 2.5rem 1rem 4rem;
    font-feature-settings: "tnum" 1;
}

/* ---- Superfícies ------------------------------------------------------- */
.ix-card {
    background: var(--ix-card-bg);
    border: 1px solid var(--ix-borda-suave);
    border-radius: var(--ix-radius);
    box-shadow: var(--ix-sombra);
}
.ix-card-lg { border-radius: 20px; box-shadow: var(--ix-sombra-forte); }
.ix-card-hover { transition: border-color .18s, transform .18s; }
.ix-card-hover:hover { border-color: rgba(140,198,63,.35); transform: translateY(-2px); }

/* ---- Marca ------------------------------------------------------------- */
.ix-brand { font-weight: 800; letter-spacing: -0.5px; color: var(--ix-texto); }
.ix-brand span { color: var(--ix-verde); }
.ix-logo-img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(140,198,63,.25)); }

/* ---- Tipografia -------------------------------------------------------- */
.ix-title { font-weight: 800; letter-spacing: -0.6px; color: var(--ix-texto); }
.ix-subtitle { color: var(--ix-sub); }
.ix-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ix-verde); }

/* ---- Inputs ------------------------------------------------------------ */
.ix-input {
    border: 1.5px solid var(--ix-borda);
    border-radius: 11px;
    padding: 0.68rem 0.9rem;
    width: 100%;
    background: var(--ix-fundo-2);
    color: var(--ix-texto);
    transition: border-color .15s, box-shadow .15s;
}
.ix-input::placeholder { color: #586473; }
.ix-input:focus {
    outline: none;
    border-color: var(--ix-verde);
    box-shadow: 0 0 0 4px var(--ix-verde-fade);
}
.ix-label { font-size: .82rem; font-weight: 600; color: var(--ix-sub); margin-bottom: .35rem; display: block; }

/* ---- Botões ------------------------------------------------------------ */
.ix-btn {
    border: none; border-radius: 11px; padding: 0.7rem 1.1rem;
    font-weight: 700; cursor: pointer; width: 100%;
    transition: transform .05s, filter .15s, box-shadow .15s, background .15s, border-color .15s;
    font-size: .92rem;
}
.ix-btn:active { transform: translateY(1px); }
.ix-btn-primary {
    background: linear-gradient(180deg, var(--ix-verde), var(--ix-verde-hover));
    color: #0d1117; box-shadow: 0 8px 20px rgba(140,198,63,.22);
}
.ix-btn-primary:hover { filter: brightness(1.08); }
.ix-btn-primary:disabled { filter: grayscale(.4) opacity(.55); cursor: not-allowed; }
.ix-btn-ghost { background: transparent; border: 1.5px solid var(--ix-borda); color: var(--ix-texto-2); }
.ix-btn-ghost:hover { border-color: var(--ix-verde); color: var(--ix-verde); background: var(--ix-verde-fade); }
.ix-btn-azul { background: var(--ix-azul); color: #07121a; }
.ix-btn-azul:hover { filter: brightness(1.08); }
.ix-btn-danger { background: transparent; border: 1.5px solid rgba(248,81,73,.5); color: #ff8a82; }
.ix-btn-danger:hover { background: rgba(248,81,73,.12); border-color: var(--ix-vermelho); }
.ix-btn-sm { padding: .42rem .8rem; font-size: .8rem; width: auto; }

/* Select compacto pra filtros em linha (ex: empresa/tipo na grade de notas) — mesma cara do .ix-input, só mais estreito e sem ocupar a linha toda. */
.ix-select-sm { width: auto; padding: .42rem .8rem; font-size: .82rem; }

/* ---- Link -------------------------------------------------------------- */
.ix-link { color: var(--ix-azul); font-weight: 600; text-decoration: none; }
.ix-link:hover { text-decoration: underline; color: #4dc0f0; }

/* ---- Alertas ----------------------------------------------------------- */
.ix-alert { border-radius: 11px; padding: .75rem 1rem; font-size: .88rem; border: 1px solid transparent; }
.ix-alert-erro { background: rgba(248,81,73,.1); color: #ff8a82; border-color: rgba(248,81,73,.3); }
.ix-alert-ok { background: rgba(140,198,63,.1); color: #a8e063; border-color: rgba(140,198,63,.3); }
.ix-alert-info { background: rgba(41,171,226,.1); color: #6cc6ee; border-color: rgba(41,171,226,.3); }
.ix-alert-aviso { background: rgba(251,191,36,.1); color: #fbbf24; border-color: rgba(251,191,36,.3); }

/* ---- Planos ------------------------------------------------------------ */
.ix-plano {
    background: var(--ix-card-bg); border: 1.5px solid var(--ix-borda-suave);
    border-radius: 18px; padding: 2rem 1.5rem; height: 100%; position: relative;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.ix-plano:hover { transform: translateY(-4px); box-shadow: var(--ix-sombra-forte); border-color: rgba(140,198,63,.4); }
.ix-plano-destaque { border-color: var(--ix-verde); box-shadow: 0 0 0 1px rgba(140,198,63,.3), var(--ix-sombra); }
.ix-plano-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--ix-verde); color: #0d1117; font-size: .72rem; font-weight: 700;
    padding: .25rem .8rem; border-radius: 999px; letter-spacing: .3px; white-space: nowrap;
}
.ix-preco { font-size: 2.4rem; font-weight: 800; color: var(--ix-texto); letter-spacing: -1px; }
.ix-preco small { font-size: .9rem; color: var(--ix-sub); font-weight: 600; }
.ix-feat { list-style: none; padding: 0; margin: 1.2rem 0; text-align: left; }
.ix-feat li { padding: .35rem 0; color: var(--ix-texto-2); display: flex; gap: .5rem; align-items: center; font-size: .92rem; }
/* O ✓ vem do HTML (<span class="ico">), não daqui — ter os dois fazia
   aparecer "✓ ✓" duplicado em cada item da lista de planos. */
.ix-feat li > .ico { color: var(--ix-verde); font-weight: 800; }

/* ---- Métricas (cartões de número) -------------------------------------- */
.ix-metric {
    background: var(--ix-card-bg); border: 1px solid var(--ix-borda-suave);
    border-radius: var(--ix-radius); padding: 1.2rem 1.35rem; box-shadow: var(--ix-sombra);
    position: relative; overflow: hidden;
}
.ix-metric::after {
    content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
    background: var(--ix-sub); opacity: .5;
}
.ix-metric.green::after { background: var(--ix-verde); opacity: 1; }
.ix-metric.blue::after { background: var(--ix-azul); opacity: 1; }
.ix-metric.red::after { background: var(--ix-vermelho); opacity: 1; }
.ix-metric.purple::after { background: var(--ix-roxo); opacity: 1; }
.ix-metric.amber::after { background: var(--ix-amarelo); opacity: 1; }
.ix-metric .v { font-size: 1.85rem; font-weight: 800; color: var(--ix-texto); letter-spacing: -.5px; line-height: 1.1; }
.ix-metric .l { font-size: .76rem; color: var(--ix-sub); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-top: .25rem; }
.ix-metric .sub { font-size: .78rem; color: var(--ix-sub); margin-top: .4rem; }
.ix-metric.green .v { color: #a8e063; }
.ix-metric.blue .v { color: #6cc6ee; }
.ix-metric.red .v { color: #ff8a82; }
.ix-metric.purple .v { color: #c9a8ff; }

/* ---- Tabela ------------------------------------------------------------ */
.ix-table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--ix-texto-2); }
.ix-table th {
    text-align: left; font-size: .73rem; text-transform: uppercase; letter-spacing: .5px;
    color: var(--ix-sub); padding: .7rem .8rem; border-bottom: 1px solid var(--ix-borda);
    font-weight: 700; position: sticky; top: 0; background: var(--ix-card-bg);
}
.ix-table td { padding: .8rem; border-bottom: 1px solid var(--ix-borda-suave); font-size: .88rem; vertical-align: middle; }
.ix-table tbody tr { transition: background .12s; }
.ix-table tbody tr:hover td { background: rgba(255,255,255,.025); }
.ix-table tbody tr:last-child td { border-bottom: none; }

/* ---- Chips / badges ---------------------------------------------------- */
.ix-chip { display: inline-block; padding: .22rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.ix-chip-ok { background: rgba(140,198,63,.15); color: #a8e063; }
.ix-chip-aviso { background: rgba(251,191,36,.15); color: #fbbf24; }
.ix-chip-erro { background: rgba(248,81,73,.15); color: #ff8a82; }
.ix-chip-info { background: rgba(41,171,226,.15); color: #6cc6ee; }
.ix-chip-neutro { background: rgba(139,148,161,.15); color: var(--ix-sub); }

/* ---- Gráfico de barras (dinâmico, sem libs) ---------------------------- */
.ix-bars { display: flex; align-items: flex-end; gap: 5px; height: 160px; padding-top: 8px; }
.ix-bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.ix-bar {
    width: 100%; background: linear-gradient(180deg, var(--ix-verde), var(--ix-verde-hover));
    border-radius: 5px 5px 0 0; min-height: 2px;
    transition: height .5s cubic-bezier(.22,1,.36,1), filter .12s;
}
.ix-bar-wrap:hover .ix-bar { filter: brightness(1.2); }
.ix-bar-wrap:hover .ix-bar-tip { opacity: 1; transform: translateY(0); }
.ix-bar-tip {
    position: absolute; top: -34px; left: 50%; transform: translate(-50%, 4px);
    background: var(--ix-card-bg-2); border: 1px solid var(--ix-borda); color: var(--ix-texto);
    font-size: .72rem; font-weight: 700; padding: .25rem .5rem; border-radius: 7px;
    white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 5;
}

/* ---- Segmento (toggle) ------------------------------------------------- */
.ix-seg { display: inline-flex; background: var(--ix-fundo-2); border: 1px solid var(--ix-borda); border-radius: 999px; padding: 3px; }
.ix-seg button { border: none; background: transparent; padding: .38rem .95rem; border-radius: 999px; font-weight: 700; color: var(--ix-sub); cursor: pointer; font-size: .82rem; transition: all .15s; }
.ix-seg button.on { background: var(--ix-verde); color: #0d1117; box-shadow: 0 2px 8px rgba(140,198,63,.3); }
.ix-seg.w-100 button { flex: 1; }

/* ---- Admin: shell com sidebar ------------------------------------------ */
.ix-admin { display: grid; grid-template-columns: 240px 1fr; gap: 0; min-height: 100vh; }
.ix-admin-side {
    background: var(--ix-fundo-2); border-right: 1px solid var(--ix-borda-suave);
    padding: 1.5rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.ix-admin-main { padding: 2rem 2.2rem 4rem; min-width: 0; }
.ix-nav-item {
    display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
    padding: .65rem .8rem; border-radius: 10px; border: none; background: transparent;
    color: var(--ix-sub); font-weight: 600; font-size: .9rem; cursor: pointer; margin-bottom: .2rem;
    transition: background .14s, color .14s;
}
.ix-nav-item:hover { background: rgba(255,255,255,.03); color: var(--ix-texto-2); }
.ix-nav-item.on { background: var(--ix-verde-fade); color: var(--ix-verde); }
.ix-nav-item .ico { width: 18px; height: 18px; flex-shrink: 0; }

@media (max-width: 860px) {
    .ix-admin { grid-template-columns: 1fr; }
    .ix-admin-side { position: static; height: auto; display: flex; gap: .3rem; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--ix-borda-suave); }
    .ix-admin-side .ix-nav-item { white-space: nowrap; margin-bottom: 0; }
    .ix-admin-side .ix-side-title { display: none; }
    .ix-admin-main { padding: 1.5rem 1rem 3rem; }
}

/* ---- Selects/date no tema escuro --------------------------------------- */
select.ix-input { color-scheme: dark; }
input[type="date"].ix-input { color-scheme: dark; }
select.ix-input option { background: var(--ix-card-bg); color: var(--ix-texto); }

/* ---- Drawer (edição de cliente no admin) ------------------------------- */
.ix-drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; backdrop-filter: blur(2px); }
.ix-drawer {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(440px, 100%); z-index: 51;
    background: var(--ix-card-bg); border-left: 1px solid var(--ix-borda); box-shadow: -20px 0 60px rgba(0,0,0,.5);
    padding: 1.6rem; overflow-y: auto; animation: ix-slide .22s cubic-bezier(.22,1,.36,1);
}
@keyframes ix-slide { from { transform: translateX(30px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }

/* ---- Linha de detalhe (key/value) -------------------------------------- */
.ix-kv { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--ix-borda-suave); }
.ix-kv:last-child { border-bottom: none; }
.ix-kv .k { color: var(--ix-sub); font-size: .85rem; }
.ix-kv .val { color: var(--ix-texto); font-weight: 700; font-size: .9rem; }

/* ---- Avatar (inicial do cliente) --------------------------------------- */
.ix-avatar {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 800; font-size: .85rem;
    background: linear-gradient(135deg, var(--ix-verde-fade), rgba(41,171,226,.12));
    color: var(--ix-verde); border: 1px solid var(--ix-borda-suave);
}

/* ---- Estado vazio ------------------------------------------------------ */
.ix-empty { text-align: center; padding: 2.5rem 1rem; color: var(--ix-sub); }
.ix-empty .ic { font-size: 2rem; opacity: .5; margin-bottom: .5rem; }

@media (prefers-reduced-motion: reduce) {
    .ix-bar, .ix-drawer { animation: none !important; transition: none !important; }
}
