/* =========================================================
   PROMOSBLOG PAINEL
   CSS PRINCIPAL
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 76px;

    --bg: #f7f7f9;
    --surface: #ffffff;

    --border: #e7e7eb;
    --border-soft: #f0f0f2;

    --text: #17171b;
    --text-secondary: #666670;
    --muted: #92929c;

    --primary: #6d28d9;
    --primary-soft: #f1edff;

    --success: #15803d;
    --success-bg: #ecfdf3;

    --warning: #c2410c;
    --warning-bg: #fff7ed;

    --danger: #dc2626;
    --danger-bg: #fef2f2;

    --sidebar-transition: 220ms ease;
}


/* =========================================================
   BASE
========================================================= */

html,
body {
    min-height: 100%;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;

    width: var(--sidebar-width);
    height: 100vh;

    background: var(--surface);
    border-right: 1px solid var(--border);

    display: flex;
    flex-direction: column;

    z-index: 1000;

    transition:
        width var(--sidebar-transition),
        transform var(--sidebar-transition);
}


/* =========================================================
   MARCA
========================================================= */

.sidebar-brand {
    min-height: 76px;

    padding: 15px 14px 15px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);

    flex-shrink: 0;
}

.brand-link {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 11px;

    text-decoration: none;
}

.brand-logo {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: #111114;
    color: #ffffff;

    font-size: 13px;
    font-weight: 800;
    letter-spacing: .3px;
}

.brand-info {
    min-width: 0;
    white-space: nowrap;

    transition:
        opacity var(--sidebar-transition),
        width var(--sidebar-transition);
}

.brand-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .2px;
}

.brand-subtitle {
    margin-top: 2px;

    color: var(--primary);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: .4px;
}

.sidebar-collapse {
    width: 28px;
    height: 28px;

    flex: 0 0 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: #ffffff;
    color: #666;

    cursor: pointer;

    font-size: 20px;
    line-height: 1;

    transition: .15s ease;
}

.sidebar-collapse:hover {
    background: #f4f4f6;
    color: #111;
}


/* =========================================================
   NAVEGAÇÃO
========================================================= */

.sidebar-navigation {
    flex: 1;

    padding: 14px 12px 24px;

    overflow-x: hidden;
    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: #d5d5db transparent;
}

.sidebar-navigation::-webkit-scrollbar {
    width: 5px;
}

.sidebar-navigation::-webkit-scrollbar-thumb {
    background: #d5d5db;
    border-radius: 20px;
}

.menu-block {
    margin-bottom: 12px;
}


/* =========================================================
   TÍTULO DAS CATEGORIAS
========================================================= */

.menu-section-toggle {
    width: 100%;
    height: 30px;

    padding: 0 10px;

    border: 0;
    background: transparent;

    display: flex;
    align-items: center;
    justify-content: space-between;

    color: var(--muted);

    cursor: pointer;
}

.menu-section-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;

    white-space: nowrap;
}

.menu-chevron {
    width: 15px;
    height: 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: transform .18s ease;
}

.menu-chevron svg {
    width: 13px;
    height: 13px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   CONTEÚDO DAS CATEGORIAS
========================================================= */

.menu-section-content {
    overflow: hidden;

    max-height: 400px;
    opacity: 1;

    transition:
        max-height .22s ease,
        opacity .18s ease;
}

.menu-block.closed .menu-section-content {
    max-height: 0;
    opacity: 0;
}

.menu-block.closed .menu-chevron {
    transform: rotate(-90deg);
}


/* =========================================================
   LINKS DO MENU
========================================================= */

.menu-link {
    position: relative;

    min-height: 42px;

    padding: 0 11px;

    display: flex;
    align-items: center;
    gap: 11px;

    border-radius: 9px;

    color: #33333a;

    text-decoration: none;

    font-size: 13px;
    font-weight: 500;

    margin: 2px 0;

    transition:
        background .15s ease,
        color .15s ease;
}

.menu-link:hover {
    background: #f4f4f6;
    color: #111114;
}

.menu-link.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

.menu-icon {
    width: 19px;
    height: 19px;

    flex: 0 0 19px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon svg {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-label {
    min-width: 0;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    transition: opacity var(--sidebar-transition);
}


/* =========================================================
   USUÁRIO / RODAPÉ SIDEBAR
========================================================= */

.sidebar-footer {
    padding: 12px;

    border-top: 1px solid var(--border);

    background: var(--surface);

    flex-shrink: 0;
}

.sidebar-user {
    min-height: 52px;

    padding: 7px;

    display: flex;
    align-items: center;
    gap: 10px;

    border-radius: 10px;
}

.sidebar-user:hover {
    background: #f7f7f9;
}

.user-avatar {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #eeeeF1;

    color: #333;

    font-size: 11px;
    font-weight: 800;
}

.user-details {
    min-width: 0;
    flex: 1;

    white-space: nowrap;
    overflow: hidden;

    transition: opacity var(--sidebar-transition);
}

.user-name {
    overflow: hidden;
    text-overflow: ellipsis;

    font-size: 12px;
    font-weight: 700;
}

.user-project {
    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;
}

.user-more {
    color: #999;
    font-size: 12px;
}


/* =========================================================
   SIDEBAR RECOLHIDA
========================================================= */

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .brand-info,
body.sidebar-collapsed .menu-label,
body.sidebar-collapsed .menu-section-title,
body.sidebar-collapsed .menu-chevron,
body.sidebar-collapsed .user-details,
body.sidebar-collapsed .user-more {
    display: none;
}

body.sidebar-collapsed .sidebar-brand {
    padding-left: 16px;
    padding-right: 16px;

    justify-content: center;
}

body.sidebar-collapsed .brand-link {
    justify-content: center;
}

body.sidebar-collapsed .sidebar-collapse {
    position: absolute;

    right: -13px;
    top: 24px;

    background: #ffffff;

    transform: rotate(180deg);
}

body.sidebar-collapsed .menu-section-toggle {
    display: none;
}

body.sidebar-collapsed .menu-block {
    margin-bottom: 4px;
}

body.sidebar-collapsed .menu-section-content {
    max-height: none !important;
    opacity: 1 !important;
}

body.sidebar-collapsed .menu-link {
    width: 48px;
    height: 44px;

    padding: 0;

    margin-left: auto;
    margin-right: auto;

    justify-content: center;
}

body.sidebar-collapsed .menu-icon {
    margin: 0;
}

body.sidebar-collapsed .sidebar-user {
    justify-content: center;
}


/* =========================================================
   CONTEÚDO PRINCIPAL
========================================================= */

.main {
    min-height: 100vh;

    margin-left: var(--sidebar-width);

    transition: margin-left var(--sidebar-transition);
}

body.sidebar-collapsed .main {
    margin-left: var(--sidebar-collapsed);
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    min-height: 72px;

    padding: 0 32px;

    background: var(--surface);
    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
}

.breadcrumb {
    color: var(--text-secondary);

    font-size: 13px;
}

.breadcrumb strong {
    color: var(--text);
}

.topbar-right {
    gap: 10px;
}

.system-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 7px 10px;

    border-radius: 8px;

    background: var(--success-bg);
    color: var(--success);

    font-size: 11px;
    font-weight: 700;
}

.system-status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: currentColor;
}


/* =========================================================
   CONTAINER
========================================================= */

.content {
    width: 100%;
    max-width: 1500px;

    margin: 0 auto;

    padding: 34px;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    margin-bottom: 6px;

    font-size: 28px;
    line-height: 1.2;

    letter-spacing: -.5px;
}

.page-header p {
    color: var(--text-secondary);

    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   CARDS
========================================================= */

.card {
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 14px;

    overflow: hidden;
}

.card-header {
    padding: 18px 20px;

    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 14px;
    font-weight: 750;
}

.card-header p {
    margin-top: 4px;

    color: var(--text-secondary);

    font-size: 11px;
}

.card-body {
    padding: 20px;
}


/* =========================================================
   BOTÕES
========================================================= */

.btn {
    min-height: 40px;

    padding: 0 15px;

    border: 1px solid var(--border);
    border-radius: 9px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    background: #ffffff;
    color: var(--text);

    text-decoration: none;

    cursor: pointer;

    font-size: 12px;
    font-weight: 700;

    transition: .15s ease;
}

.btn:hover {
    background: #f5f5f7;
}

.btn-primary {
    border-color: var(--primary);

    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: #5b21b6;
}


/* =========================================================
   FORMULÁRIOS
========================================================= */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;

    margin-bottom: 7px;

    font-size: 12px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    min-height: 42px;

    padding: 10px 12px;

    border: 1px solid #dcdce2;
    border-radius: 9px;

    background: #ffffff;
    color: var(--text);

    outline: none;

    font-size: 13px;

    transition:
        border .15s ease,
        box-shadow .15s ease;
}

.form-control:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 3px rgba(109, 40, 217, .08);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}


/* =========================================================
   BADGES
========================================================= */

.badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 8px;

    border-radius: 20px;

    font-size: 10px;
    font-weight: 750;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}


/* =========================================================
   MOBILE
========================================================= */

.mobile-menu-button {
    display: none;

    width: 38px;
    height: 38px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: #ffffff;

    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.sidebar-overlay {
    display: none;
}


/* =========================================================
   RESPONSIVIDADE
========================================================= */

@media (max-width: 900px) {

    .sidebar {
        width: 260px;

        transform: translateX(-100%);
    }

    body.mobile-sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-collapsed .sidebar {
        width: 260px;
    }

    body.sidebar-collapsed .brand-info,
    body.sidebar-collapsed .menu-label,
    body.sidebar-collapsed .menu-section-title,
    body.sidebar-collapsed .menu-chevron,
    body.sidebar-collapsed .user-details,
    body.sidebar-collapsed .user-more {
        display: initial;
    }

    body.sidebar-collapsed .menu-section-toggle {
        display: flex;
    }

    body.sidebar-collapsed .menu-link {
        width: auto;
        height: 42px;

        padding: 0 11px;
        margin: 2px 0;

        justify-content: flex-start;
    }

    body.sidebar-collapsed .sidebar-user {
        justify-content: flex-start;
    }

    .sidebar-collapse {
        display: none;
    }

    .main,
    body.sidebar-collapsed .main {
        margin-left: 0;
    }

    .mobile-menu-button {
        display: flex;
    }

    .sidebar-overlay {
        position: fixed;

        inset: 0;

        background: rgba(0, 0, 0, .35);

        z-index: 900;
    }

    body.mobile-sidebar-open .sidebar-overlay {
        display: block;
    }

    .topbar {
        padding: 0 20px;
    }

    .content {
        padding: 24px 20px;
    }
}


@media (max-width: 520px) {

    .content {
        padding: 22px 14px;
    }

    .topbar {
        min-height: 64px;
        padding: 0 14px;
    }

    .page-header h1 {
        font-size: 24px;
    }
}