* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    font-family: Inter, system-ui, sans-serif;
    background: #111318;
    color: #e8eaf0;
}

button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.tm-studio {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.studio-topbar {
    height: 64px;
    flex-shrink: 0;

    display: flex;
    align-items: center;

    padding: 0 18px;

    background: #181a20;
    border-bottom: 1px solid #292c34;
}

.studio-brand {
    width: 220px;

    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background: #e91e63;
    color: white;

    font-weight: 800;
}

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

.studio-brand small {
    margin-top: 2px;
    color: #858b98;
    font-size: 11px;
}

.studio-document {
    flex: 1;
    text-align: center;
}

.studio-document strong,
.studio-document small {
    display: block;
}

.studio-document small {
    color: #777d89;
    font-size: 11px;
}

.studio-actions {
    width: 300px;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}


/* =========================================================
   TM STUDIO — BALÃO DO HISTÓRICO
   ========================================================= */

.studio-actions {
    position: relative;
}


.history-anchor {
    position: relative;
    display: flex;
    align-items: center;
}

.history-panel {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;

    width: 300px;
    max-height: 360px;

    background: #181a20;
    border: 1px solid #30343e;
    border-radius: 8px;

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);

    z-index: 1000;

    overflow: hidden;
}

.history-panel[hidden] {
    display: none;
}

.history-list {
    max-height: 310px;
    overflow-y: auto;
    overflow-x: hidden;
}


.history-panel[hidden] {
    display: none;
}


.history-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 12px;

    border-bottom: 1px solid #30343e;

    background: #20232b;
}


.history-panel-header strong {
    color: #f0f1f4;
    font-size: 13px;
}


.history-panel-header button {
    width: 26px;
    height: 26px;

    padding: 0;

    border: 0;
    border-radius: 5px;

    background: transparent;
    color: #aeb4bf;

    font-size: 18px;
    line-height: 1;

    cursor: pointer;
}


.history-panel-header button:hover {
    background: #30343e;
    color: #ffffff;
}


.history-list {
    max-height: 310px;

    overflow-y: auto;
    overflow-x: hidden;
}


.history-empty {
    padding: 18px 14px;

    color: #858b97;

    font-size: 12px;
    text-align: center;
}

.studio-actions button,
.workspace-toolbar button,
.inspector-header button,
.tree-title button,
.sidebar-header button,
.studio-statusbar button {
    padding: 7px 11px;

    background: #242730;
    color: #dfe2e8;

    border-radius: 6px;
}

.studio-actions button:hover,
.workspace-toolbar button:hover,
.inspector-header button:hover {
    background: #30343e;
}

.studio-actions .primary {
    background: #e91e63;
    color: white;
}

.save-status {
    font-size: 12px;
    color: #79d39b;
    margin: 0 8px;
}


/* =========================================================
   CORPO
   ========================================================= */

.studio-body {
    flex: 1;
    min-height: 0;

    display: grid;

    grid-template-columns:
        260px
        minmax(400px, 1fr)
        300px;
}


/* =========================================================
   SIDEBARS
   ========================================================= */

.studio-sidebar {
    min-height: 0;
    overflow: auto;

    background: #17191f;
}

.left-sidebar {
    border-right: 1px solid #292c34;
}

.right-sidebar {
    border-left: 1px solid #292c34;
}


/* =========================================================
   ESTRUTURA
   ========================================================= */

.sidebar-header,
.inspector-header {
    height: 52px;

    padding: 0 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #292c34;
}

.tree-section {
    border-bottom: 1px solid #292c34;
}

.tree-title {
    min-height: 38px;

    padding: 0 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    color: #777d89;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
}

.tree-title button,
.sidebar-header button {
    padding: 2px 7px;
    font-size: 16px;
}

.tree {
    padding: 5px 7px 10px;
}

.tree-empty {
    padding: 15px 8px;

    color: #666c78;

    font-size: 12px;
    text-align: center;
}


/* =========================================================
   WORKSPACE
   ========================================================= */

.studio-workspace {
    min-width: 0;
    min-height: 0;

    display: flex;
    flex-direction: column;

    background: #0f1115;
}

.workspace-toolbar {
    height: 52px;
    flex-shrink: 0;

    padding: 0 14px;

    display: flex;
    align-items: center;
    gap: 12px;

    border-bottom: 1px solid #292c34;
}

.workspace-toolbar > div:first-child {
    flex: 1;
}

.workspace-toolbar span,
.workspace-toolbar strong {
    display: block;
}

.workspace-toolbar span {
    color: #777d89;
    font-size: 9px;
    letter-spacing: .08em;
}

.workspace-toolbar strong {
    font-size: 13px;
}

.device-selector {
    display: flex;
    gap: 3px;
}

.device-selector button.active {
    background: #e91e63;
    color: white;
}


/* =========================================================
   CANVAS
   ========================================================= */

.canvas {
    flex: 1;
    min-height: 0;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    padding: 30px;

    overflow: auto;

    background:
        linear-gradient(
            45deg,
            #15171c 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #15171c 25%,
            transparent 25%
        ),
        #111318;

    background-size: 20px 20px;
}

.preview-device {
    width: 100%;
    min-height: 600px;

    background: white;

    box-shadow:
        0 15px 50px rgba(0,0,0,.45);

    transition:
        width .2s ease;
}

.preview-device.tablet {
    width: 768px;
}

.preview-device.mobile {
    width: 390px;
}

.preview-content {
    min-height: 600px;
    color: #222;
}

.preview-iframe {
    display: block;
    width: 100%;
    min-height: 600px;
    height: 100%;
    border: 0;
    background: white;
}

.preview-empty {
    min-height: 600px;

    display: grid;
    place-items: center;
    align-content: center;

    text-align: center;
}

.preview-icon {
    width: 60px;
    height: 60px;

    display: grid;
    place-items: center;

    border-radius: 14px;

    background: #e91e63;
    color: white;

    font-weight: 800;
}


/* =========================================================
   INSPECTOR
   ========================================================= */

.inspector-tabs {
    height: 42px;

    display: flex;

    border-bottom: 1px solid #292c34;
}

.inspector-tabs button {
    flex: 1;

    background: transparent;
    color: #777d89;

    border-bottom: 2px solid transparent;
}

.inspector-tabs button.active {
    color: white;
    border-bottom-color: #e91e63;
}

.inspector-content {
    padding: 18px;
}

.inspector-empty {
    min-height: 180px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 7px;

    color: #737985;

    text-align: center;

    font-size: 12px;
}

.inspector-empty strong {
    color: #cdd1d9;
}


/* =========================================================
   STATUS BAR
   ========================================================= */

.studio-statusbar {
    height: 28px;
    flex-shrink: 0;

    padding: 0 12px;

    display: flex;
    align-items: center;
    gap: 15px;

    background: #15171c;
    border-top: 1px solid #292c34;

    color: #777d89;

    font-size: 10px;
}

.studio-statusbar span:first-child {
    flex: 1;
}

.studio-statusbar button {
    padding: 2px 7px;
    background: transparent;
    color: #9ca1ac;
}


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

@media (max-width: 1000px) {

    .studio-body {
        grid-template-columns:
            220px
            minmax(300px, 1fr);
    }

    .right-sidebar {
        display: none;
    }

}

@media (max-width: 700px) {

    .studio-body {
        grid-template-columns: 1fr;
    }

    .left-sidebar {
        display: none;
    }

    .studio-brand {
        width: auto;
    }

    .studio-document {
        display: none;
    }

    .studio-actions {
        width: auto;
        margin-left: auto;
    }

}


/* =========================================================
   TM STUDIO — ELEMENTOS DINÂMICOS
   ========================================================= */

.tree-item {
    padding: 9px 10px;
    margin: 2px 0;

    border-radius: 6px;

    cursor: pointer;

    color: #cfd3dc;
}

.tree-item:hover {
    background: #22252d;
}

.tree-item.active {
    background: #2b2e37;
    box-shadow: inset 3px 0 0 #e91e63;
}

.tree-item strong,
.tree-item small {
    display: block;
}

.tree-item strong {
    font-size: 12px;
}

.tree-item small {
    margin-top: 3px;
    color: #737985;
    font-size: 10px;
}


/* =========================================================
   PREVIEW
   ========================================================= */

.preview-section {
    padding: 50px 60px;
    border-bottom: 1px solid #e5e5e5;
}

.preview-section:last-child {
    border-bottom: 0;
}

.preview-block {
    margin: 0 0 20px;
}

.preview-block h1 {
    margin: 0;
    font-size: 42px;
    line-height: 1.1;
}

.preview-block p {
    margin: 8px 0;
    font-size: 18px;
    line-height: 1.6;
}


/* =========================================================
   INSPECTOR
   ========================================================= */

.inspector-group {
    margin-bottom: 20px;
}

.inspector-group label {
    display: block;
    margin-bottom: 7px;

    color: #858b98;

    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.inspector-value {
    padding: 10px;

    border-radius: 6px;

    background: #20232a;
    color: #dfe2e8;

    font-size: 13px;
}

.inspector-textarea {
    width: 100%;
    min-height: 140px;

    resize: vertical;

    padding: 10px;

    border: 1px solid #30343d;
    border-radius: 6px;

    outline: none;

    background: #111318;
    color: #e8eaf0;

    font: inherit;
    font-size: 13px;
}

.inspector-textarea:focus {
    border-color: #e91e63;
}


/* =========================================================
   ESTADO
   ========================================================= */

.save-status.dirty {
    color: #f0bd65;
}


/* =========================================================
   SELECÇÃO NO CANVAS
   ========================================================= */

.preview-block {
    position: relative;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 8px;
    transition:
        border-color .15s ease,
        background .15s ease;
}

.preview-block:hover {
    border-color: #c7cbd3;
    background: rgba(233, 30, 99, .025);
}

.preview-block.selected {
    border-color: #e91e63;
    background: rgba(233, 30, 99, .045);
}

.preview-block.selected::before {
    content: 'Bloco';

    position: absolute;
    top: -22px;
    left: -1px;

    padding: 3px 7px;

    border-radius: 4px 4px 0 0;

    background: #e91e63;
    color: white;

    font-size: 9px;
    font-weight: 700;
}

.preview-section {
    position: relative;
}

.preview-section.selected {
    outline: 1px dashed #9ca1ac;
    outline-offset: -1px;
}


/* =========================================================
   ELEMENTOS GERADOS PELO NÚCLEO VISUAL
   ========================================================= */

.tree-item {
    padding: 9px 10px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease;
}

.tree-item:hover {
    background: #22252d;
}

.tree-item.active {
    background: #2a2d36;
    box-shadow: inset 3px 0 0 #e91e63;
}

.tree-item-main strong,
.tree-item-main small {
    display: block;
}

.tree-item-main strong {
    color: #dfe2e8;
    font-size: 12px;
}

.tree-item-main small {
    margin-top: 3px;
    color: #737985;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   INSPECTOR
   ========================================================= */

.inspector-group {
    margin-bottom: 22px;
}

.inspector-group > label,
.inspector-label {
    display: block;
    margin-bottom: 8px;

    color: #777d89;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
}

.inspector-group > strong {
    font-size: 14px;
    color: #e8eaf0;
}

.inspector-editor {
    width: 100%;
    min-height: 120px;

    padding: 10px;

    resize: vertical;

    border: 1px solid #343843;
    border-radius: 6px;

    outline: none;

    background: #111318;
    color: #e8eaf0;

    font: inherit;
    font-size: 12px;
}

.inspector-editor:focus {
    border-color: #e91e63;
}


/* =========================================================
   PREVIEW
   ========================================================= */

.preview-section {
    position: relative;

    padding: 50px 40px;

    border-bottom: 1px solid #eeeeee;

    transition:
        outline .15s ease,
        background .15s ease;
}

.preview-section:hover {
    background: #fafafa;
}

.preview-block {
    margin: 0 0 16px;

    padding: 8px;

    border: 1px solid transparent;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background .15s ease;
}

.preview-block:hover {
    border-color: #dddddd;
    background: #f8f8f8;
}

.preview-block.selected {
    border-color: #e91e63;
    background: #fff4f8;
}

.preview-block:last-child {
    margin-bottom: 0;
}

.preview-section h1.preview-block {
    font-size: 36px;
    line-height: 1.15;
}

.preview-section p.preview-block {
    font-size: 18px;
    line-height: 1.6;
}

/* =========================================================
   JANELA DE DEFINIÇÕES
   ========================================================= */

.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background: rgba(0, 0, 0, .65);

    backdrop-filter: blur(3px);
}


/* ---------------------------------------------------------
   JANELA
   --------------------------------------------------------- */

.settings-window {
    width: min(620px, 100%);
    max-height: calc(100vh - 60px);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #181a20;
    color: #e8eaf0;

    border: 1px solid #30343e;
    border-radius: 10px;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, .55);
}


/* ---------------------------------------------------------
   CABEÇALHO
   --------------------------------------------------------- */

.settings-header {
    min-height: 64px;

    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #292c34;
}

.settings-header strong,
.settings-header small {
    display: block;
}

.settings-header strong {
    font-size: 15px;
}

.settings-header small {
    margin-top: 3px;

    color: #777d89;
    font-size: 11px;
}


.settings-header button {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    padding: 0;

    background: #242730;
    color: #dfe2e8;

    border-radius: 6px;

    font-size: 22px;
    line-height: 1;
}

.settings-header button:hover {
    background: #30343e;
}


/* ---------------------------------------------------------
   CORPO
   --------------------------------------------------------- */

.settings-body {
    flex: 1;
    min-height: 0;

    overflow-y: auto;

    padding: 22px;
}


/* ---------------------------------------------------------
   SECÇÕES
   --------------------------------------------------------- */

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.settings-section-title {
    padding-bottom: 9px;

    border-bottom: 1px solid #292c34;

    color: #9ca1ac;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: .08em;
    text-transform: uppercase;
}


/* ---------------------------------------------------------
   CAMPOS
   --------------------------------------------------------- */

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.settings-field label {
    color: #cdd1d9;

    font-size: 12px;
    font-weight: 600;
}


.settings-field input,
.settings-field textarea {
    width: 100%;

    padding: 10px 11px;

    border: 1px solid #30343e;
    border-radius: 6px;

    outline: none;

    background: #111318;
    color: #e8eaf0;

    font: inherit;
    font-size: 12px;
}


.settings-field input::placeholder,
.settings-field textarea::placeholder {
    color: #5f6570;
}


.settings-field input:focus,
.settings-field textarea:focus {
    border-color: #e91e63;

    box-shadow:
        0 0 0 2px rgba(233, 30, 99, .12);
}


.settings-field textarea {
    resize: vertical;
    min-height: 100px;
}


/* ---------------------------------------------------------
   RODAPÉ
   --------------------------------------------------------- */

.settings-footer {
    min-height: 64px;

    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 8px;

    border-top: 1px solid #292c34;
}


.settings-footer button {
    padding: 8px 13px;

    background: #242730;
    color: #dfe2e8;

    border-radius: 6px;

    font-size: 12px;
}


.settings-footer button:hover {
    background: #30343e;
}


.settings-footer button.primary {
    background: #e91e63;
    color: white;
}


.settings-footer button.primary:hover {
    background: #d81b5b;
}


/* ---------------------------------------------------------
   ESTADO OCULTO
   --------------------------------------------------------- */

.settings-overlay[hidden] {
    display: none;
}


/* ---------------------------------------------------------
   RESPONSIVO
   --------------------------------------------------------- */

@media (max-width: 700px) {

    .settings-overlay {
        padding: 15px;
    }

    .settings-window {
        max-height: calc(100vh - 30px);
    }

    .settings-body {
        padding: 18px;
    }

    .settings-footer {
        padding: 0 14px;
    }

}


/* =========================================================
   AUTENTICAÇÃO TM STUDIO
   ========================================================= */

.tm-studio-login {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #0f1115;
}

.tm-studio-login[hidden] {
    display: none;
}

.login-card {
    width: min(420px, calc(100vw - 40px));

    padding: 30px;

    background: #181a20;
    border: 1px solid #292c34;
    border-radius: 10px;

    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 25px;
}

.login-brand small {
    display: block;
    margin-top: 3px;
    color: #777d89;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.login-description {
    margin: 0 0 25px;
    color: #9298a3;
}

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    margin-bottom: 6px;

    color: #bfc3cb;
    font-size: 12px;
}

.login-field input {
    width: 100%;
    box-sizing: border-box;

    padding: 11px 12px;

    background: #0f1115;
    color: #f0f1f4;

    border: 1px solid #30343e;
    border-radius: 6px;

    outline: none;
}

.login-field input:focus {
    border-color: #e91e63;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;

    margin: 4px 0 18px;

    color: #bfc3cb;
    font-size: 12px;
}

.login-error {
    margin-bottom: 14px;

    padding: 10px 12px;

    background: #fee;
    color: #a00;

    border: 1px solid #e7baba;
    border-radius: 6px;

    font-size: 12px;
}

.login-submit {
    width: 100%;
    padding: 11px 14px;
}

.login-submit:disabled {
    opacity: .6;
    cursor: wait;
}


/* =========================================================
   TM STUDIO — MOBILE APP MODE
   ========================================================= */

@media (max-width: 700px) {

    html,
    body {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .tm-studio {
        height: 100dvh;
        min-height: 100dvh;
        background: #111318;
    }

    /* -----------------------------------------------------
       TOPO
       ----------------------------------------------------- */

    .studio-topbar {
        height: 56px;
        padding: 0 12px;
        flex-shrink: 0;
    }

    .studio-brand {
        width: auto;
        gap: 8px;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .studio-brand strong {
        font-size: 14px;
    }

    .studio-brand small {
        font-size: 9px;
    }

    .studio-document {
        display: none;
    }

    .studio-actions {
        width: auto;
        margin-left: auto;
        gap: 5px;
    }

    .studio-actions button {
        min-width: 38px;
        min-height: 38px;
        padding: 7px;
    }

    .studio-actions .save-status {
        display: none;
    }


    /* -----------------------------------------------------
       CORPO MOBILE
       ----------------------------------------------------- */

    .studio-body {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: calc(100dvh - 56px - 44px);
        min-height: 0;
    }


    /* -----------------------------------------------------
       SIDEBAR ESQUERDA
       ----------------------------------------------------- */

    .left-sidebar {
        display: block;
        width: 100%;
        height: auto;
        max-height: 42%;
        flex-shrink: 0;

        border-right: 0;
        border-bottom: 1px solid #292c34;

        overflow-y: auto;
    }


    /* -----------------------------------------------------
       WORKSPACE
       ----------------------------------------------------- */

    .studio-workspace {
        flex: 1;
        width: 100%;
        min-height: 0;
    }

    .workspace-toolbar {
        height: 46px;
        padding: 0 10px;
    }

    .workspace-toolbar strong {
        font-size: 12px;
    }

    .device-selector {
        display: none;
    }

    .canvas {
        padding: 10px;
        align-items: flex-start;
    }

    .preview-device,
    .preview-device.tablet,
    .preview-device.mobile {
        width: 100%;
        min-height: 100%;
        box-shadow: none;
    }

    .preview-content,
    .preview-iframe {
        min-height: 100%;
    }


    /* -----------------------------------------------------
       INSPECTOR
       ----------------------------------------------------- */

    .right-sidebar {
        display: none;
    }


    /* -----------------------------------------------------
       BARRA INFERIOR
       ----------------------------------------------------- */

    .studio-statusbar {
        height: 44px;
        flex-shrink: 0;
        padding: 0 8px;
        gap: 4px;
    }

    .studio-statusbar span:first-child {
        display: none;
    }

    .studio-statusbar button {
        flex: 1;
        min-height: 36px;
        border-radius: 8px;
        background: #242730;
    }

}

/* =========================================================
   TM STUDIO — PAINEL DE AUTOMATISMOS
   ========================================================= */

.automation-anchor {
    position: relative;
    display: flex;
    align-items: center;
}

.automation-panel {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;

    width: 720px;
    max-width: calc(100vw - 30px);
    max-height: 600px;

    background: #181a20;
    border: 1px solid #30343e;
    border-radius: 8px;

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);

    z-index: 1000;

    overflow: hidden;
}

.automation-panel[hidden] {
    display: none;
}

.automation-window {
    width: 100%;
    max-height: 600px;

    display: flex;
    flex-direction: column;
}

.automation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 12px;

    border-bottom: 1px solid #30343e;
    background: #20232b;
}

.automation-header strong {
    color: #f0f1f4;
    font-size: 13px;
}

.automation-header small {
    display: block;

    margin-top: 2px;

    color: #8f96a3;
    font-size: 11px;
}

.automation-header button {
    width: 26px;
    height: 26px;

    padding: 0;

    border: 0;
    border-radius: 5px;

    background: transparent;
    color: #aeb4bf;

    font-size: 18px;
    line-height: 1;

    cursor: pointer;
}

.automation-header button:hover {
    background: #30343e;
    color: #ffffff;
}

.automation-body {
    display: flex;

    min-height: 380px;
    max-height: 500px;

    overflow: hidden;
}

.automation-flows {
    width: 210px;
    min-width: 210px;

    border-right: 1px solid #30343e;

    overflow-y: auto;
}

.automation-content {
    flex: 1;

    min-width: 0;

    overflow-y: auto;
}

.automation-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 8px 12px;

    border-top: 1px solid #30343e;

    background: #20232b;

    color: #8f96a3;
    font-size: 11px;
}


/* =========================================================
   TM STUDIO — BALÃO DE AUTOMATISMOS
   ========================================================= */

.automation-anchor {
    position: relative;
    display: flex;
    align-items: center;
}

.automation-panel {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;

    width: 720px;
    max-height: 520px;

    background: #181a20;
    border: 1px solid #30343e;
    border-radius: 8px;

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);

    z-index: 1000;

    overflow: hidden;
}

.automation-panel[hidden] {
    display: none;
}

.automation-window {
    display: flex;
    flex-direction: column;

    width: 100%;
    max-height: 520px;
}

.automation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 12px;

    background: #20232b;
    border-bottom: 1px solid #30343e;
}

.automation-header strong {
    display: block;
    color: #f0f1f4;
    font-size: 13px;
}

.automation-header small {
    display: block;
    margin-top: 2px;
    color: #8f96a3;
    font-size: 11px;
}

.automation-header button {
    width: 26px;
    height: 26px;

    padding: 0;

    border: 0;
    border-radius: 5px;

    background: transparent;
    color: #aeb4bf;

    font-size: 18px;
    line-height: 1;

    cursor: pointer;
}

.automation-header button:hover {
    background: #30343e;
    color: #ffffff;
}

.automation-body {
    display: flex;

    min-height: 360px;
    max-height: 430px;
}

.automation-flows {
    width: 210px;
    flex-shrink: 0;

    border-right: 1px solid #30343e;

    overflow-y: auto;
}

.automation-content {
    flex: 1;
    min-width: 0;

    overflow-y: auto;
}

.automation-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 7px 12px;

    background: #20232b;
    border-top: 1px solid #30343e;

    color: #8f96a3;
    font-size: 11px;
}


/* ========================================================
   EVENTOS — TM SITE STUDIO
   ======================================================== */

.events-anchor {
    position: relative;
    display: flex;
    align-items: center;
}

.events-panel {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;

    width: 900px;
    max-width: calc(100vw - 30px);
    max-height: 680px;

    background: #181a20;
    border: 1px solid #30343e;
    border-radius: 9px;

    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.60);

    z-index: 10000;

    overflow: hidden;
}

.events-panel[hidden] {
    display: none;
}

.events-window {
    width: 100%;
    max-height: 680px;

    display: flex;
    flex-direction: column;
}

.events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 13px 15px;

    border-bottom: 1px solid #30343e;
    background: #20232b;
}

.events-header strong {
    display: block;

    color: #f0f1f4;
    font-size: 14px;
}

.events-header small {
    display: block;

    margin-top: 3px;

    color: #8f96a3;
    font-size: 11px;
}

.events-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.events-header button {
    height: 29px;

    padding: 0 10px;

    border: 0;
    border-radius: 5px;

    background: transparent;
    color: #aeb4bf;

    font-size: 12px;

    cursor: pointer;
}

.events-header button:hover {
    background: #30343e;
    color: #ffffff;
}

.events-body {
    display: flex;

    min-height: 480px;
    max-height: 560px;

    overflow: hidden;
}

.events-list-panel {
    width: 300px;
    min-width: 300px;

    display: flex;
    flex-direction: column;

    border-right: 1px solid #30343e;
}

.events-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 11px 13px;

    border-bottom: 1px solid #30343e;

    color: #d9dce2;
    font-size: 12px;
}

.events-panel-header span {
    min-width: 24px;

    padding: 2px 7px;

    border-radius: 10px;

    background: #30343e;
    color: #bfc4ce;

    text-align: center;
    font-size: 10px;
}

.events-list {
    flex: 1;

    padding: 8px;

    overflow-y: auto;
}

.event-list-item {
    position: relative;

    display: block;

    width: 100%;

    margin: 0 0 6px;
    padding: 10px 11px;

    border: 1px solid transparent;
    border-radius: 6px;

    background: #20232b;
    color: #d9dce2;

    text-align: left;

    cursor: pointer;
}

.event-list-item:hover {
    background: #292d36;
    border-color: #3a3f4b;
}

.event-list-item.active {
    background: #30343e;
    border-color: #e91e63;
}

.event-list-item strong {
    display: block;

    padding-right: 65px;

    color: #f0f1f4;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.event-list-item span {
    display: block;

    margin-top: 5px;

    color: #9299a5;
    font-size: 10px;
}

.event-list-item em {
    position: absolute;

    top: 10px;
    right: 9px;

    padding: 2px 5px;

    border-radius: 4px;

    background: #30343e;
    color: #8f96a3;

    font-size: 9px;
    font-style: normal;
}

.event-list-item em.published {
    background: rgba(76, 175, 80, 0.15);
    color: #7bd17f;
}

.event-list-item em.hidden {
    color: #8f96a3;
}

.events-content {
    flex: 1;

    min-width: 0;

    overflow-y: auto;
}

.events-welcome {
    min-height: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 40px;

    text-align: center;
}

.events-icon {
    margin-bottom: 12px;

    font-size: 34px;
}

.events-welcome h2 {
    margin: 0 0 7px;

    color: #f0f1f4;
    font-size: 18px;
}

.events-welcome p {
    max-width: 360px;

    margin: 0;

    color: #8f96a3;
    font-size: 12px;
    line-height: 1.6;
}

.event-details {
    display: flex;

    gap: 22px;

    padding: 20px;
}

.event-details-main {
    flex: 1;
    min-width: 0;
}

.event-details-header {
    margin-bottom: 18px;
}

.event-details-header strong {
    display: block;

    color: #f0f1f4;
    font-size: 19px;
    line-height: 1.35;
}

.event-details-header small {
    display: block;

    margin-top: 5px;

    color: #737b88;
    font-size: 10px;
}

.event-details-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 8px;

    margin-bottom: 18px;
}

.event-info-card {
    padding: 10px;

    border: 1px solid #30343e;
    border-radius: 6px;

    background: #20232b;
}

.event-info-card span {
    display: block;

    margin-bottom: 4px;

    color: #737b88;
    font-size: 10px;
}

.event-info-card strong {
    display: block;

    color: #d9dce2;
    font-size: 11px;
}

.event-publish-settings {
    margin-bottom: 18px;

    border: 1px solid #30343e;
    border-radius: 7px;

    overflow: hidden;
}

.event-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 12px;

    background: #20232b;
}

.event-setting + .event-setting {
    border-top: 1px solid #30343e;
}

.event-setting > div {
    min-width: 0;
}

.event-setting strong {
    display: block;

    color: #dfe2e7;
    font-size: 12px;
}

.event-setting small {
    display: block;

    margin-top: 3px;

    color: #7f8794;
    font-size: 10px;
    line-height: 1.4;
}

.event-setting.disabled {
    opacity: 0.45;
}

.event-switch {
    position: relative;

    flex: 0 0 auto;

    width: 38px;
    height: 21px;
}

.event-switch input {
    width: 0;
    height: 0;

    opacity: 0;
}

.event-switch span {
    position: absolute;

    inset: 0;

    border-radius: 12px;

    background: #3a3f49;

    cursor: pointer;

    transition: 0.15s;
}

.event-switch span::before {
    content: "";

    position: absolute;

    width: 15px;
    height: 15px;

    left: 3px;
    top: 3px;

    border-radius: 50%;

    background: #d9dce2;

    transition: 0.15s;
}

.event-switch input:checked + span {
    background: #e91e63;
}

.event-switch input:checked + span::before {
    transform: translateX(17px);

    background: #ffffff;
}

.event-switch input:disabled + span {
    cursor: not-allowed;
}

.event-description {
    padding-top: 15px;

    border-top: 1px solid #30343e;
}

.event-description > span {
    display: block;

    margin-bottom: 7px;

    color: #737b88;
    font-size: 10px;
}

.event-description p {
    margin: 0;

    color: #bfc4cd;
    font-size: 12px;
    line-height: 1.6;
}

.events-save-area {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-top: 20px;
}

.events-save-area span {
    color: #8f96a3;
    font-size: 10px;
}

#eventsSaveBtn {
    height: 32px;

    padding: 0 13px;

    border: 0;
    border-radius: 5px;

    background: #e91e63;
    color: #ffffff;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
}

#eventsSaveBtn:hover {
    filter: brightness(1.08);
}

#eventsSaveBtn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.event-poster-panel {
    width: 235px;
    min-width: 235px;

    padding: 13px;

    border: 1px solid #30343e;
    border-radius: 7px;

    background: #20232b;
}

.event-poster-header {
    margin-bottom: 10px;

    color: #8f96a3;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.event-poster {
    min-height: 300px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 5px;

    background: #111318;

    overflow: hidden;
}

.event-poster img {
    display: block;

    width: 100%;
    max-height: 380px;

    object-fit: contain;
}

.event-poster-empty {
    padding: 25px;

    color: #666e7b;
    font-size: 11px;
    text-align: center;
}

.events-empty {
    padding: 25px 15px;

    color: #8f96a3;
    font-size: 11px;
    text-align: center;
}

.events-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 9px 13px;

    border-top: 1px solid #30343e;

    background: #20232b;

    color: #8f96a3;
    font-size: 10px;
}

#eventsConnectionStatus {
    color: #8f96a3;
}

@media (max-width: 900px) {

    .events-panel {
        width: calc(100vw - 30px);
    }

    .events-list-panel {
        width: 250px;
        min-width: 250px;
    }

    .event-poster-panel {
        width: 190px;
        min-width: 190px;
    }

}

@media (max-width: 700px) {

    .events-body {
        flex-direction: column;
        max-height: 650px;
    }

    .events-list-panel {
        width: 100%;
        min-width: 0;
        max-height: 210px;

        border-right: 0;
        border-bottom: 1px solid #30343e;
    }

    .event-details {
        flex-direction: column;
    }

    .event-poster-panel {
        width: 100%;
        min-width: 0;
    }

    .event-poster {
        min-height: 200px;
    }

    .event-details-grid {
        grid-template-columns: 1fr;
    }

}



    .events-list {
        width: 100%;
        min-width: 0;
        max-height: 190px;

        border-right: 0;
        border-bottom: 1px solid #30343e;
    }

    .events-details {
        flex-direction: column;
    }

    .events-details-poster {
        width: 180px;
        min-width: 0;
    }
}



/* ============================================================
   EVENTS — LISTA OCUPA TODA A ALTURA DA JANELA
   ============================================================ */

.events-window {
    display: flex;
    flex-direction: column;
    height: min(760px, 90vh);
    max-height: 90vh;
}

.events-window .events-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

.events-window .events-list-panel {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.events-window .events-list {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow-y: auto;
}

.events-window .events-details-panel {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

.events-window .events-footer {
    flex: 0 0 auto;
}



/* ============================================================
   EVENTS — ALTURA TOTAL DA ÁREA DE CONTEÚDO
   ============================================================ */

.events-window {
    height: min(680px, calc(100vh - 80px));
    max-height: calc(100vh - 80px);
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.events-body {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: hidden;
}

.events-list-panel {
    height: 100%;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.events-list {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow-y: auto;
}

.events-content {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
}



/* ============================================================
   EVENTS — ESTRUTURA VERTICAL DEFINITIVA
   ============================================================ */

#eventsWindow {
    display: flex !important;
    flex-direction: column !important;
    height: 680px !important;
    max-height: calc(100vh - 80px) !important;
    min-height: 0 !important;
}

#eventsWindow > .events-header {
    flex: 0 0 auto !important;
}

#eventsWindow > .events-body {
    display: flex !important;
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
}

#eventsWindow .events-list-panel {
    flex: 0 0 300px !important;
    width: 300px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
}

#eventsWindow .events-list {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
}

#eventsWindow .events-content {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
}

#eventsWindow > .events-footer {
    flex: 0 0 auto !important;
}



/* ============================================================
   EVENTS — ESTRUTURA DA JANELA
   ============================================================ */

#eventsOverlay {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 74px !important;
    box-sizing: border-box !important;
}

#eventsWindow {
    width: 900px !important;
    max-width: calc(100vw - 30px) !important;
    height: calc(100vh - 110px) !important;
    min-height: 560px !important;
    max-height: 680px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

#eventsWindow .events-body {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
}

#eventsWindow .events-list-panel {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

#eventsWindow .events-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
}



/* EVENTS — respeitar o atributo HTML hidden */
#eventsWindow [hidden] {
    display: none !important;
}



/* EVENTS — hidden deve esconder completamente o overlay */
#eventsOverlay[hidden] {
    display: none !important;
}



/* ============================================================
   BOTÕES DE PAINÉIS — ESTADO ACTIVO
   ============================================================ */

#historyBtn.active,
#automationBtn.active,
#eventsBtn.active,
#statisticsBtn.active,
#settingsBtn.active,
#settingsBottomBtn.active {
    background: #30343e !important;
    color: #ffffff !important;
    border-color: #e91e63 !important;
}

#historyBtn.active:hover,
#automationBtn.active:hover,
#eventsBtn.active:hover,
#statisticsBtn.active:hover,
#settingsBtn.active:hover,
#settingsBottomBtn.active:hover {
    background: #3a3f4b !important;
    color: #ffffff !important;
}



/* ============================================================
   PAINÉIS — DESTAQUE VISUAL DO BOTÃO ACTIVO
   ============================================================ */

#historyBtn.active,
#automationBtn.active,
#eventsBtn.active {
    background: #3a3f4b !important;
    color: #ffffff !important;
    box-shadow: inset 0 -2px 0 #e91e63 !important;
}

#historyBtn.active:hover,
#automationBtn.active:hover,
#eventsBtn.active:hover {
    background: #454a57 !important;
    color: #ffffff !important;
    box-shadow: inset 0 -2px 0 #e91e63 !important;
}



/* ============================================================
   PAINÉIS — COR DO BOTÃO ACTIVO
   ============================================================ */

#historyBtn.active,
#automationBtn.active,
#eventsBtn.active {
    background: #e91e63 !important;
    color: #ffffff !important;
    border-color: #e91e63 !important;
    box-shadow: none !important;
}

#historyBtn.active:hover,
#automationBtn.active:hover,
#eventsBtn.active:hover {
    background: #f12b72 !important;
    color: #ffffff !important;
    border-color: #f12b72 !important;
}

/* =========================================================
   TM STUDIO — NAVEGADOR DE ESTRUTURA
   ========================================================= */

.left-sidebar {
    background: #17191f;
}

.left-sidebar .sidebar-header {
    height: 52px;
    padding: 0 10px;
}

.left-sidebar .sidebar-header strong {
    font-size: 16px;
    font-weight: 700;
    color: #dfe2e8;
}

/* Botões + */

.left-sidebar .sidebar-header button,
.left-sidebar .tree-title button {
    width: 26px;
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 6px;

    background: #242730;
    color: #bfc4ce;

    font-size: 18px;
    line-height: 1;

    cursor: pointer;
}

.left-sidebar .sidebar-header button:hover,
.left-sidebar .tree-title button:hover {
    background: #30343e;
    color: #fff;
}

/* Secções do navegador */

.left-sidebar .tree-section {
    border-bottom: 1px solid #292c34;
}

/* Títulos PÁGINAS / SECÇÕES / BLOCOS */

.left-sidebar .tree-title {
    min-height: 38px;
    padding: 0 10px;

    color: #686e7a;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: .10em;
}

/* Árvores */

.left-sidebar .tree {
    padding: 4px 7px 9px;
}

/* Item normal */

.left-sidebar .tree-item {
    position: relative;

    min-height: 46px;

    margin: 2px 0;
    padding: 8px 10px 8px 12px;

    border-radius: 6px;

    color: #cfd3dc;

    cursor: pointer;

    transition:
        background .12s ease,
        box-shadow .12s ease;
}

/* Hover */

.left-sidebar .tree-item:hover {
    background: #22252d;
}

/* Item seleccionado */

.left-sidebar .tree-item.active {
    background: #292c34;

    box-shadow:
        inset 3px 0 0 #e91e63;
}

/* Conteúdo */

.left-sidebar .tree-item-main {
    min-width: 0;
}

.left-sidebar .tree-item-main strong {
    display: block;

    overflow: hidden;

    color: #dfe2e8;

    font-size: 12px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.left-sidebar .tree-item-main small {
    display: block;

    margin-top: 4px;

    overflow: hidden;

    color: #686e7a;

    font-size: 10px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Página seleccionada */

.left-sidebar #pagesTree .tree-item.active .tree-item-main strong {
    color: #fff;
}

.left-sidebar #pagesTree .tree-item.active .tree-item-main small {
    color: #858b98;
}

/* Secções */

.left-sidebar #sectionsTree {
    padding-left: 14px;
    padding-right: 7px;
}

.left-sidebar #sectionsTree .tree-item {
    min-height: 40px;
    padding-top: 7px;
    padding-bottom: 7px;
}

/* Blocos */

.left-sidebar #blocksTree {
    padding-left: 21px;
    padding-right: 7px;
}

.left-sidebar #blocksTree .tree-item {
    min-height: 38px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.left-sidebar #blocksTree .tree-item-main strong {
    font-size: 11px;
}

/* Estado vazio */

.left-sidebar .tree-empty {
    padding: 18px 8px;

    color: #5f6570;

    font-size: 11px;
}

/* Scroll */

.left-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #30343e transparent;
}

.left-sidebar::-webkit-scrollbar {
    width: 7px;
}

.left-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.left-sidebar::-webkit-scrollbar-thumb {
    background: #30343e;
    border-radius: 10px;
}


/* =========================================================
   TM STUDIO — JANELAS DE CRIAÇÃO DA ESTRUTURA
   ========================================================= */

#structureCreateOverlay {
    position: fixed !important;
    inset: 0 !important;

    z-index: 10000 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 24px;

    background: rgba(0, 0, 0, .55);
}

#structureCreateOverlay[hidden] {
    display: none !important;
}

.structure-create-window {
    width: min(440px, calc(100vw - 40px));

    margin: auto;

    border: 1px solid #30343d;
    border-radius: 10px;

    background: #1b1e25;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, .55);

    overflow: hidden;
}

.structure-create-window[hidden] {
    display: none !important;
}

.structure-create-header {
    min-height: 62px;

    padding: 0 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #30343d;
}

.structure-create-header > div {
    min-width: 0;
}

.structure-create-header strong,
.structure-create-header small {
    display: block;
}

.structure-create-header strong {
    color: #e8eaf0;
    font-size: 14px;
}

.structure-create-header small {
    margin-top: 4px;
    color: #777d89;
    font-size: 11px;
}

.structure-create-header button {
    width: 30px;
    height: 30px;

    padding: 0;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #858b97;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}

.structure-create-header button:hover {
    background: #2a2d36;
    color: #fff;
}

.structure-create-form {
    padding: 18px;
}

.structure-create-form label {
    display: block;

    margin-bottom: 16px;

    color: #858b97;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.structure-create-form input,
.structure-create-form select,
.structure-create-form textarea {
    width: 100%;

    box-sizing: border-box;

    margin-top: 7px;
    padding: 10px 11px;

    border: 1px solid #343843;
    border-radius: 6px;

    outline: none;

    background: #111318;
    color: #e8eaf0;

    font: inherit;
    font-size: 12px;
}

.structure-create-form textarea {
    min-height: 120px;
    resize: vertical;
}

.structure-create-form input:focus,
.structure-create-form select:focus,
.structure-create-form textarea:focus {
    border-color: #e91e63;
}

.structure-create-form footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;

    margin-top: 20px;
}

.structure-create-form footer button {
    padding: 8px 13px;

    border: 1px solid #343843;
    border-radius: 6px;

    background: #242730;
    color: #dfe2e8;

    cursor: pointer;
}

.structure-create-form footer button:hover {
    background: #30343e;
}

.structure-create-form footer button.primary {
    border-color: #e91e63;

    background: #e91e63;
    color: #fff;
}

.structure-create-status {
    min-height: 16px;

    color: #e98b9f;

    font-size: 11px;
}

@media (max-width: 520px) {

    #structureCreateOverlay {
        padding: 12px;
    }

    .structure-create-window {
        width: 100%;
    }

}


/* =========================================================
   TM STUDIO — CATÁLOGO DE SECÇÕES
   ========================================================= */

.studio-catalog-overlay {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background: rgba(0, 0, 0, 0.55);

    z-index: 2000;
}

.studio-catalog-window {
    width: 720px;
    max-width: 100%;

    max-height: 80vh;

    display: flex;
    flex-direction: column;

    background: #181a20;

    border: 1px solid #30343e;
    border-radius: 8px;

    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.55);

    overflow: hidden;
}

.studio-catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 14px;

    background: #20232b;

    border-bottom: 1px solid #30343e;
}

.studio-catalog-header strong {
    display: block;

    color: #f0f1f4;

    font-size: 14px;
}

.studio-catalog-header small {
    display: block;

    margin-top: 3px;

    color: #8f96a3;

    font-size: 11px;
}

.studio-catalog-close {
    width: 28px;
    height: 28px;

    padding: 0;

    border: 0;
    border-radius: 5px;

    background: transparent;

    color: #aeb4bf;

    font-size: 19px;
    line-height: 1;

    cursor: pointer;
}

.studio-catalog-close:hover {
    background: #30343e;

    color: #ffffff;
}

.studio-catalog-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(180px, 1fr));

    gap: 12px;

    padding: 16px;

    overflow-y: auto;
}

.studio-catalog-card {
    display: flex;
    flex-direction: column;

    min-height: 180px;

    padding: 10px;

    border: 1px solid #30343e;
    border-radius: 7px;

    background: #20232b;

    color: #f0f1f4;

    text-align: left;

    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        transform 0.15s ease;
}

.studio-catalog-card:hover {
    border-color: #505766;

    background: #272b34;

    transform: translateY(-1px);
}

.studio-catalog-card-preview {
    display: flex;
    align-items: center;
    justify-content: center;

    height: 105px;

    margin-bottom: 10px;

    border: 1px solid #30343e;
    border-radius: 5px;

    background: #181a20;
}

.studio-catalog-card-preview span {
    width: 70%;
    height: 34px;

    border: 1px dashed #505766;
    border-radius: 3px;
}

.studio-catalog-card strong {
    display: block;

    margin-bottom: 4px;

    font-size: 12px;
}

.studio-catalog-card small {
    color: #8f96a3;

    font-size: 11px;

    line-height: 1.4;
}

@media (max-width: 600px) {

    .studio-catalog-overlay {
        padding: 15px;
    }

    .studio-catalog-window {
        width: 100%;
        max-height: 90vh;
    }

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

}

