@font-face {
    font-family: "Google Sans";
    font-style: normal;
    font-weight: 400;
    src: url("https://fonts.gstatic.com/s/googlesans/v14/4UaGrENHsxJLGL433smCOPrdFA.woff2") format("woff2");
}
@font-face {
    font-family: "Google Sans";
    font-style: normal;
    font-weight: 700;
    src: url("https://fonts.gstatic.com/s/googlesans/v14/4UabrENHsxJLGL433smCOFLLMPFmLkA.woff2") format("woff2");
}

:root {
    --purple: #26256A;
    --purple-dark: #26256A;
    --purple-mid: #35347B;
    --purple-soft: #F0EDF7;
    --purple-focus: #F6F2FF;
    --orange: #E85119;
    --orange-dark: #C53E0D;
    --orange-soft: #FFEEE6;
    --orange-light: #FFEEE6;
    --bg: #f5f4f9;
    --bg-card: #ffffff;
    --ink: #1e1333;
    --ink-soft: #5a5070;
    --ink-muted: #9990b0;
    --border: #e2dff0;
    --radius: 10px;
    --shadow: 0 2px 16px rgba(38, 37, 106, 0.08);
    --shadow-lg: 0 8px 40px rgba(38, 37, 106, 0.18);
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: "Google Sans", "Product Sans", "Nunito", sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
}
.shell {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 268px;
    min-width: 268px;
    background: var(--purple-dark);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
}
.sidebar-logo-img {
    width: 168px;
    display: block;
    mix-blend-mode: screen;
}
.sidebar-sub {
    font-size: 9.5px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 10px;
}
.sidebar-version {
    font-size: 9.5px;
    color: rgba(255, 255, 255, 0.25);
    font-weight: 500;
    letter-spacing: 1px;
    margin-top: 4px;
}
.sidebar-progress {
    padding: 14px 20px 6px;
}
.progress-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 7px;
}
.progress-bar-bg {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--orange);
    border-radius: 99px;
    transition: width 0.4s ease;
    width: 0%;
}
.progress-text {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 5px;
}
.nav-list {
    list-style: none;
    padding: 10px;
    flex: 1;
}
.nav-item {
    margin-bottom: 1px;
}
.nav-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-family: "Google Sans", "Product Sans", "Nunito", sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    text-align: left;
    transition:
        background 0.15s,
        color 0.15s;
}
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.nav-btn.active {
    background: rgba(233, 81, 24, 0.22);
    color: #ffb08a;
    font-weight: 700;
}
.nav-icon {
    width: 18px;
    text-align: center;
    font-size: 13px;
    flex-shrink: 0;
}
.nav-check {
    margin-left: auto;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    flex-shrink: 0;
    transition: all 0.2s;
}
.nav-check.done {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}
.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-action {
    width: 100%;
    justify-content: center;
}
.sidebar-action-muted {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.72);
}
.sidebar-action-muted:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
    color: #fff;
}
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 13px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-section {
    font-family: "Google Sans", "Product Sans", "Poppins", sans-serif;
    font-size: 17px;
    color: var(--purple);
    font-weight: 700;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}
.storage-status {
    color: var(--ink-muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.storage-status.error {
    color: var(--orange);
}
.btn {
    font-family: "Google Sans", "Product Sans", "Nunito", sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 15px;
    border-radius: 7px;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-outline {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--ink-soft);
}
.btn-outline:hover {
    border-color: var(--purple);
    color: var(--purple);
}
.btn-primary {
    background: var(--purple);
    color: #fff;
}
.btn-primary:hover {
    background: var(--purple-dark);
}
.btn-orange {
    background: var(--orange);
    color: #fff;
}
.btn-orange:hover {
    background: var(--orange-dark);
}
.btn-sm {
    font-size: 12px;
    padding: 6px 12px;
}
.btn-icon {
    background: none;
    border: none;
    color: var(--ink-muted);
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 15px;
    transition: color 0.15s;
}
.btn-icon:hover {
    color: var(--orange);
}
.btn-loading {
    opacity: 0.7;
    cursor: wait !important;
}
.admin-only {
    display: none !important;
}
body.admin-mode .admin-only {
    display: inline-flex !important;
}
.section-locked td input,
.section-locked td select,
.section-locked td textarea {
    color: var(--ink-soft);
    cursor: not-allowed;
}
.section-locked .table-footer .btn,
.section-locked .actions .btn-icon {
    opacity: 0.55;
    cursor: not-allowed;
}
.content {
    flex: 1;
    padding: 30px 34px 60px;
    width: 100%;
    max-width: none;
}
.section-panel {
    display: none;
}
.section-panel.active {
    display: block;
}
.panel-header {
    margin-bottom: 22px;
}
.panel-title {
    font-family: "Google Sans", "Product Sans", "Poppins", sans-serif;
    font-size: 24px;
    color: var(--purple);
    font-weight: 700;
    line-height: 1.2;
}
.panel-desc {
    color: var(--ink-soft);
    font-size: 13.5px;
    margin-top: 5px;
    line-height: 1.6;
    max-width: 640px;
}
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}
table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}
thead tr {
    background: var(--purple-soft);
}
th {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--purple-mid);
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 0;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tr:last-child td {
    border-bottom: none;
}
tr:hover td {
    background: #fbf9ff;
}
td input,
td select,
td textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-family: "Google Sans", "Product Sans", "Nunito", sans-serif;
    font-size: 13px;
    color: var(--ink);
    padding: 9px 12px;
    outline: none;
    transition: background 0.1s;
    resize: none;
}
td input:focus,
td select:focus,
td textarea:focus {
    background: var(--purple-focus);
    box-shadow: inset 0 0 0 2px var(--purple-mid);
}
td.actions {
    width: 36px;
    text-align: center;
    padding: 3px;
}
td select {
    cursor: pointer;
}
td input::placeholder,
td textarea::placeholder {
    color: var(--ink-muted);
    font-style: italic;
}
.table-footer {
    padding: 9px 12px;
    background: #fbf9ff;
    border-top: 1px solid var(--border);
}
.sub-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--purple-mid);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sub-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.nav-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 19, 51, 0.6);
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open {
    display: flex;
}
.modal {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 30px;
    max-width: 560px;
    width: 92%;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.2s ease;
}
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.modal-title {
    font-family: "Google Sans", "Product Sans", "Poppins", sans-serif;
    font-size: 20px;
    color: var(--purple);
    font-weight: 700;
    margin-bottom: 8px;
}
.modal-desc {
    color: var(--ink-soft);
    font-size: 13.5px;
    line-height: 1.6;
    margin-bottom: 18px;
}
.modal-actions {
    display: flex;
    gap: 9px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.client-access-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-family: "Nunito", sans-serif;
    font-size: 14px;
    padding: 11px 13px;
    margin-bottom: 14px;
}
.client-access-input:focus {
    outline: none;
    border-color: var(--purple-mid);
    box-shadow: 0 0 0 3px rgba(75, 53, 128, 0.12);
}
.client-access-input::placeholder {
    color: var(--ink-muted);
}
#clientAccessError.error {
    color: var(--orange-dark);
    font-weight: 600;
}
pre.json-output {
    background: var(--purple-soft);
    border-radius: 8px;
    padding: 14px;
    font-size: 11px;
    font-family: "Courier New", monospace;
    max-height: 240px;
    overflow-y: auto;
    color: var(--ink-soft);
    margin-bottom: 16px;
    border: 1px solid var(--border);
}
@media print {
    .sidebar,
    .topbar,
    .nav-actions,
    .table-footer,
    .modal-overlay,
    .btn {
        display: none !important;
    }
    .shell {
        display: block;
    }
    .main {
        display: block;
    }
    .content {
        padding: 0;
        max-width: 100%;
    }
    .section-panel {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 24px;
    }
    .panel-title {
        color: var(--purple) !important;
    }
    .print-header {
        display: flex !important;
    }
    body {
        background: #fff;
    }
    table {
        font-size: 11px;
    }
    th {
        background: var(--purple-soft) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .sub-label {
        color: var(--purple-mid) !important;
    }
}
.print-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    margin-bottom: 24px;
    border-bottom: 3px solid var(--purple);
}
.print-header img {
    width: 120px;
    mix-blend-mode: multiply;
}
.print-header-text {
    text-align: right;
    font-size: 11px;
    color: #5a5070;
}
.panel-finish {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.finish-status {
    color: var(--orange);
    font-size: 13px;
    font-weight: 700;
}
.finish-status.done {
    color: #2a9d3a;
}
.btn-finish {
    background: var(--orange);
    color: #fff;
}
.btn-finish:hover {
    background: var(--orange-dark);
}
@media (max-width: 1024px) {
    .shell {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        position: static;
        overflow: visible;
    }
    .sidebar-header {
        padding: 18px 18px 12px;
    }
    .sidebar-logo-img {
        width: 136px;
    }
    .sidebar-progress {
        padding: 12px 18px;
    }
    .nav-list {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding: 10px 14px 14px;
        scrollbar-width: thin;
    }
    .nav-item {
        flex: 0 0 auto;
        margin-bottom: 0;
    }
    .nav-btn {
        width: auto;
        min-width: 160px;
        padding: 9px 11px;
    }
    .sidebar-footer {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px 14px;
    }
    .topbar {
        padding: 12px 18px;
    }
    .content {
        padding: 24px 18px 44px;
        max-width: none;
    }
}
@media (max-width: 640px) {
    .sidebar-sub,
    .progress-label {
        font-size: 9px;
    }
    .nav-btn {
        min-width: 142px;
        font-size: 12px;
    }
    .sidebar-footer {
        grid-template-columns: 1fr;
    }
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .storage-status {
        width: 100%;
        white-space: normal;
    }
    .topbar-actions .btn {
        flex: 1 1 130px;
        justify-content: center;
    }
    .content {
        padding: 22px 14px 36px;
    }
    .panel-title {
        font-size: 22px;
    }
    .panel-desc {
        font-size: 13px;
    }
    .table-wrap {
        overflow: visible;
    }
    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        width: 100%;
        min-width: 0;
    }
    thead {
        display: none;
    }
    tbody {
        padding: 10px;
    }
    tr {
        border: 1px solid var(--border);
        border-radius: 9px;
        background: #fff;
        margin-bottom: 10px;
        overflow: hidden;
    }
    tr:last-child {
        margin-bottom: 0;
    }
    td {
        border-bottom: 1px solid var(--border);
        padding: 0;
    }
    td::before {
        content: attr(data-label);
        display: block;
        padding: 9px 12px 0;
        color: var(--purple-mid);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.6px;
        text-transform: uppercase;
    }
    td.actions {
        width: 100%;
        text-align: right;
        padding: 8px 10px;
        border-bottom: none;
    }
    td.actions::before {
        content: none;
    }
    td input,
    td select,
    td textarea {
        padding: 7px 12px 10px;
    }
    .table-footer {
        padding: 10px;
    }
    .table-footer .btn,
    .nav-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .nav-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }
    .modal {
        padding: 22px;
    }
    .modal-actions .btn {
        flex: 1 1 100%;
        justify-content: center;
    }
    .panel-finish {
        flex-direction: column;
        align-items: stretch;
    }
    .panel-finish .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Bloco de notificações (seleção múltipla) */
.notif-block {
    padding: 4px 0 8px;
}
.notif-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 16px;
}

.users-multiselect-container,
.perfis-multiselect-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 38px;
    padding: 6px 12px;
    background: #fff;
    border-radius: 4px;
}
.users-tags-container,
.perfis-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.user-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--purple-soft);
    color: var(--purple-mid);
    font-size: 11.5px;
    font-weight: 700;
}
.remove-tag,
.remove-perf-tag {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.remove-tag:hover,
.remove-perf-tag:hover {
    color: var(--orange-dark);
}
.smtp-config-block {
    margin-bottom: 24px;
}
.smtp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}
.smtp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.smtp-label {
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
}
.smtp-input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}
.smtp-input:focus {
    outline: none;
    border-color: var(--purple-mid);
}
.password-wrapper {
    position: relative;
}
.password-wrapper .smtp-input {
    width: 100%;
    padding-right: 40px;
}
.btn-toggle-password {
    position: absolute;
    top: 50%;
    right: 8px;
    display: flex;
    padding: 6px;
    border: 0;
    background: none;
    color: var(--ink-soft);
    cursor: pointer;
    transform: translateY(-50%);
}
.btn-toggle-password:hover {
    color: var(--purple);
}
@media (max-width: 768px) {
    .smtp-grid {
        grid-template-columns: 1fr;
    }
}
.notif-option {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
}
.notif-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--purple);
}
.notif-other input[type="text"] {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}
.notif-other input[type="text"]:focus {
    outline: none;
    border-color: var(--purple-mid);
}
