:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #6d7789;
  --line: #e8edf5;
  --primary: #2858ff;
  --primary2: #6d3cff;
  --sidebar: #0d1324;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { text-decoration: none; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 280px; background: radial-gradient(circle at top left, #273cff 0, #10162b 35%, var(--sidebar) 100%); color: white; padding: 26px 20px; position: fixed; inset: 0 auto 0 0; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 34px; }
.brand-mark { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); font-weight: 800; }
.brand-title { font-weight: 800; line-height: 1; }
.brand-subtitle { font-size: 12px; opacity: .65; margin-top: 4px; }
.sidebar .nav-link { color: rgba(255,255,255,.82); border-radius: 14px; padding: 12px 14px; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.12); }
.sidebar-card { position: absolute; left: 20px; right: 20px; bottom: 22px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.08); border-radius: 18px; padding: 16px; backdrop-filter: blur(10px); }
.content { margin-left: 280px; width: calc(100% - 280px); padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; }
.page-title { margin: 4px 0 0; font-size: 32px; font-weight: 800; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary2)); border: 0; box-shadow: 0 12px 26px rgba(40,88,255,.24); }
.btn-outline-primary { border-color: #c9d2ff; color: var(--primary); }
.hero-card { color: white; border-radius: 28px; padding: 34px; background: linear-gradient(135deg, #1e2a62, #2858ff 55%, #7b3cff); display: flex; align-items: center; justify-content: space-between; box-shadow: 0 18px 40px rgba(40,88,255,.25); }
.hero-card h2 { max-width: 720px; font-weight: 850; font-size: 34px; margin: 6px 0 8px; }
.hero-card p { margin: 0; opacity: .82; }
.metric-card, .panel-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 10px 30px rgba(23,32,51,.06); }
.metric-card { padding: 22px; }
.metric-card span { display: block; color: var(--muted); font-weight: 650; }
.metric-card strong { font-size: 36px; line-height: 1.1; }
.panel-card { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h3, .panel-card h3 { font-size: 18px; font-weight: 800; margin: 0; }
.table thead th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-bottom-color: var(--line); }
.table td { border-bottom-color: var(--line); }
.role-list { display: grid; gap: 10px; }
.role-pill { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; justify-content: space-between; gap: 12px; }
.role-pill span { font-weight: 750; }
.role-pill small { color: var(--muted); }
.timeline { display: grid; gap: 14px; }
.timeline-item { border-left: 3px solid #dce4ff; padding-left: 12px; }
.role-select-list { display: grid; gap: 10px; }
.role-select-item { cursor: pointer; display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcff; }
.role-select-item input { margin-top: 4px; }
.role-select-item strong { display: block; }
.role-select-item small { display: block; color: var(--muted); margin-top: 3px; }
.switch-line { display: flex; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.created-card { max-width: 880px; margin: 30px auto; background: white; border: 1px solid var(--line); border-radius: 30px; padding: 38px; text-align: center; box-shadow: 0 20px 50px rgba(23,32,51,.08); }
.success-mark { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 24px; background: #e8fff0; color: #0a9c48; display: grid; place-items: center; font-size: 36px; font-weight: 900; }
.credential-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; text-align: left; }
.credential-grid div { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fbfcff; }
.credential-grid span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.credential-grid strong { display: block; margin-top: 5px; font-size: 16px; overflow-wrap: anywhere; }
.profile-card { display: flex; gap: 18px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: 0 10px 30px rgba(23,32,51,.06); }
.avatar { width: 62px; height: 62px; border-radius: 22px; background: linear-gradient(135deg, var(--primary), var(--primary2)); color: white; display: grid; place-items: center; font-size: 28px; font-weight: 900; }
.profile-card h2 { margin: 0; font-size: 26px; font-weight: 850; }
.step-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.step-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #fbfcff; }
.detail-line { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail-line span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.detail-line small { color: var(--ink); line-height: 1.5; }
.danger-zone { border-color: #ffd5d5; }
.flash-zone { margin-bottom: 18px; }
code { color: #1c3fd7; background: #eef2ff; padding: 2px 6px; border-radius: 7px; }

@media (max-width: 980px) {
  .sidebar { position: static; width: 100%; min-height: auto; }
  .sidebar-card { position: static; margin-top: 20px; }
  .app-shell { display: block; }
  .content { margin-left: 0; width: 100%; padding: 18px; }
  .hero-card { display: block; }
  .hero-card .btn { margin-top: 18px; }
  .credential-grid { grid-template-columns: 1fr; }
  .step-grid { grid-template-columns: 1fr; }
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip { display: grid; gap: 0; text-align: right; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 8px 12px; }
.user-chip span { font-weight: 800; line-height: 1.1; }
.user-chip small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.nav-link-danger { color: rgba(255, 210, 210, .95) !important; }
.nav-link-danger:hover { background: rgba(255, 80, 80, .18) !important; }
.login-body { min-height: 100vh; background: radial-gradient(circle at top left, #2858ff 0, #10162b 42%, #080d19 100%); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); background: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 30px; padding: 34px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.login-card h1 { font-size: 30px; font-weight: 850; margin: 26px 0 8px; }
.login-brand { display: flex; gap: 12px; align-items: center; }
@media (max-width: 980px) {
  .topbar-actions { align-items: flex-end; flex-direction: column; }
  .user-chip { text-align: left; }
}

.matrix-hero { color: white; border-radius: 28px; padding: 30px; background: linear-gradient(135deg, #17224f, #2858ff 52%, #7b3cff); display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 18px 40px rgba(40,88,255,.20); }
.matrix-hero h2 { font-size: 34px; line-height: 1.05; font-weight: 850; margin: 6px 0 8px; }
.matrix-hero p { margin: 0; opacity: .86; max-width: 820px; }
.matrix-tabs { display: flex; flex-wrap: wrap; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 10px; box-shadow: 0 10px 30px rgba(23,32,51,.05); }
.matrix-tab { color: var(--muted); font-weight: 800; border-radius: 14px; padding: 12px 18px; }
.matrix-tab:hover, .matrix-tab.active { color: var(--primary); background: #eef2ff; }
.metric-soft-purple { background: linear-gradient(135deg, #fff, #f3f0ff); }
.metric-soft-green { background: linear-gradient(135deg, #fff, #effff6); }
.metric-soft-orange { background: linear-gradient(135deg, #fff, #fff6eb); }
.matrix-filter { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr 1fr 1.4fr auto auto; gap: 10px; }
.matrix-table td { vertical-align: middle; }
.resource-pill { display: inline-flex; border: 1px solid #dce4ff; color: #233dbd; background: #f4f7ff; border-radius: 999px; padding: 4px 9px; font-weight: 750; font-size: 12px; }
.mini-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800; background: #f1f4f9; color: #647084; white-space: nowrap; }
.mini-green { background: #e9fbf1; color: #0b9c4a; }
.mini-orange { background: #fff3e4; color: #df7b00; }
.resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.resource-card { border: 1px solid var(--line); background: #fbfcff; border-radius: 18px; padding: 16px; }
.resource-card p { color: var(--muted); margin: 10px 0; min-height: 42px; }
.process-list, .responsible-list { display: grid; gap: 14px; }
.process-list div { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: start; }
.process-list span { width: 34px; height: 34px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--primary2)); color: white; font-weight: 900; }
.process-list strong, .process-list small { grid-column: 2; }
.process-list small, .responsible-list small { color: var(--muted); display: block; margin-top: 2px; }
.responsible-list div { border: 1px solid var(--line); background: #fbfcff; border-radius: 16px; padding: 12px; }
@media (max-width: 1280px) { .matrix-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 780px) { .matrix-hero { display: block; } .matrix-hero .btn { margin-top: 16px; } .matrix-filter { grid-template-columns: 1fr; } .resource-grid { grid-template-columns: 1fr; } }
.mini-red { background: #ffecec; color: #d72828; }
.job-payload { max-width: 420px; white-space: pre-wrap; word-break: break-word; }
