@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --brand-primary: #18C6D8;
    --brand-secondary: #3ED4E6;
    --brand-tertiary: #082E52;
    --brand-navy-deep: #0B2340;
    --bg: #F7FAFC;
    --surface: #ffffff;
    --border: #DCE8EF;
    --text: #082E52;
    --text-muted: #607086;
    --danger: #c0392b;
    --success: #1e8e5a;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 12px rgba(8, 46, 82, 0.08);
    --shadow-brand: 0 8px 25px rgba(24, 198, 216, 0.30);
    --gradient-brand: linear-gradient(135deg, #18C6D8, #3ED4E6);
    --gradient-navy: linear-gradient(180deg, #082E52, #0B2340);

    /* Official Avant design tokens (reference: complianceavant.com/clube) */
    --primary: #18C6D8;
    --primary-dark: #1099AF;
    --primary-light: #6DE2F0;
    --secondary: #082E52;
    --secondary-light: #124A73;
    --accent: #3ED4E6;
    --background: #F7FAFC;
    --surface-alt: #EEF7FA;
    --foreground: #0B2340;
    --muted-foreground: #607086;
    --text-light: #FFFFFF;
    --card: #FFFFFF;
    --card-shadow: 0 4px 20px rgba(8, 46, 82, 0.06);
    --glow: rgba(24, 198, 216, 0.18);
    --glow-strong: rgba(24, 198, 216, 0.30);
    --gradient-primary: linear-gradient(135deg, #18C6D8, #3ED4E6);
    --gradient-secondary: linear-gradient(135deg, #082E52, #124A73);
    --gradient-hero: linear-gradient(135deg, #082E52 0%, #18C6D8 100%);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--brand-primary); }

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    background: var(--gradient-navy);
    color: #fff;
    padding: 24px 16px;
    flex-shrink: 0;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    text-decoration: none;
    background: #fff;
    border-radius: var(--radius);
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar .brand img { display: block; width: 100%; height: auto; max-height: 52px; object-fit: contain; }

.sidebar .brand-fallback {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--brand-tertiary);
    letter-spacing: 0.01em;
}

.sidebar nav a {
    display: block;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 4px;
    font-size: 0.92rem;
    font-weight: 500;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(24, 198, 216, 0.18);
    color: #fff;
}

.sidebar nav a.active { box-shadow: inset 3px 0 0 var(--brand-primary); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 700; }

.content { padding: 28px; flex: 1; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow); }
.kpi-card .label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.kpi-card .value { font-size: 1.6rem; font-weight: 800; color: var(--brand-tertiary); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: var(--bg); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-ativo { background: rgba(30, 142, 90, 0.12); color: var(--success); }
.badge-suspenso { background: rgba(230, 162, 60, 0.15); color: #b7791f; }
.badge-inativo { background: rgba(192, 57, 43, 0.12); color: var(--danger); }
.badge-plan { background: rgba(24, 198, 216, 0.12); color: #0f8ea0; }

.btn {
    display: inline-block;
    background: var(--gradient-brand);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-brand);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(24, 198, 216, 0.4); }
.btn-secondary { background: transparent; color: var(--brand-tertiary); border: 1px solid var(--border); box-shadow: none; font-weight: 600; }
.btn-secondary:hover { background: var(--bg); transform: none; box-shadow: none; }

form .field { margin-bottom: 16px; }
form label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
form input, form select, form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--text);
}
form input:focus, form select:focus, form textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(24, 198, 216, 0.15);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.9rem; }
.alert-success { background: rgba(30, 142, 90, 0.1); color: var(--success); }
.alert-error { background: rgba(192, 57, 43, 0.1); color: var(--danger); }

.login-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--background);
    overflow: hidden;
}
.login-particles { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.login-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}
.login-glow.one { width: 460px; height: 460px; background: var(--gradient-primary); top: -160px; left: -140px; opacity: 0.28; }
.login-glow.two { width: 420px; height: 420px; background: var(--gradient-secondary); bottom: -160px; right: -120px; opacity: 0.16; }

.login-card {
    position: relative;
    z-index: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--card-shadow), 0 12px 40px rgba(8, 46, 82, 0.10);
}
.login-card .login-logo { display: block; max-width: 200px; margin: 0 auto 24px; }
.login-card h1 { font-size: 1.3rem; margin: 0 0 6px; text-align: center; font-weight: 800; color: var(--secondary); }
.login-card p.subtitle { color: var(--muted-foreground); font-size: 0.88rem; margin: 0 0 24px; text-align: center; }
.login-footer { position: absolute; z-index: 1; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 0.78rem; color: var(--text-muted); }

.help-text { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.text-muted { color: var(--text-muted); }
