:root {
    --bg: #09111f;
    --card: rgba(12, 20, 36, 0.82);
    --text: #e5eefc;
    --text-dark: #122033;
    --muted: #8fa3bf;
    --primary: #1d70ff;
    --primary-2: #16c4ff;
    --success: #12b76a;
    --warning: #f79009;
    --danger: #f04438;
    --shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    --radius: 22px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(29,112,255,0.22), transparent 32%),
        radial-gradient(circle at top right, rgba(22,196,255,0.18), transparent 28%),
        linear-gradient(135deg, #08111f 0%, #101f39 50%, #eef4fb 140%);
    min-height: 100vh;
    color: var(--text-dark);
}
a { color: inherit; }
.shell { max-width: 1280px; margin: 0 auto; padding: 32px 20px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.brand h1, .brand h2 { margin: 0; }
.brand h1 { font-size: 42px; color: #fff; letter-spacing: -1px; }
.brand p { margin: 8px 0 0; color: #c9d7ea; max-width: 720px; line-height: 1.55; }
.glass, .card { border-radius: var(--radius); box-shadow: var(--shadow); }
.glass { background: var(--card); border: 1px solid rgba(255,255,255,0.08); color: var(--text); backdrop-filter: blur(12px); }
.card { background: rgba(255,255,255,0.96); border: 1px solid rgba(255,255,255,0.6); }
.panel { padding: 26px; margin-bottom: 22px; }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.field label { display: block; margin-bottom: 8px; font-size: 14px; color: #314255; font-weight: 600; }
.field input, .field select, .field textarea {
    width: 100%; border: 1px solid #d8e1ed; border-radius: 14px; padding: 13px 14px; font: inherit; color: #10243a; background: #f8fbff;
}
.field textarea { min-height: 96px; resize: vertical; }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: span 3; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 14px;
    border: 0; cursor: pointer; text-decoration: none; font-weight: 700; transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.btn-dark { background: #24364d; color: #fff; }
.btn-danger { background: #d92d20; color: #fff; }
.btn-soft { background: #eff6ff; color: #1d4ed8; }
.hero-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric { padding: 20px; color: #fff; }
.metric .label { color: #d2def0; font-size: 14px; }
.metric .value { font-size: 30px; font-weight: 800; margin-top: 8px; }
.layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; }
.table-wrap { overflow-x: auto; }
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filters-bar input,
.filters-bar select {
    padding: 12px 14px;
    border: 1px solid #d8e1ed;
    border-radius: 14px;
    background: #f8fbff;
    font: inherit;
    min-width: 220px;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid #edf2f7; text-align: left; vertical-align: top; }
th { color: #53657b; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge-success { background: rgba(18,183,106,.12); color: #027a48; }
.badge-warning { background: rgba(247,144,9,.14); color: #b54708; }
.badge-danger { background: rgba(240,68,56,.14); color: #b42318; }
.badge-neutral { background: rgba(71,84,103,.10); color: #344054; }
.muted { color: #667085; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { padding: 30px; text-align: center; color: #667085; }
.flash { margin-bottom: 16px; padding: 14px 16px; border-radius: 14px; font-weight: 700; }
.flash-success { background: rgba(18,183,106,.12); color: #027a48; }
.flash-error { background: rgba(240,68,56,.12); color: #b42318; }
.hint { color: #8092aa; font-size: 13px; margin-top: 8px; }
.field textarea { min-height: 140px; }
.client-shell { max-width: 980px; margin: 0 auto; padding: 32px 20px 70px; }
.client-shell-compact { max-width: 860px; }
.hero-client { padding: 34px; color: #fff; margin-bottom: 20px; }
.hero-compact { padding: 24px; }
.hero-client h1 { margin: 0; font-size: 40px; }
.hero-client p { color: #d9e4f7; line-height: 1.6; }
.client-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }
.client-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card { padding: 22px; }
.stat-title { color: #63758b; font-size: 14px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; color: #11243a; }
.countdown-card {
    padding: 24px;
    background: linear-gradient(135deg, #10244b, #1c4fa3);
    color: #fff;
    margin-bottom: 20px;
}
.countdown-label { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; opacity: .78; }
.countdown-value { font-size: 34px; font-weight: 800; margin: 10px 0 8px; }
.countdown-subtitle { color: rgba(255,255,255,.86); }
.pix-box { border: 1px dashed #c5d4e7; border-radius: 18px; padding: 18px; background: #f8fbff; }
.pix-image { width: 100%; max-width: 280px; display: block; border-radius: 18px; margin: 16px auto; }
.pix-code { width: 100%; min-height: 110px; border-radius: 14px; border: 1px solid #d8e1ed; padding: 12px; background: #fff; font: inherit; }
.copy-btn { width: 100%; margin-top: 12px; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 12, 24, 0.76);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}
.modal-backdrop.active { display: flex; }
.modal-card {
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 24px;
    padding: 26px;
    position: relative;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.modal-card-compact { max-width: 420px; }
.modal-card-wide {
    max-width: 1180px;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}
.modal-form-body {
    overflow: auto;
    padding-right: 6px;
    margin-top: 6px;
}
.modal-form-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid #e9eef7;
}
.logs-table-wrap {
    max-height: calc(88vh - 120px);
    overflow: auto;
}
.logs-table-wrap thead th {
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.98);
    z-index: 2;
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 0;
    background: #eef2f8;
    cursor: pointer;
    font-weight: 700;
}
.login-wrap { display:flex; align-items:center; justify-content:center; min-height:100vh; padding:22px; }
.login-card { width: 420px; padding: 30px; }
.login-card h1 { margin: 0; color: #fff; font-size: 36px; }
.login-card p { color: #d6e1f2; }
.login-card label { color: #c8d6eb; display:block; margin-bottom:8px; }
.login-card input {
    width: 100%; padding: 13px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.12);
    background: rgba(6,10,20,0.46); color: #fff; margin-bottom: 14px;
}
.verify-btn { margin-top: 10px; }
.topbar .actions { justify-content: flex-end; }
.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #eef4ff;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 700;
}
.page-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
}
@media (max-width: 980px) {
    .layout, .client-grid { grid-template-columns: 1fr; }
    .client-grid-compact { grid-template-columns: 1fr; }
    .hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field.span-2, .field.span-3 { grid-column: span 2; }
    .modal-card-wide {
        max-width: 100%;
        max-height: 92vh;
    }
    .modal-form-actions {
        padding-bottom: 2px;
    }
    .logs-table-wrap {
        max-height: calc(92vh - 120px);
    }
    .filters-bar input,
    .filters-bar select {
        min-width: 180px;
        flex: 1 1 180px;
    }
}
@media (max-width: 640px) {
    .brand h1, .hero-client h1 { font-size: 30px; }
    .hero-metrics, .grid { grid-template-columns: 1fr; }
    .field.span-2, .field.span-3 { grid-column: span 1; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .filters-bar { width: 100%; }
    .filters-bar input,
    .filters-bar select {
        width: 100%;
        min-width: 100%;
    }
    .client-shell { padding: 20px 14px 40px; }
    .hero-client { padding: 22px; }
    .countdown-value, .stat-value { font-size: 24px; }
    .modal-card { padding: 22px 16px; border-radius: 18px; }
    .modal-form-actions {
        position: static;
        border-top: 0;
        padding-top: 18px;
        margin-top: 10px;
    }
    .pix-image { max-width: 220px; }
    .btn { width: 100%; }
}
