:root {
    font-family: "Segoe UI", Arial, sans-serif;
    color: #e5e7eb;
    background: #0b1120;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.10), transparent 30%),
        #0b1120;
    color: #e5e7eb;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: #93c5fd;
}

.layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    border-right: 1px solid #243044;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.16);
    overflow-y: auto;
}

.brand {
    margin: 0 8px 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #263247;
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -0.4px;
    color: #ffffff;
}

.brand::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 10px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.75);
}

.sidebar a,
.link-button {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #b9c4d3;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.sidebar a:hover,
.link-button:hover {
    background: #1a2537;
    border-color: #2c3a50;
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar a:focus-visible,
.link-button:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.content {
    min-width: 0;
    padding: 32px;
    overflow-x: hidden;
}

.content > h1:first-child,
.content > h2:first-child {
    margin-top: 0;
}

.public-content {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.18), transparent 34%),
        linear-gradient(145deg, #08101e 0%, #0f172a 55%, #111827 100%);
}

.login-card,
.panel {
    background: rgba(20, 30, 48, 0.96);
    border: 1px solid #2b3a52;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.login-card {
    width: min(430px, 100%);
    padding: 32px;
}

.login-card h1,
.login-card h2 {
    margin-top: 0;
    color: #ffffff;
}

.panel {
    margin-bottom: 20px;
}

.panel h2,
.panel h3 {
    margin-top: 0;
}

label {
    display: block;
    margin: 14px 0 7px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #334155;
    border-radius: 9px;
    background: #0d1728;
    color: #f8fafc;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
    color: #64748b;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #475569;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #3b82f6;
    background: #101c30;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
    outline: none;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

button {
    margin-top: 14px;
    padding: 10px 17px;
    border: 1px solid #2563eb;
    border-radius: 9px;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    font-weight: 650;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
}

button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.26);
}

button:active {
    transform: translateY(0);
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0 26px;
}

.metric {
    position: relative;
    overflow: hidden;
    min-height: 128px;
    padding: 21px;
    background: linear-gradient(145deg, #172033 0%, #131d2f 100%);
    border: 1px solid #2a3852;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.metric::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: -28px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.08);
}

.metric strong {
    position: relative;
    z-index: 1;
    display: block;
    margin-bottom: 6px;
    font-size: 32px;
    line-height: 1;
    color: #ffffff;
}

.metric span {
    position: relative;
    z-index: 1;
    color: #94a3b8;
    font-size: 14px;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: #141e30;
    border: 1px solid #2a3852;
    border-radius: 13px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid #29374d;
    vertical-align: middle;
    text-align: left;
}

th {
    background: #18243a;
    color: #bfdbfe;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

td {
    color: #d7deea;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: #18253a;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.alert,
.notice {
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
}

.success {
    background: rgba(20, 83, 45, 0.75);
    border-color: #166534;
    color: #dcfce7;
}

.danger {
    background: rgba(127, 29, 29, 0.75);
    border-color: #991b1b;
    color: #fee2e2;
}

.warning {
    background: rgba(120, 53, 15, 0.75);
    border-color: #92400e;
    color: #fef3c7;
}

.notice {
    background: rgba(30, 58, 95, 0.78);
    border-color: #1d4f7a;
    color: #dbeafe;
}

code {
    color: #bfdbfe;
    white-space: normal;
    word-break: break-all;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0b1120;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border: 2px solid #0b1120;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

@media (max-width: 1100px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 18px;
    }

    .brand {
        margin-bottom: 12px;
    }

    .content {
        padding: 22px;
    }

    .grid-two {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .content,
    .public-content {
        padding: 16px;
    }

    .login-card {
        padding: 24px 20px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    th,
    td {
        padding: 11px;
    }
}

.login-header{
    text-align:center;
    margin-bottom:28px;
}

.login-brand{
    font-size:28px;
    font-weight:700;
    color:#fff;
    margin-bottom:10px;
}

.login-header h1{
    margin:0;
    font-size:22px;
}

.login-header p{
    margin-top:10px;
    color:#94a3b8;
    font-size:14px;
}

.login-form{
    display:flex;
    flex-direction:column;
}

.login-footer{
    margin-top:30px;
    padding-top:20px;
    border-top:1px solid #2a3852;
    text-align:center;
    font-size:13px;
    color:#64748b;
}
/* ---------- MENU ---------- */

.sidebar-nav{
    display:flex;
    flex-direction:column;
}

.menu-title{
    margin:22px 10px 8px;
    padding-bottom:6px;
    border-bottom:1px solid rgba(255,255,255,.06);
    font-size:11px;
    font-weight:700;
    letter-spacing:1px;
    text-transform:uppercase;
    color:#64748b;
}

.sidebar-logout{
    margin-top:auto;
}

/* Clientes: layout responsivo e melhor legibilidade */
.clients-layout {
    grid-template-columns:
        minmax(420px, 0.9fr)
        minmax(620px, 1.35fr);
    align-items: start;
}

.clients-list-panel {
    min-width: 0;
    overflow: hidden;
}

.clients-table-responsive {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
}

.clients-table {
    min-width: 920px;
    table-layout: auto;
}

.clients-table th,
.clients-table td {
    vertical-align: top;
}

.clients-table th:nth-child(1),
.clients-table td:nth-child(1) {
    min-width: 230px;
}

.clients-table th:nth-child(2),
.clients-table td:nth-child(2) {
    min-width: 190px;
}

.clients-table th:nth-child(3),
.clients-table td:nth-child(3) {
    min-width: 150px;
    white-space: nowrap;
}

.clients-table th:nth-child(4),
.clients-table td:nth-child(4) {
    min-width: 90px;
    white-space: nowrap;
}

.clients-table th:nth-child(5),
.clients-table td:nth-child(5) {
    min-width: 260px;
}

.clients-table .table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.clients-table .table-actions form {
    margin: 0;
}

.clients-table .button {
    white-space: nowrap;
}

@media (max-width: 1080px) {
    .clients-layout {
        grid-template-columns: 1fr;
    }

    .clients-layout > .panel,
    .clients-layout > form {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .clients-table {
        min-width: 820px;
    }

    .clients-table .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-table .button,
    .clients-table .table-actions form,
    .clients-table .table-actions button {
        width: 100%;
    }
}

/* Clientes: densidade visual compacta */
.clients-layout {
    grid-template-columns:
        minmax(360px, 0.78fr)
        minmax(560px, 1.22fr);
    gap: 16px;
}

.clients-layout > .panel,
.clients-layout > form {
    padding: 18px;
}

.clients-layout .form-section {
    margin-bottom: 16px;
}

.clients-layout .form-section-header {
    margin-bottom: 10px;
}

.clients-layout .form-section-header h2 {
    margin-bottom: 4px;
    font-size: 18px;
}

.clients-layout .form-section-header p,
.clients-list-panel .panel-header p {
    font-size: 12px;
}

.clients-layout .field-group label {
    margin-top: 8px;
    font-size: 12px;
}

.clients-layout input,
.clients-layout select {
    min-height: 38px;
    padding: 8px 10px;
}

.clients-layout textarea {
    min-height: 100px;
    padding: 9px 10px;
}

.clients-layout .form-actions {
    margin-top: 14px;
}

.clients-layout .form-actions button {
    min-height: 40px;
    padding: 9px 16px;
}

.clients-list-panel {
    padding: 18px;
}

.clients-list-panel .panel-header {
    margin-bottom: 12px;
}

.clients-list-panel .panel-header h2 {
    font-size: 20px;
}

.clients-table {
    min-width: 790px;
    font-size: 12px;
}

.clients-table th,
.clients-table td {
    padding: 10px 9px;
}

.clients-table th:nth-child(1),
.clients-table td:nth-child(1) {
    min-width: 190px;
}

.clients-table th:nth-child(2),
.clients-table td:nth-child(2) {
    min-width: 170px;
}

.clients-table th:nth-child(3),
.clients-table td:nth-child(3) {
    min-width: 125px;
}

.clients-table th:nth-child(4),
.clients-table td:nth-child(4) {
    min-width: 70px;
}

.clients-table th:nth-child(5),
.clients-table td:nth-child(5) {
    min-width: 210px;
}

.clients-table .button-small {
    padding: 7px 10px;
    font-size: 11px;
}

/* === CYSS GLOBAL UI DENSITY START === */

:root {
    font-size: 14px;
}

body {
    font-size: 14px;
    line-height: 1.45;
}

/* Main application structure */

.layout {
    grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
    padding: 20px 14px;
}

.brand {
    margin: 0 6px 18px;
    padding-bottom: 16px;
    font-size: 19px;
}

.brand::before {
    width: 8px;
    height: 8px;
    margin-right: 8px;
}

.sidebar a,
.link-button {
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 13px;
}

.menu-title {
    margin: 17px 8px 6px;
    padding-bottom: 5px;
    font-size: 10px;
}

/* Main content */

.content {
    width: 100%;
    padding: 22px 24px;
    overflow-x: hidden;
}

.content > * {
    width: 100%;
    max-width: 1580px;
    margin-left: auto;
    margin-right: auto;
}

.page-header {
    margin-bottom: 18px;
}

.page-header h1,
.content > h1 {
    margin-top: 0;
    margin-bottom: 7px;
    font-size: 27px;
    line-height: 1.2;
}

.page-header h2,
.content > h2 {
    font-size: 21px;
}

.page-header p {
    margin-top: 5px;
    color: #94a3b8;
    font-size: 13px;
}

.eyebrow {
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Panels and cards */

.login-card,
.panel {
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .20);
}

.panel {
    margin-bottom: 16px;
}

.panel-header {
    margin-bottom: 12px;
}

.panel-header h2,
.panel h2 {
    margin-bottom: 5px;
    font-size: 19px;
}

.panel-header h3,
.panel h3 {
    font-size: 16px;
}

.panel-header p,
.panel p {
    font-size: 13px;
    line-height: 1.5;
}

/* Forms */

.form-section {
    margin-bottom: 16px;
}

.form-section-header {
    margin-bottom: 10px;
}

.form-section-header h2 {
    margin-bottom: 4px;
    font-size: 18px;
}

.form-section-header p {
    margin-top: 0;
    font-size: 12px;
}

.form-grid {
    gap: 12px 14px;
}

label {
    margin: 9px 0 5px;
    font-size: 12px;
}

input,
select,
textarea {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13px;
}

textarea {
    min-height: 90px;
}

.form-actions {
    margin-top: 14px;
}

button,
.button {
    min-height: 36px;
    margin-top: 8px;
    padding: 8px 13px;
    border-radius: 7px;
    font-size: 12px;
}

.button-small {
    min-height: 31px;
    padding: 6px 9px;
    font-size: 11px;
}

/* Grids */

.grid-two {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.cards {
    gap: 13px;
    margin: 17px 0 20px;
}

.metric {
    min-height: 104px;
    padding: 16px;
    border-radius: 11px;
}

.metric strong {
    font-size: 27px;
}

.metric span {
    font-size: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stats-grid .panel {
    margin-bottom: 0;
}

/* Tables */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
}

table {
    border-radius: 10px;
    font-size: 12px;
}

th,
td {
    padding: 9px 10px;
}

th {
    font-size: 11px;
}

.table-muted {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.45;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.table-actions form {
    margin: 0;
}

.table-actions button,
.table-actions .button {
    margin: 0;
    white-space: nowrap;
}

/* Status and notices */

.status-badge,
.theme-badge {
    padding: 4px 7px;
    font-size: 10px;
}

.alert,
.notice {
    margin-bottom: 12px;
    padding: 10px 12px;
    font-size: 12px;
}

/* Client page */

.clients-layout {
    grid-template-columns:
        minmax(340px, .82fr)
        minmax(560px, 1.18fr);
    gap: 16px;
}

.clients-layout > .panel,
.clients-layout > form {
    padding: 18px;
}

.clients-table {
    min-width: 760px;
    font-size: 11px;
}

.clients-table th,
.clients-table td {
    padding: 8px;
}

.clients-table th:nth-child(1),
.clients-table td:nth-child(1) {
    min-width: 180px;
}

.clients-table th:nth-child(2),
.clients-table td:nth-child(2) {
    min-width: 155px;
}

.clients-table th:nth-child(3),
.clients-table td:nth-child(3) {
    min-width: 115px;
}

.clients-table th:nth-child(4),
.clients-table td:nth-child(4) {
    min-width: 65px;
}

.clients-table th:nth-child(5),
.clients-table td:nth-child(5) {
    min-width: 195px;
}

/* Campaign wizard */

.wizard-step {
    padding: 18px;
}

.wizard-step__header {
    margin-bottom: 14px;
}

.wizard-step__number {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 12px;
}

.wizard-step__title {
    font-size: 17px;
}

.wizard-step__description {
    font-size: 12px;
}

.scenario-card {
    min-height: 92px;
    padding: 14px;
}

.recipient-toolbar {
    padding: 10px 12px;
}

#recipient_ids {
    min-height: 190px;
}

/* Responsive behavior */

@media (max-width: 1250px) {
    .clients-layout {
        grid-template-columns:
            minmax(320px, .78fr)
            minmax(500px, 1.22fr);
    }

    .content {
        padding: 20px;
    }
}

@media (max-width: 1050px) {
    .clients-layout,
    .grid-two {
        grid-template-columns: 1fr;
    }

    .scenario-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 14px;
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 4px;
    }

    .menu-title {
        grid-column: 1 / -1;
    }

    .content {
        padding: 18px;
    }
}

@media (max-width: 650px) {
    .content,
    .public-content {
        padding: 12px;
    }

    .sidebar-nav,
    .cards,
    .stats-grid,
    .campaign-grid,
    .scenario-summary {
        grid-template-columns: 1fr;
    }

    .panel,
    .login-card,
    .wizard-step {
        padding: 14px;
    }

    .page-header h1,
    .content > h1 {
        font-size: 23px;
    }

    th,
    td {
        padding: 8px;
    }
}

/* === CYSS GLOBAL UI DENSITY END === */

/* === CLIENTES VERTICAL START === */

.clients-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.clients-form-panel,
.clients-list-panel--full {
    width: 100%;
    max-width: none;
}

.clients-form-panel .form-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.clients-list-panel--full {
    overflow: hidden;
}

.clients-list-panel--full .clients-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.clients-list-panel--full .clients-table {
    width: 100%;
    min-width: 900px;
}

@media (max-width: 760px) {
    .clients-form-panel .form-grid-two {
        grid-template-columns: 1fr;
    }
}

/* === CLIENTES VERTICAL END === */
