/* ════════════════════════════════════════════════════════
   PilatesFlow — Design System
   Estética: premium, feminina, elegante, minimalista.
   ════════════════════════════════════════════════════════ */

:root {
    /* Paleta */
    --rose-50:  #fdf6f7;
    --rose-100: #f9e8eb;
    --rose-200: #f1cdd4;
    --rose-300: #e3a6b3;
    --rose-400: #d17f92;
    --rose-500: #be5d75;   /* primária */
    --rose-600: #a4495f;
    --rose-700: #84394c;

    --plum-700: #4a2c3a;
    --plum-800: #33202a;   /* texto forte */
    --plum-900: #241620;

    --sage-300: #b7cdbf;
    --sage-500: #7fa890;   /* sucesso/saudável */
    --sage-600: #5f8a72;

    --gold-400: #d9a86c;   /* atenção */
    --danger:   #d96c6c;   /* risco */

    --bg:       #faf7f8;
    --surface:  #ffffff;
    --border:   #efe6e9;
    --muted:    #9a8b91;
    --text:     #33202a;

    --radius:   16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(74,44,58,.06), 0 1px 3px rgba(74,44,58,.04);
    --shadow:    0 4px 16px rgba(74,44,58,.08);
    --shadow-lg: 0 12px 40px rgba(74,44,58,.12);

    --sidebar-w: 256px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--rose-600); text-decoration: none; }
a:hover { color: var(--rose-700); }

/* ───── Layout shell ───── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--plum-800), var(--plum-900));
    color: #fff;
    padding: 24px 16px;
    position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column;
    z-index: 40;
}
.sidebar .brand {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 12px 24px;
    font-weight: 700; font-size: 18px; letter-spacing: -.02em;
}
.sidebar .brand .logo {
    width: 36px; height: 36px; border-radius: 11px;
    background: linear-gradient(135deg, var(--rose-400), var(--rose-600));
    display: grid; place-items: center; font-size: 18px;
    box-shadow: 0 4px 14px rgba(190,93,117,.4);
}
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: rgba(255,255,255,.4); margin: 18px 12px 8px; font-weight: 600; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,.78); font-weight: 500;
    transition: all .15s ease; margin-bottom: 2px;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active {
    background: linear-gradient(135deg, var(--rose-500), var(--rose-600));
    color: #fff; box-shadow: 0 4px 14px rgba(190,93,117,.35);
}
.nav-link .ico { width: 20px; text-align: center; opacity: .9; }

.sidebar .user-card {
    margin-top: auto; padding: 12px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px;
}
.avatar {
    width: 36px; height: 36px; border-radius: 50%; flex: 0 0 36px;
    background: linear-gradient(135deg, var(--sage-300), var(--sage-500));
    display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px;
}

/* ───── Conteúdo ───── */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
    height: 68px; background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.content { padding: 28px; max-width: 1320px; width: 100%; }

/* ───── Cards ───── */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; }

/* ───── KPIs ───── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 18px; }
.kpi {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.kpi .ico-badge {
    width: 40px; height: 40px; border-radius: 12px; float: right;
    display: grid; place-items: center; font-size: 18px;
    background: var(--rose-100); color: var(--rose-600);
}
.kpi.sage .ico-badge { background: #e7f0ea; color: var(--sage-600); }
.kpi.gold .ico-badge { background: #faf0e2; color: var(--gold-400); }
.kpi.danger .ico-badge { background: #fbe9e9; color: var(--danger); }
.kpi .trend { font-size: 12px; font-weight: 600; margin-top: 8px; }
.trend.up { color: var(--sage-600); } .trend.down { color: var(--danger); }

/* ───── Tabela ───── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
    text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border);
}
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--rose-50); }

/* ───── Badges ───── */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge.healthy   { background: #e7f0ea; color: var(--sage-600); }
.badge.attention { background: #faf0e2; color: #b07d3c; }
.badge.risk      { background: #fbe9e9; color: var(--danger); }
.badge.paid      { background: #e7f0ea; color: var(--sage-600); }
.badge.open      { background: var(--rose-100); color: var(--rose-600); }
.badge.overdue   { background: #fbe9e9; color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.healthy { background: var(--sage-500); }
.dot.attention { background: var(--gold-400); }
.dot.risk { background: var(--danger); }

/* ───── Botões ───── */
.btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
    border: 1px solid transparent; transition: all .15s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--rose-500), var(--rose-600)); color: #fff;
    box-shadow: 0 4px 14px rgba(190,93,117,.3); }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); color:#fff; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--rose-50); }

/* ───── Alertas ───── */
.alert {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    border-radius: var(--radius-sm); margin-bottom: 10px; font-weight: 500; font-size: 13.5px;
    border: 1px solid transparent;
}
.alert.info    { background: var(--rose-50); border-color: var(--rose-100); color: var(--rose-700); }
.alert.warning { background: #faf0e2; border-color: #f0dcc0; color: #8a6326; }
.alert.danger  { background: #fbe9e9; border-color: #f3d2d2; color: #a64545; }

/* ───── Health bar ───── */
.health-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; width: 90px; }
.health-bar > span { display: block; height: 100%; border-radius: 999px; }

/* ───── Login ───── */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art {
    background: linear-gradient(150deg, var(--plum-800), var(--rose-700));
    color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 64px;
    position: relative; overflow: hidden;
}
.auth-art::after {
    content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%);
    bottom: -120px; right: -120px;
}
.auth-art h2 { font-size: 34px; line-height: 1.2; letter-spacing: -.03em; margin: 0 0 16px; }
.auth-art p { opacity: .8; font-size: 16px; max-width: 380px; }
.auth-form { display: grid; place-items: center; padding: 32px; }
.auth-form .box { width: 100%; max-width: 380px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field input {
    width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14.5px; font-family: var(--font); transition: border .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--rose-400); box-shadow: 0 0 0 3px var(--rose-100); }

.helper { color: var(--muted); font-size: 12.5px; }
.flex { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 12px; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }

/* ───── Responsivo ───── */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-art { display: none; }
}
