:root{
--blue-700:#1652c9;
--blue-600:#1a63e6;
--blue-500:#2f7bf0;
--bg:#f4f6fb;
--card:#ffffff;
--border:#e6e9f0;
--text:#1c2333;
--text-muted:#6b7387;
--text-message: #ffffff;
--green:#22b366;
--green-dark:#15803d;
--amber:#f5a623;
--amber-dark:#d97706;
--red:#e5484d;
--purple:#7c3aed;
--cyan:#0891b2;
--gray:#6b7280;
--hover: #e2ecff;
--sidebar-w:260px;
--header-h:72px;
--radius:12px;
--shadow:0 2px 10px rgba(20,30,60,.06);
}

*{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.main-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: var(--header-h);
    padding: 0 24px;
    background-color: var(--blue-700);
    border-bottom: 1ox solid var(--border);
    z-index: 900;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-img {
    height: 60px;
    width: auto;
    border-radius: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}


.header-user {
    position: relative;
}


.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
 
.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
 
.page-header .subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}
 
.page-header-action {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 20px;
    background-color: var(--blue-600);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color .15s ease;
}


.page-header-action:hover {
    background-color: var(--blue-700);
}

.page-header-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 6px;
    transition: color .15s ease;
}

.page-header-back:hover {
    color: var(--blue-600);
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition:  background-color .15s ease;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #000;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-message);
    white-space: nowrap;
}


.user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 100;
}

.user-menu.is-open {
    display: block;
}

.user-menu-item {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
    transition: background-color .15s ease;
}

.user-menu-item:hover {
    background-color: var(--bg);
    color: var(--blue-500);
}

.content-container {
    flex: 1;
    padding: 24px;
    min-width: 0;
    background-color: var(--bg);
    margin-left: var(--sidebar-w);
}

/* ------------------------------------------------------------------------- */
.main-layout {
    display: flex;
    min-height: calc(100vh - var(--header-h));
    margin-top: var(--header-h);
}

.overlay {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 500;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background-color: var(--card);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    z-index: 900;

    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
}

.sidebar-link:hover {
    background-color: var(--bg);
    color: var(--text);
}

.sidebar-link.active {
    background-color: var(--bg);
    color: var(--blue-600);
    font-weight: 600;
}

/* ---------- Sidebar: grupos colapsáveis ---------- */
.sidebar-group {
    display: flex;
    flex-direction: column;
}

.sidebar-group summary.sidebar-group-header {
    list-style: none;
    cursor: pointer;
}

.sidebar-group summary.sidebar-group-header::-webkit-details-marker {
    display: none;
}

.sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: background-color .15s ease, color .15s ease;
}

.sidebar-group-header i:first-child {
    width: 18px;
    text-align: center;
}

.sidebar-group-header:hover {
    background-color: var(--bg);
    color: var(--text);
}

.sidebar-group-header.active {
    color: var(--blue-600);
    font-weight: 600;
}

.sidebar-group-caret {
    position: relative;
    margin-left: auto;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.sidebar-group-caret::before,
.sidebar-group-caret::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: currentColor;
    transform: translate(-50%, -50%);
    transition: transform .15s ease, opacity .15s ease;
}

/* traço horizontal do + / - (sempre visível) */
.sidebar-group-caret::before {
    width: 10px;
    height: 2px;
}

/* traço vertical do + (some quando o grupo está aberto, virando -) */
.sidebar-group-caret::after {
    width: 2px;
    height: 10px;
}

.sidebar-group[open] > .sidebar-group-header .sidebar-group-caret::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

.sidebar-submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 14px;
    margin-top: 2px;
}

.sidebar-sublink {
    padding: 8px 14px 8px 20px;
    font-size: 13.5px;
}

.sidebar-sublink i {
    font-size: 12px;
}

.detail-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 46px;
    padding: 0 24px;

    min-width: 120px;
    width: fit-content;
    flex: 0 0 auto;

    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.btn-primary {
    background-color: var(--blue-600);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background-color: var(--blue-700);
}

.btn-primary:active {
    background-color: var(--blue-700);
}

.btn-secondary {
    background-color: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: var(--bg);
    border-color: var(--blue-500);
    color: var(--blue-600);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 46px;
    padding: 0 24px;

    min-width: 120px;
    width: fit-content;
    flex: 0 0 auto;

    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;

    background-color: var(--red);
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background-color: #c9302c;
}

.btn-danger:active {
    background-color: #c9302c;
}

.menu-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--card);
    border-radius: 8px;
    transition: background-color .15s ease;
}

/* ---------- Progresso em breadcrumb ---------- */
.progress-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.breadcrumb-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
}

.breadcrumb-step {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.breadcrumb-step-current {
    background-color: var(--blue-600);
    border-color: var(--blue-600);
    color: #fff;
}

.breadcrumb-arrow {
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}



@media (max-width: 768px) {
    .user-name {
        display: none;
    }

    .main-header {
        padding: 0 12px;
    }

    .menu-toggle-btn {
        display: flex;
    }

    .content-container {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .overlay {
        display: block;
    }


}

[hidden] {
    display: none !important;
}