:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --bg: #f4f5f9;
    --card-bg: #ffffff;
    --text: #2d2d3a;
    --muted: #78798c;
    --border: #e7e8f0;
    --success: #16a34a;
    --danger: #e11d48;
    --warning: #d97706;
    --radius: 14px;
}

* { box-sizing: border-box; }

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.35);
}

.auth-card h1 {
    font-size: 1.5rem;
    margin: 0 0 4px;
    text-align: center;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 24px;
    font-size: .9rem;
}

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.field input, .field select, .field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: .95rem;
    transition: border-color .15s;
    background: #fff;
    color: var(--text);
}

.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.field small { color: var(--muted); font-size: .78rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .1s, opacity .15s;
    text-decoration: none;
}

.btn:hover { opacity: .92; text-decoration: none; }
.btn:active { transform: scale(.98); }

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; width: 100%; }
.btn-secondary { background: #eef0fb; color: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: .88rem;
    margin-bottom: 16px;
}
.alert-error { background: #fde8ec; color: #b91c3c; border: 1px solid #f7c6d1; }
.alert-success { background: #e7f9ee; color: #15803d; border: 1px solid #bdedcf; }
.alert-info { background: #eaf1ff; color: #2952cc; border: 1px solid #c9d9fb; }

.auth-links { text-align: center; margin-top: 18px; font-size: .85rem; color: var(--muted); }
.auth-logo { text-align: center; font-weight: 800; font-size: 1.6rem; margin-bottom: 6px; color: var(--primary-dark); }

/* ---------- Layout autenticado (admin e cliente) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    background: #191c2b;
    color: #cfd2e6;
    padding: 22px 16px;
    flex-shrink: 0;
}

.sidebar .brand {
    font-weight: 800;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 26px;
    padding: 0 8px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    color: #cfd2e6;
    font-size: .92rem;
    margin-bottom: 4px;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(255,255,255,.08);
    color: #fff;
    text-decoration: none;
}

.main-content { flex: 1; padding: 28px 34px; max-width: 100%; overflow-x: hidden; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
    flex-wrap: wrap;
    gap: 12px;
}

.topbar h1 { font-size: 1.4rem; margin: 0; }

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 22px;
    border: 1px solid var(--border);
}

.card h2, .card h3 { margin-top: 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
}
.stat-card .label { color: var(--muted); font-size: .82rem; margin-bottom: 6px; }
.stat-card .value { font-size: 1.7rem; font-weight: 800; }

table { width: 100%; border-collapse: collapse; font-size: .89rem; }
table th, table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
table th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
table tr:hover td { background: #fafbff; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-success { background: #e7f9ee; color: #15803d; }
.badge-danger { background: #fde8ec; color: #b91c3c; }
.badge-warning { background: #fff3e0; color: #b45309; }
.badge-muted { background: #eee; color: #666; }

.tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs a {
    padding: 10px 16px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}
.tabs a.active { color: var(--primary-dark); border-color: var(--primary); }

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    display: none; align-items: center; justify-content: center; z-index: 999; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 26px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }

.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }

.pix-box { text-align: center; }
.pix-box img { max-width: 220px; border-radius: 12px; border: 1px solid var(--border); padding: 8px; background: #fff; }
.pix-copy { display: flex; gap: 8px; margin-top: 14px; }
.pix-copy input { flex: 1; }

.pricing-plan {
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    background: #fff;
}
.pricing-plan .price { font-size: 2rem; font-weight: 800; margin: 10px 0; color: var(--primary-dark); }
.pricing-plan .price span { font-size: .9rem; color: var(--muted); font-weight: 400; }

@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; }
    .main-content { padding: 20px; }
}
