:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #17202a;
    --muted: #677483;
    --primary: #213b52;
    --primary-dark: #142838;
    --accent: #d88932;
    --border: #dfe5ea;
    --danger-bg: #fff1f1;
    --danger: #9f2f2f;
    --success-bg: #eef9f2;
    --success: #256c3d;
    --shadow: 0 20px 55px rgba(20, 40, 56, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

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

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

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(
            circle at top right,
            rgba(216, 137, 50, 0.16),
            transparent 34%
        ),
        linear-gradient(
            145deg,
            #eef2f5,
            #f8fafb
        );
}

.auth-card {
    width: min(100%, 440px);
    padding: 42px;
    background: var(--surface);
    border: 1px solid rgba(223, 229, 234, 0.8);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 36px;
}

.brand-horizontal {
    margin: 0;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--primary);
    color: white;
    font-size: 24px;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    letter-spacing: 0.06em;
}

.brand small {
    margin-top: 3px;
    color: var(--muted);
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(27px, 5vw, 38px);
    letter-spacing: -0.035em;
}

h2 {
    font-size: 22px;
}

.muted {
    margin-bottom: 28px;
    color: var(--muted);
    line-height: 1.55;
}

label {
    display: block;
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 700;
}

input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text);
    font: inherit;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(33, 59, 82, 0.11);
}

button {
    width: 100%;
    height: 52px;
    margin-top: 24px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

button:hover {
    background: var(--primary-dark);
}

.security-note {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 11px;
    font-size: 14px;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.topbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 15px 5vw;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
}

.user-menu span {
    font-weight: 700;
}

.user-menu a {
    text-decoration: none;
}

.dashboard {
    width: min(1180px, calc(100% - 38px));
    margin: 42px auto;
}

.welcome {
    margin-bottom: 28px;
    padding: 34px;
    border-radius: 22px;
    background:
        linear-gradient(
            135deg,
            var(--primary),
            #315d7a
        );
    color: white;
    box-shadow: var(--shadow);
}

.welcome h1 {
    margin: 7px 0 8px;
}

.welcome p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
}

.eyebrow {
    color: #f3b364;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.card {
    padding: 25px;
}

.card span {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 14px;
}

.card strong {
    font-size: 27px;
}

.panel {
    padding: 30px;
}

.panel > p {
    color: var(--muted);
    line-height: 1.55;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.action-disabled {
    padding: 20px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: #fafbfc;
}

.action-disabled strong,
.action-disabled span {
    display: block;
}

.action-disabled span {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
}

.progress {
    height: 12px;
    overflow: hidden;
    margin: 20px 0 12px;
    border-radius: 999px;
    background: #e9edf0;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.account-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 26px;
}

.account-rules div {
    padding: 18px;
    border-radius: 14px;
    background: #f8fafb;
}

.account-rules dt {
    color: var(--muted);
    font-size: 13px;
}

.account-rules dd {
    margin: 8px 0 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

@media (max-width: 760px) {
    .auth-card {
        padding: 30px 24px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-menu {
        width: 100%;
        flex-wrap: wrap;
    }

    .cards,
    .action-grid,
    .account-rules {
        grid-template-columns: 1fr;
    }

    .dashboard {
        margin-top: 24px;
    }
}

/* INICIO CLIENTES UPLOAD */

.action-link {
    display: block;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fafbfc;
    color: var(--text);
    text-decoration: none;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.action-link:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 12px 24px rgba(20, 40, 56, 0.09);
}

.action-link strong,
.action-link span {
    display: block;
}

.action-link span {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
}

.page-heading {
    margin-bottom: 24px;
    padding: 30px 34px;
    border-radius: 20px;
    background: var(--primary);
    color: white;
}

.page-heading h1 {
    margin: 8px 0;
}

.page-heading p {
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
}

.credential-box {
    margin-bottom: 24px;
    padding: 26px;
    border: 1px solid #aad9b9;
    border-radius: 18px;
    background: var(--success-bg);
}

.credential-box h2 {
    margin: 7px 0;
}

.credential-box p {
    color: var(--success);
}

.credential-label {
    color: var(--success);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.credential-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.credential-grid span {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.credential-grid input {
    background: white;
    font-family: ui-monospace, monospace;
    font-weight: 700;
}

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

.field-span-2 {
    grid-column: span 2;
}

.field-help {
    display: block;
    margin-top: 7px;
    color: var(--muted);
}

.permission-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 24px;
    margin-top: 24px;
}

.check-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    cursor: pointer;
}

.check-option input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.button-fit {
    width: auto;
    min-width: 250px;
    padding: 0 24px;
}

.client-list-panel {
    margin-top: 24px;
}

.panel-heading-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.panel-heading-row p {
    color: var(--muted);
}

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

.client-table {
    width: 100%;
    border-collapse: collapse;
}

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

.client-table th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-table td {
    font-size: 14px;
}

.client-table td strong,
.client-table td small {
    display: block;
}

.client-table td small {
    margin-top: 5px;
    color: var(--muted);
}

.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success);
    font-size: 12px;
    font-weight: 800;
}

.empty-state {
    padding: 30px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 760px) {
    .form-grid,
    .credential-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: span 1;
    }

    .button-fit {
        width: 100%;
    }
}

/* FIM CLIENTES UPLOAD */

/* INICIO EDITAR ESPACO CLIENTE */

.table-action {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--primary);
    border-radius: 9px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.table-action:hover {
    background: var(--primary);
    color: white;
}

.edit-space-panel {
    max-width: 800px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
}

.button-secondary {
    display: inline-grid;
    min-height: 52px;
    padding: 0 24px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.button-secondary:hover {
    border-color: var(--primary);
}

@media (max-width: 760px) {
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .button-secondary {
        width: 100%;
    }
}

/* FIM EDITAR ESPACO CLIENTE */

/* UPLOAD V2 */
.transition-banner {
    margin: 20px 0;
    border-left: 6px solid #d38a2f;
    background: #fff8e8;
    color: #4a3b1a;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #f2efe8;
    border-radius: 999px;
    overflow: hidden;
    margin: 14px 0 10px;
}

.progress-fill {
    height: 10px;
    background: #d38a2f;
    border-radius: 999px;
}

.progress-label {
    font-size: 14px;
    margin-bottom: 18px;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px;
}

.mini-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
}

.mini-card span {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

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

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.field-help {
    color: #6b7280;
    font-size: 13px;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.table-action {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #244667;
    border-radius: 9px;
    color: #244667;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
    margin-bottom: 6px;
}

.table-action:hover {
    background: #244667;
    color: #fff;
}

.table-action.danger {
    border-color: #b42318;
    color: #b42318;
}

.table-action.danger:hover {
    background: #b42318;
    color: #fff;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

@media (max-width: 800px) {
    .mini-grid,
    .upload-form .form-grid {
        grid-template-columns: 1fr;
    }
}
/* FIM UPLOAD V2 */
