html,
body {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100%;
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #1e293b;
    overflow-x: hidden;
    overflow-y: auto !important;
}

/* LIMPEZA DO TEMPLATE WORDPRESS */
body.page,
body.page .wp-site-blocks,
body.page main,
body.page .entry-content,
body.page .wp-block-post-content,
body.page .site,
body.page .container,
body.page .content-area,
body.page .site-content,
body.page #primary,
body.page #main,
body.page .site-main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

body.page .wp-block-post-title,
body.page .entry-title,
body.page .entry-header,
body.page .post-title,
body.page .page-title,
body.page .site-footer,
body.page footer.wp-block-template-part,
body.page .footer-widgets,
body.page .widget-area,
body.page .wp-block-search,
body.page .wp-block-latest-posts,
body.page .wp-block-latest-comments,
body.page .widget_recent_entries,
body.page .widget_recent_comments {
    display: none !important;
}

/* ESTRUTURA GERAL */
.bridge-dashboard-wrapper {
    display: flex;
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: #f4f7fb;
    box-sizing: border-box;
}

.bridge-sidebar {
    width: 270px;
    min-width: 270px;
    min-height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 24px 18px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.bridge-main-area {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.bridge-content {
    flex: 1;
    width: 100%;
    max-width: none !important;
    padding: 30px;
    box-sizing: border-box;
    overflow: visible;
}

/* SIDEBAR */
.bridge-sidebar-brand {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.bridge-sidebar-brand h2 {
    margin: 0;
    font-size: 24px;
    color: #0f172a;
}

.bridge-sidebar-brand p {
    margin: 6px 0 0;
    font-size: 14px;
    color: #64748b;
}

.bridge-sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bridge-sidebar-menu > ul > li {
    margin-bottom: 8px;
}

.bridge-sidebar-menu a,
.submenu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: none;
    background: transparent;
    text-decoration: none;
    color: #334155;
    font-size: 15px;
    border-radius: 10px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.bridge-sidebar-menu a:hover,
.submenu-toggle:hover {
    background: #eef4ff;
    color: #0f172a;
}

.submenu {
    display: none;
    margin-top: 6px;
    padding-left: 10px;
}

.has-submenu.open .submenu {
    display: block;
}

.submenu li {
    margin-bottom: 4px;
}

.submenu a {
    padding: 10px 12px;
    font-size: 14px;
    color: #64748b;
    background: #f8fafc;
}

.submenu a:hover {
    background: #e8f0fe;
    color: #0f172a;
}

.arrow,
.bridge-user-arrow {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-left: 10px;
    flex-shrink: 0;
}

.has-submenu.open .arrow {
    transform: rotate(225deg);
}

/* TOPO */
.bridge-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 30px;
    box-sizing: border-box;
}

.bridge-topbar-left h1 {
    margin: 0;
    font-size: 28px;
    color: #0f172a;
}

.bridge-topbar-left p {
    margin: 6px 0 0;
    font-size: 14px;
    color: #64748b;
}

.bridge-user-menu {
    position: relative;
}

.bridge-user-button {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bridge-user-button:hover {
    background: #f8fafc;
}

.bridge-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.bridge-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.bridge-user-info strong {
    font-size: 14px;
    color: #0f172a;
}

.bridge-user-info small {
    font-size: 12px;
    color: #64748b;
}

.bridge-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 180px;
    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: 8px;
    display: none;
    z-index: 99;
}

.bridge-user-dropdown.open {
    display: block;
}

.bridge-user-dropdown a {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    color: #334155;
    border-radius: 8px;
    font-size: 14px;
}

.bridge-user-dropdown a:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* CARD INICIAL */
.bridge-welcome-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
    max-width: 700px;
}

.bridge-welcome-card h2 {
    margin-top: 0;
    margin-bottom: 14px;
    color: #0f172a;
}

.bridge-welcome-card p {
    margin: 0 0 12px;
    line-height: 1.6;
    color: #475569;
}

/* ALERTAS */
.bridge-alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

.bridge-alert.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid #22c55e;
    color: #bbf7d0;
}

.bridge-alert.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fecaca;
}

/* FORMULÁRIO */
.bridge-form-page {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.bridge-cadastro-form {
    width: 100%;
}

.dark-form {
    width: 100%;
    background: #1f2329;
    border-radius: 16px;
    padding: 24px;
    color: #f1f5f9;
    box-sizing: border-box;
}

.bridge-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.bridge-form-header h2 {
    margin: 0;
    font-size: 34px;
    color: #ffffff;
}

.bridge-form-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-outline,
.btn-primary {
    min-width: 180px;
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    box-sizing: border-box;
}

.btn-outline {
    background: transparent;
    color: #22c55e;
    border: 1px solid #22c55e;
}

.btn-primary {
    background: #22c55e;
    color: #ffffff;
}

.bridge-section {
    margin-bottom: 28px;
}

.bridge-section h3 {
    margin: 0 0 14px;
    font-size: 18px;
    color: #ffffff;
}

.bridge-grid {
    display: grid;
    gap: 16px;
    width: 100%;
}

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

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

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

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.field-full {
    grid-column: 1 / -1;
}

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

.field label {
    font-size: 14px;
    color: #e2e8f0;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    background: #3a3d43;
    color: #ffffff;
    border: 1px solid #4b5563;
    border-radius: 10px;
    padding: 12px 14px;
    box-sizing: border-box;
    outline: none;
    font-size: 14px;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #22c55e;
}

.bridge-tab-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #3f4752;
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.tab-link {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    position: relative;
}

.tab-link.active {
    color: #ffffff;
}

.tab-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -9px;
    width: 100%;
    height: 3px;
    background: #22c55e;
    border-radius: 3px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.bridge-switch-line {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.switch-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
}

/* RESPONSIVO */
@media (max-width: 1200px) {
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .field-span-2,
    .field-full {
        grid-column: auto;
    }
}

@media (max-width: 992px) {
    .bridge-dashboard-wrapper {
        flex-direction: column;
    }

    .bridge-sidebar {
        width: 100%;
        min-width: 100%;
        min-height: auto;
        position: relative;
        top: auto;
        align-self: auto;
    }

    .bridge-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .bridge-user-menu {
        width: 100%;
    }

    .bridge-user-button {
        width: 100%;
        justify-content: space-between;
    }
}

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

    .bridge-content {
        padding: 20px;
    }

    .bridge-topbar {
        padding: 20px;
    }

    .bridge-form-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .bridge-form-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn-outline,
    .btn-primary {
        width: 100%;
    }

    .bridge-form-header h2 {
        font-size: 28px;
    }
}

/* Remove somente o primeiro header do tema */
body.page > header,
body.page .wp-site-blocks > header,
body.page .wp-site-blocks > .wp-block-template-part:first-child {
    display: none !important;
}

.bridge-list-table-wrap {
    overflow-x: auto;
    margin-top: 20px;
}

.bridge-list-table {
    width: 100%;
    border-collapse: collapse;
    background: #2a2f36;
    border-radius: 12px;
    overflow: hidden;
}

.bridge-list-table th,
.bridge-list-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #3a4048;
    color: #f1f5f9;
    font-size: 14px;
}

.bridge-list-table th {
    background: #22272e;
    font-weight: 700;
}

.bridge-list-table tr:hover td {
    background: #313740;
}

.bridge-table-link {
    color: #22c55e;
    text-decoration: none;
    font-weight: 600;
}

.bridge-table-link:hover {
    text-decoration: underline;
}

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

.bridge-view-item {
    background: #2a2f36;
    padding: 14px;
    border-radius: 10px;
    color: #f1f5f9;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .bridge-view-grid {
        grid-template-columns: 1fr;
    }
}

.bridge-search-form {
    margin-bottom: 20px;
}

.bridge-search-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.bridge-search-input {
    flex: 1;
    min-width: 260px;
    background: #3a3d43;
    color: #ffffff;
    border: 1px solid #4b5563;
    border-radius: 10px;
    padding: 12px 14px;
    box-sizing: border-box;
    outline: none;
}

.bridge-search-input:focus {
    border-color: #22c55e;
}

.bridge-table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bridge-table-link.danger {
    color: #ef4444;
}

.bridge-table-link.danger:hover {
    color: #f87171;
}