* {
    box-sizing: border-box;
}

:root {
    --bg: #08080f;
    --bg-2: #0d0d17;
    --sidebar: rgba(14, 14, 24, 0.96);
    --card: rgba(20, 20, 32, 0.94);
    --card-2: rgba(25, 25, 40, 0.96);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f5f5fa;
    --muted: #aaaabe;
    --muted-2: #77778a;
    --primary: #9f70ff;
    --primary-dark: #7c4df0;
    --primary-soft: rgba(159, 112, 255, 0.14);
    --danger: #e45656;
    --danger-dark: #b93636;
    --success: #44d07b;
    --warning: #ffbf4d;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
    --radius: 18px;
}

html {
    scroll-behavior: auto;
}

body {
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top center, rgba(159, 112, 255, 0.18), transparent 34%),
        linear-gradient(180deg, #0b0b14 0%, #07070d 100%);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

small {
    color: var(--muted);
}

/* ===============================
   LOGIN
================================ */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-box {
    width: 410px;
    background: rgba(20, 20, 32, 0.94);
    border: 1px solid var(--border-strong);
    padding: 32px;
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.login-box h1 {
    margin: 0 0 7px;
    font-size: 25px;
    letter-spacing: -0.5px;
}

.login-box p {
    margin: 0 0 26px;
    color: var(--muted);
}

/* ===============================
   FORMULÁRIOS
================================ */

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    background: #0d0d17;
    color: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 13px;
    outline: none;
    transition: 0.18s ease;
    font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(159, 112, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(159, 112, 255, 0.13);
    background: #10101c;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

label {
    display: block;
    margin: 13px 0 7px;
    color: #dedee9;
    font-size: 14px;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* ===============================
   BOTÕES
================================ */

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: 0;
    padding: 11px 16px;
    border-radius: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.18s ease;
    box-shadow: 0 10px 24px rgba(159, 112, 255, 0.22);
    font-size: 14px;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

button:active,
.btn:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    box-shadow: 0 10px 24px rgba(228, 86, 86, 0.16);
}

.btn-secondary {
    background: #252538;
    box-shadow: none;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===============================
   ALERTAS
================================ */

.error,
.success {
    padding: 13px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 14px;
}

.error {
    background: rgba(228, 86, 86, 0.15);
    border: 1px solid rgba(228, 86, 86, 0.34);
    color: #ffbcbc;
}

.success {
    background: rgba(68, 208, 123, 0.14);
    border: 1px solid rgba(68, 208, 123, 0.34);
    color: #baffd1;
}

/* ===============================
   LAYOUT
================================ */

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

.sidebar {
    width: 265px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 24px 18px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    backdrop-filter: blur(12px);
    z-index: 10;
}

.sidebar h2 {
    margin: 0 0 28px;
    font-size: 19px;
    color: #fff;
    letter-spacing: -0.3px;
    padding: 0 8px;
}

.sidebar a {
    display: flex;
    align-items: center;
    padding: 12px 13px;
    margin-bottom: 8px;
    color: #c9c9d6;
    border-radius: 13px;
    transition: 0.18s ease;
    font-weight: 700;
    font-size: 14px;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--primary-soft);
    color: #fff;
}

.sidebar a:last-child {
    margin-top: 18px;
    color: #ffb5b5;
}

.main {
    flex: 1;
    margin-left: 265px;
    padding: 30px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: rgba(20, 20, 32, 0.62);
    border: 1px solid var(--border);
    padding: 18px 20px;
    border-radius: var(--radius);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.16);
}

.topbar strong {
    font-size: 17px;
}

/* ===============================
   CARDS
================================ */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.18);
}

.card h2 {
    margin: 0 0 18px;
    font-size: 22px;
    letter-spacing: -0.4px;
}

.card p {
    color: var(--muted);
    margin-top: -8px;
}

/* ===============================
   DASHBOARD
================================ */

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat {
    background:
        linear-gradient(135deg, rgba(159, 112, 255, 0.12), transparent 70%),
        rgba(20, 20, 32, 0.95);
    position: relative;
    overflow: hidden;
}

.stat::after {
    content: "";
    position: absolute;
    right: -35px;
    top: -35px;
    width: 95px;
    height: 95px;
    background: rgba(159, 112, 255, 0.12);
    border-radius: 999px;
}

.stat h3 {
    margin: 0;
    font-size: 33px;
    letter-spacing: -0.9px;
}

.stat p {
    margin: 7px 0 0;
    color: var(--muted);
    font-weight: 700;
}

/* ===============================
   TABELAS
================================ */

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.table th,
.table td {
    padding: 14px 13px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: #b8b8c8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 800;
}

.table td {
    color: #efeff6;
    font-size: 14px;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

.table tr:last-child td {
    border-bottom: 0;
}

/* ===============================
   BADGES
================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-ativo,
.badge-ativa {
    background: rgba(68, 208, 123, 0.14);
    color: #8cffb7;
}

.badge-bloqueado,
.badge-bloqueada,
.badge-expirada {
    background: rgba(228, 86, 86, 0.15);
    color: #ff9c9c;
}

.badge-pendente {
    background: rgba(255, 191, 77, 0.14);
    color: #ffd88a;
}

/* ===============================
   SCROLLBAR
================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0b0b13;
}

::-webkit-scrollbar-thumb {
    background: #28283b;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a55;
}

/* ===============================
   RESPONSIVO
================================ */

@media (max-width: 1100px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .layout {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        bottom: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .main {
        margin-left: 0;
        padding: 20px;
    }

    .form-grid,
    .grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        display: block;
    }

    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

.copy-config {
    white-space: nowrap;
}

.table td .btn,
.table td button {
    margin-bottom: 4px;
}

.card form .btn-secondary {
    margin-left: 8px;
}


.input-with-button {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-with-button input {
    flex: 1;
}

.input-with-button button {
    white-space: nowrap;
    box-shadow: none;
}


.main > .success,
.main > .error {
    position: relative;
    margin-bottom: 18px;
}


/* ===============================
   TABELA DE LICENÇAS MAIS ORGANIZADA
================================ */

.card-licencas {
    overflow: hidden;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
}

.table-licencas {
    min-width: 1380px;
    table-layout: fixed;
}

.table-licencas th,
.table-licencas td {
    padding: 13px 12px;
    line-height: 1.35;
}

.table-licencas td {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.table-licencas .cell-cliente {
    width: 110px;
}

.table-licencas .cell-script {
    width: 155px;
}

.table-licencas .cell-chave {
    width: 130px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.table-licencas .cell-email {
    width: 190px;
}

.table-licencas .cell-discord {
    width: 170px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.table-licencas .cell-build {
    width: 150px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.table-licencas .cell-ip {
    width: 130px;
    white-space: nowrap;
}

.table-licencas .cell-pasta {
    width: 120px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.license-actions {
    min-width: 220px;
    width: 220px;
}

.actions-row {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.actions-row:last-child {
    margin-bottom: 0;
}

.btn-small {
    padding: 9px 12px;
    font-size: 13px;
    border-radius: 11px;
    min-height: 38px;
}

.license-actions .btn,
.license-actions button {
    margin: 0;
}

.license-actions .copy-config {
    flex: 1 1 100%;
}

.license-actions .actions-row:last-child .btn {
    flex: 1 1 auto;
}

@media (max-width: 900px) {
    .table-licencas {
        min-width: 1280px;
    }
}


/* ===============================
   CORREÇÃO FINAL - LICENÇAS / AÇÕES
================================ */

.card-licencas {
    overflow: visible !important;
}

.card-licencas .table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 10px;
}

.table-licencas {
    width: 100%;
    min-width: 1180px;
    table-layout: fixed;
}

.table-licencas th,
.table-licencas td {
    padding: 12px 9px;
    vertical-align: middle;
}

.table-licencas th:nth-child(1),
.table-licencas td:nth-child(1) {
    width: 120px;
}

.table-licencas th:nth-child(2),
.table-licencas td:nth-child(2) {
    width: 135px;
}

.table-licencas th:nth-child(3),
.table-licencas td:nth-child(3) {
    width: 125px;
}

.table-licencas th:nth-child(4),
.table-licencas td:nth-child(4) {
    width: 150px;
}

.table-licencas th:nth-child(5),
.table-licencas td:nth-child(5) {
    width: 145px;
}

.table-licencas th:nth-child(6),
.table-licencas td:nth-child(6) {
    width: 130px;
}

.table-licencas th:nth-child(7),
.table-licencas td:nth-child(7) {
    width: 135px;
}

.table-licencas th:nth-child(8),
.table-licencas td:nth-child(8) {
    width: 115px;
}

.table-licencas th:nth-child(9),
.table-licencas td:nth-child(9) {
    width: 95px;
}

.table-licencas th:nth-child(10),
.table-licencas td:nth-child(10) {
    width: 95px;
}

.table-licencas th:nth-child(11),
.table-licencas td:nth-child(11) {
    width: 190px;
}

.license-actions {
    width: 190px !important;
    min-width: 190px !important;
    max-width: 190px !important;
    overflow: visible;
}

.license-actions .actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-bottom: 7px;
}

.license-actions .actions-row:last-child {
    grid-template-columns: 1fr 1fr;
}

.license-actions .actions-row:last-child .btn-danger {
    grid-column: 1 / 3;
}

.license-actions .btn,
.license-actions button {
    width: 100%;
    min-width: 0;
    padding: 8px 9px;
    font-size: 12px;
    line-height: 1.2;
    min-height: 36px;
    white-space: nowrap;
}

.table-licencas td {
    font-size: 13px;
}

.table-licencas small {
    font-size: 12px;
}

@media (max-width: 1400px) {
    .table-licencas {
        min-width: 1180px;
    }
}


/* ===============================
   DETALHES E FILTROS
================================ */

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.details-grid > div {
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}

.details-grid small {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 700;
}

.details-grid strong {
    display: block;
    word-break: break-word;
}

@media (max-width: 1000px) {
    .grid-2,
    .details-grid {
        grid-template-columns: 1fr;
    }
}


/* ===============================
   FIX PARTE 1 - AÇÕES NÃO CORTAR
================================ */

.card-licencas {
    overflow: visible !important;
}

.card-licencas .table-responsive {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding-bottom: 14px;
}

.table-licencas {
    min-width: 1450px !important;
    table-layout: fixed !important;
}

.table-licencas th:nth-child(12),
.table-licencas td:nth-child(12) {
    width: 230px !important;
    min-width: 230px !important;
}

.license-actions {
    width: 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
    overflow: visible !important;
}

.license-actions .actions-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
}

.license-actions .actions-row:last-child {
    margin-bottom: 0 !important;
}

.license-actions .btn,
.license-actions button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 8px 8px !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    min-height: 36px !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

@media (max-width: 1500px) {
    .table-licencas {
        min-width: 1450px !important;
    }
}


/* ===============================
   FIX COMPACTO - AÇÕES LICENÇAS
================================ */

.card-licencas {
    overflow: hidden !important;
}

.card-licencas .table-responsive {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 8px !important;
}

.table-licencas {
    min-width: 1320px !important;
    table-layout: fixed !important;
}

.table-licencas th,
.table-licencas td {
    padding-left: 7px !important;
    padding-right: 7px !important;
}

.table-licencas th:nth-child(12),
.table-licencas td:nth-child(12) {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
}

.license-actions {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    overflow: visible !important;
}

.license-actions .actions-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin-bottom: 6px !important;
}

.license-actions .actions-row:last-child {
    margin-bottom: 0 !important;
}

.license-actions .btn,
.license-actions button {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 6px !important;
    font-size: 11px !important;
    min-height: 34px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
}

.table-licencas .cell-cliente {
    width: 115px !important;
}

.table-licencas .cell-script {
    width: 135px !important;
}

.table-licencas .cell-email {
    width: 145px !important;
}

.table-licencas .cell-discord {
    width: 150px !important;
}

.table-licencas .cell-build {
    width: 125px !important;
}

.table-licencas .cell-ip {
    width: 125px !important;
}

.table-licencas .cell-pasta {
    width: 95px !important;
}


/* ===============================
   AJUSTE FINAL - AÇÕES COM BOTÕES E MENOS ESPAÇO
================================ */

.card-licencas {
    overflow: hidden !important;
}

.card-licencas .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 10px !important;
}

/* Não estica a tabela até o canto direito. Isso remove o espaço grande antes dos botões. */
.table-licencas {
    width: max-content !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

.table-licencas th,
.table-licencas td {
    padding-left: 7px !important;
    padding-right: 7px !important;
    vertical-align: middle !important;
}

.table-licencas th:nth-child(1),
.table-licencas td:nth-child(1) {
    width: 120px !important;
}

.table-licencas th:nth-child(2),
.table-licencas td:nth-child(2) {
    width: 130px !important;
}

.table-licencas th:nth-child(3),
.table-licencas td:nth-child(3) {
    width: 125px !important;
}

.table-licencas th:nth-child(4),
.table-licencas td:nth-child(4) {
    width: 145px !important;
}

.table-licencas th:nth-child(5),
.table-licencas td:nth-child(5) {
    width: 155px !important;
}

.table-licencas th:nth-child(6),
.table-licencas td:nth-child(6) {
    width: 130px !important;
}

.table-licencas th:nth-child(7),
.table-licencas td:nth-child(7) {
    width: 75px !important;
}

.table-licencas th:nth-child(8),
.table-licencas td:nth-child(8) {
    width: 130px !important;
}

.table-licencas th:nth-child(9),
.table-licencas td:nth-child(9) {
    width: 105px !important;
}

.table-licencas th:nth-child(10),
.table-licencas td:nth-child(10) {
    width: 85px !important;
}

.table-licencas th:nth-child(11),
.table-licencas td:nth-child(11) {
    width: 85px !important;
}

/* Ações compactas, mas com Lic/Srv de volta */
.table-licencas th:nth-child(12),
.table-licencas td:nth-child(12),
.license-actions {
    width: 126px !important;
    min-width: 126px !important;
    max-width: 126px !important;
}

.license-actions {
    overflow: visible !important;
}

.license-actions .actions-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin-bottom: 6px !important;
}

.license-actions .actions-row:last-child {
    margin-bottom: 0 !important;
}

.license-actions .btn,
.license-actions button {
    width: 100% !important;
    min-width: 0 !important;
    padding: 7px 5px !important;
    font-size: 11px !important;
    min-height: 33px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
}

.table-licencas .cell-script,
.table-licencas .cell-chave,
.table-licencas .cell-email,
.table-licencas .cell-discord,
.table-licencas .cell-build,
.table-licencas .cell-pasta {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

.table-licencas .cell-ip {
    white-space: nowrap !important;
}


/* ===============================
   AÇÕES COMPLETAS - LICENÇAS
================================ */

.card-licencas {
    overflow: hidden !important;
}

.card-licencas .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 12px !important;
}

/* Mantém a tabela compacta, sem criar um espaço enorme antes dos botões */
.table-licencas {
    width: max-content !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

.table-licencas th,
.table-licencas td {
    padding-left: 7px !important;
    padding-right: 7px !important;
    vertical-align: middle !important;
}

.table-licencas th:nth-child(1),
.table-licencas td:nth-child(1) {
    width: 120px !important;
}

.table-licencas th:nth-child(2),
.table-licencas td:nth-child(2) {
    width: 130px !important;
}

.table-licencas th:nth-child(3),
.table-licencas td:nth-child(3) {
    width: 125px !important;
}

.table-licencas th:nth-child(4),
.table-licencas td:nth-child(4) {
    width: 145px !important;
}

.table-licencas th:nth-child(5),
.table-licencas td:nth-child(5) {
    width: 155px !important;
}

.table-licencas th:nth-child(6),
.table-licencas td:nth-child(6) {
    width: 130px !important;
}

.table-licencas th:nth-child(7),
.table-licencas td:nth-child(7) {
    width: 75px !important;
}

.table-licencas th:nth-child(8),
.table-licencas td:nth-child(8) {
    width: 130px !important;
}

.table-licencas th:nth-child(9),
.table-licencas td:nth-child(9) {
    width: 105px !important;
}

.table-licencas th:nth-child(10),
.table-licencas td:nth-child(10) {
    width: 85px !important;
}

.table-licencas th:nth-child(11),
.table-licencas td:nth-child(11) {
    width: 85px !important;
}

/* Coluna Ações maior para caber nomes completos */
.table-licencas th:nth-child(12),
.table-licencas td:nth-child(12),
.license-actions {
    width: 235px !important;
    min-width: 235px !important;
    max-width: 235px !important;
}

.license-actions {
    overflow: visible !important;
}

.license-actions .actions-row {
    display: grid !important;
    gap: 7px !important;
    margin-bottom: 7px !important;
}

.license-actions .actions-row:last-child {
    margin-bottom: 0 !important;
}

.license-actions .actions-row-full {
    grid-template-columns: 1fr !important;
}

.license-actions .actions-row-three {
    grid-template-columns: 1fr 1fr 1fr !important;
}

.license-actions .btn,
.license-actions button {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 9px !important;
    font-size: 12px !important;
    min-height: 36px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
}

.table-licencas .cell-script,
.table-licencas .cell-chave,
.table-licencas .cell-email,
.table-licencas .cell-discord,
.table-licencas .cell-build,
.table-licencas .cell-pasta {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

.table-licencas .cell-ip {
    white-space: nowrap !important;
}


/* ===============================
   GERADOR DE BUILD
================================ */

.code-box {
    min-height: 145px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}


/* ===============================
   FASE 9 - PROFISSIONALIZAÇÃO
================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.16);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    color: var(--text);
}

.btn-small {
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 10px;
    margin: 2px;
}

.badge-pendente {
    background: rgba(255, 191, 77, 0.16);
    color: #ffd27a;
    border: 1px solid rgba(255, 191, 77, 0.28);
}

.table-responsive {
    overflow-x: auto;
}

@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .stats {
        grid-template-columns: 1fr;
    }
}




/* ===============================
   GERADOR PACOTE - GUIA PROFISSIONAL
================================ */
.package-guide {
    margin: 18px 0 26px;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid rgba(159, 112, 255, 0.28);
    background:
        radial-gradient(circle at 0% 0%, rgba(159,112,255,0.18), transparent 34%),
        linear-gradient(135deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
    box-shadow: 0 20px 50px rgba(0,0,0,0.26);
}

.package-guide__top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.package-guide__icon {
    min-width: 52px;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-size: 25px;
    background: rgba(159,112,255,0.18);
    border: 1px solid rgba(159,112,255,0.35);
    box-shadow: inset 0 0 18px rgba(159,112,255,0.10);
}

.package-guide__top strong {
    display: block;
    font-size: 19px;
    color: #ffffff;
    margin-bottom: 5px;
    letter-spacing: 0.2px;
}

.package-guide__top span {
    display: block;
    color: rgba(255,255,255,0.72);
    font-size: 14px;
    line-height: 1.45;
}

.package-guide__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.package-guide__card {
    position: relative;
    min-height: 156px;
    padding: 16px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.045);
}

.package-guide__card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.9;
    background: linear-gradient(180deg, rgba(255,255,255,0.065), transparent);
}

.package-guide__card-title {
    position: relative;
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 12px;
    color: #fff;
}

.package-guide__tags {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 11px;
}

.package-guide code {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 9px;
    font-size: 12px;
    color: #fff;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.12);
}

.package-guide__card p {
    position: relative;
    margin: 0;
    color: rgba(255,255,255,0.70);
    line-height: 1.45;
    font-size: 13px;
}

.package-guide__card--required {
    background: linear-gradient(135deg, rgba(46,204,113,0.16), rgba(46,204,113,0.055));
    border-color: rgba(46,204,113,0.38);
}

.package-guide__card--optional {
    background: linear-gradient(135deg, rgba(52,152,219,0.16), rgba(52,152,219,0.055));
    border-color: rgba(52,152,219,0.38);
}

.package-guide__card--example {
    background: linear-gradient(135deg, rgba(159,112,255,0.18), rgba(159,112,255,0.060));
    border-color: rgba(159,112,255,0.42);
}

.package-guide__card--danger {
    background: linear-gradient(135deg, rgba(255,77,109,0.17), rgba(255,77,109,0.055));
    border-color: rgba(255,77,109,0.40);
}

@media (max-width: 1250px) {
    .package-guide__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .package-guide {
        padding: 16px;
    }

    .package-guide__top {
        align-items: flex-start;
    }

    .package-guide__grid {
        grid-template-columns: 1fr;
    }
}


/* ===============================
   FASE 10/11 - CONFIG, STATUS E SUPORTE
================================ */
.status-ok {
    color: #2ecc71;
    font-weight: 800;
}

.status-fail {
    color: #ff4d6d;
    font-weight: 800;
}

.config-hint {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(159,112,255,0.25);
    background: rgba(159,112,255,0.08);
    color: var(--muted);
}


/* ===============================
   MENU AGRUPADO PROFISSIONAL
================================ */

.sidebar {
    overflow-y: auto;
}

.sidebar .menu-main,
.sidebar .menu-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.menu-section {
    margin: 12px 0;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.055);
}

.menu-section.open {
    background: rgba(159,112,255,0.070);
    border-color: rgba(159,112,255,0.180);
}

.menu-section-title {
    padding: 4px 4px 9px;
    border-bottom: 1px solid rgba(255,255,255,0.055);
    margin-bottom: 8px;
}

.menu-section-title span {
    display: block;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.menu-section-title small {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,0.45);
    font-size: 11px;
}

.menu-section-links {
    display: grid;
    gap: 5px;
}

.sidebar .menu-section-links a {
    margin: 0;
    padding: 9px 11px;
    font-size: 13px;
    border-radius: 11px;
    background: transparent;
    border: 1px solid transparent;
}

.sidebar .menu-section-links a:hover {
    background: rgba(255,255,255,0.055);
    border-color: rgba(255,255,255,0.075);
}

.sidebar .menu-section-links a.active {
    background: linear-gradient(135deg, rgba(159,112,255,0.28), rgba(159,112,255,0.12));
    border-color: rgba(159,112,255,0.32);
    color: #fff;
}

.sidebar .menu-main.active {
    background: linear-gradient(135deg, rgba(159,112,255,0.32), rgba(159,112,255,0.12));
    border-color: rgba(159,112,255,0.35);
}

.menu-logout {
    margin-top: 16px !important;
    background: rgba(255,77,109,0.08) !important;
    border: 1px solid rgba(255,77,109,0.18) !important;
    color: #ffb3c1 !important;
}

.menu-logout:hover {
    background: rgba(255,77,109,0.16) !important;
}
