/* ==========================================================================
   MRP — estilos base (menu superior estilo "Master Plan")
   ========================================================================== */
:root {
    --mrp-bg: #eef0f4;
    --mrp-surface: #ffffff;
    --mrp-text: #1f2733;
    --mrp-muted: #6b7280;
    --mrp-accent: #e8622c;      /* laranja "Plan" */
    --mrp-accent-2: #2b6cb0;    /* azul do ícone */
    --mrp-border: #e2e6ec;
    --mrp-danger: #c0392b;
    --mrp-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);
    /* Cobertura — tokens twisty usados pelas pílulas/textos (ver cobertura.js) */
    --twisty-success: #10B981;
    --twisty-warning: #F59E0B;
    --twisty-danger: #EF4444;
    --twisty-over: #ad10ea;
}

/* ---- Cobertura — padrão visual de todas as linhas de cobertura ---- */
.cob-pill {
    display: inline-block;
    padding: 0 8px;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}
.cob-pill--danger { background: var(--twisty-danger); color: #fff; }
.cob-pill--warning { background: var(--twisty-warning); color: #111827; }
.cob-success { color: var(--twisty-success); font-weight: 700; }
.cob-over { color: var(--twisty-over); font-weight: 700; }

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--mrp-bg);
    color: var(--mrp-text);
}

/* ---- Barra superior ---- */
.topbar {
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: 64px;
    height: auto;
    padding: 8px 28px;
    background: var(--mrp-surface);
    border-bottom: 1px solid var(--mrp-border);
    box-shadow: var(--mrp-shadow);
    overflow: visible;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: visible;
}
.brand .brand-logo {
    display: block;
    flex-shrink: 0;
    width: 25px;
    height: 36px;
    aspect-ratio: 187 / 272;
}
.brand .brand-mark {
    width: 30px;
    height: 40px;
    display: inline-block;
}
.brand .accent { color: var(--mrp-accent); }

.nav {
    display: flex;
    align-items: center;
    gap: 26px;
    flex: 1;
}
.nav a {
    color: var(--mrp-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--mrp-accent-2); }
.nav a.active {
    color: var(--mrp-text);
    border-bottom-color: var(--mrp-text);
    font-weight: 600;
}

/* ---- Ações da topbar (engrenagem / dropdown) ---- */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
.version-switcher { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.version-current-label { font-size:11px; color:var(--mrp-muted); }
.version-current { border:1px solid var(--mrp-border); border-radius:7px; background:#fff; color:var(--mrp-text); padding:7px 10px; font-size:12px; font-weight:700; cursor:pointer; }
.version-current:hover { border-color:var(--mrp-accent-2); color:var(--mrp-accent-2); }
.version-modal { position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center; padding:16px; background:rgba(15,23,42,.42); }
.version-modal[hidden] { display:none; }
.version-modal-panel { width:min(460px, 100%); max-height:80vh; overflow:auto; background:#fff; border:1px solid var(--mrp-border); border-radius:12px; box-shadow:0 18px 50px rgba(15,23,42,.2); padding:20px; }
.version-modal-header { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:16px; }
.version-modal-header h2 { margin:0; font-size:18px; }
.version-modal-header p { margin:5px 0 0; color:var(--mrp-muted); font-size:12px; }
.version-modal-close { border:0; background:transparent; color:var(--mrp-muted); font-size:24px; line-height:1; cursor:pointer; }
.version-options { display:grid; gap:8px; }
.version-option { display:flex; flex-direction:column; align-items:flex-start; gap:3px; border:1px solid var(--mrp-border); border-radius:8px; background:#fff; padding:11px 12px; text-align:left; cursor:pointer; }
.version-option:hover { border-color:var(--mrp-accent-2); background:#f7fbff; }
.version-option strong { color:var(--mrp-text); font-size:13px; }
.version-option span { color:var(--mrp-muted); font-size:12px; }
.version-add { display:block; margin-top:16px; color:var(--mrp-accent-2); font-size:13px; font-weight:700; text-decoration:none; }
.version-add:hover { text-decoration:underline; }
.dropdown {
    position: relative;
}
.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--mrp-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.icon-btn:hover {
    background: #f1f5f9;
    border-color: var(--mrp-border);
    color: var(--mrp-accent-2);
}
.icon-btn svg {
    width: 20px;
    height: 20px;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: var(--mrp-surface);
    border: 1px solid var(--mrp-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
    padding: 6px;
    z-index: 50;
    flex-direction: column;
}
.dropdown.open .dropdown-menu {
    display: flex;
}
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--mrp-text);
    text-decoration: none;
    white-space: nowrap;
}
.dropdown-menu a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.dropdown-menu a:hover {
    background: #f1f5f9;
    color: var(--mrp-accent-2);
}
.dropdown-menu a.active {
    background: #eef2f7;
    color: var(--mrp-accent-2);
    font-weight: 600;
}

/* ---- Usuário (canto direito) ---- */
.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 0;
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--mrp-accent-2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    object-fit: cover;
}
.user-meta { line-height: 1.25; text-align: right; }
.user-meta .u-name { font-weight: 600; font-size: 14px; }
.user-meta .u-role { font-size: 12px; color: var(--mrp-muted); }
.user-meta .u-build { font-size: 10px; color: var(--mrp-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.logout-link {
    margin-left: 8px;
    font-size: 13px;
    color: var(--mrp-muted);
    text-decoration: none;
    border: 1px solid var(--mrp-border);
    padding: 6px 12px;
    border-radius: 8px;
}
.logout-link:hover { color: var(--mrp-danger); border-color: var(--mrp-danger); }

/* ---- Conteúdo ---- */
.content { padding: 32px 28px; max-width: 1200px; margin: 0 auto; }
.card {
    background: var(--mrp-surface);
    border: 1px solid var(--mrp-border);
    border-radius: 14px;
    padding: 28px;
    box-shadow: var(--mrp-shadow);
}
.card h1 { margin: 0 0 4px; font-size: 22px; }
.muted { color: var(--mrp-muted); }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.info-item {
    border: 1px solid var(--mrp-border);
    border-radius: 10px;
    padding: 14px 16px;
    background: #fafbfc;
}
.info-item .label { font-size: 12px; color: var(--mrp-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.info-item .value { font-size: 15px; font-weight: 600; margin-top: 4px; word-break: break-word; }

/* ---- Login ---- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(160deg, #eef4fb 0%, #dbe8f7 100%);
}
.login-card {
    width: 420px;
    max-width: 100%;
    background: var(--mrp-surface);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12);
    padding: 40px 36px;
    text-align: center;
}
.login-card .brand { justify-content: center; margin-bottom: 18px; }
.btn {
    display: inline-block;
    border: none;
    cursor: pointer;
    background: var(--mrp-accent-2);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 12px 34px;
    border-radius: 10px;
    text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.badge-danger { color: var(--mrp-danger); font-weight: 600; }
