/* Suvvy PM Dashboard — стиль под платформу Suvvy */
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1a2233;
  --navy: #1a375c;
  --muted: #8a94a6;
  --line: #eaeef4;
  --accent: #4c6fff;
  --accent-soft: #eaf0ff;
  --green: #1faa6b;
  --green-soft: #e6f6ee;
  --amber: #e6a417;
  --amber-soft: #fdf3dc;
  --red: #e0533d;
  --red-soft: #fbe9e6;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(26,55,92,.06), 0 6px 24px rgba(26,55,92,.05);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 240px; background: var(--card); border-right: 1px solid var(--line);
  padding: 24px 16px; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.sidebar .logo { display: flex; align-items: center; gap: 8px; padding: 0 8px 28px; }
.sidebar .logo svg { height: 24px; width: auto; }
.sidebar .logo span { font-weight: 700; color: var(--navy); font-size: 15px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; color: var(--muted); font-weight: 500; margin-bottom: 2px;
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a .ic { width: 18px; text-align: center; }

/* User block in sidebar */
.user-block { background: var(--bg); border-radius: 12px; padding: 12px; margin-bottom: 18px; }
.user-block .u-name { font-weight: 600; color: var(--navy); font-size: 14px; }
.user-block .u-role { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.user-block .u-logout { font-size: 12px; color: var(--accent); font-weight: 600; }
.user-block .u-logout:hover { text-decoration: underline; }

/* Login page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; width: 100%; max-width: 420px; }
.login-user {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-top: 10px; cursor: pointer; font: inherit;
  transition: all .1s;
}
.login-user:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.login-user:disabled { opacity: .5; cursor: not-allowed; }
.login-user .lu-emoji { font-size: 22px; }
.login-user .lu-text { flex: 1; display: flex; flex-direction: column; }
.login-user .lu-name { font-weight: 600; color: var(--navy); }
.login-user .lu-role { font-size: 12px; color: var(--muted); }
.login-user .lu-arrow { color: var(--muted); font-size: 18px; }

/* Main */
.main { flex: 1; padding: 28px 36px; max-width: 1280px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.page-sub { color: var(--muted); margin-bottom: 24px; }

/* Cards */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 18px;
}
.card h3 { font-size: 15px; color: var(--navy); margin-bottom: 14px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-proj-3 { grid-template-columns: 1.1fr 1fr 1.2fr; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Project card (list) */
.proj-card { display: block; transition: transform .08s ease, box-shadow .15s ease; }
.proj-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(26,55,92,.1); }
.proj-card .code { font-family: ui-monospace, monospace; color: var(--accent); font-size: 12px; font-weight: 600; }
.proj-card .name { font-size: 16px; font-weight: 600; color: var(--navy); margin: 4px 0 10px; }
.proj-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 6px; }

/* Progress */
.progress { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; margin-top: 12px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

/* Badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: var(--bg); color: var(--muted); }

/* Stat numbers */
.stats { display: flex; gap: 36px; flex-wrap: wrap; }
.stat .num { font-size: 28px; font-weight: 700; color: var(--navy); }
.stat .lbl { color: var(--muted); font-size: 13px; }

/* Tables / lists */
.list-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.muted { color: var(--muted); }
.navy { color: var(--navy); }

/* Narrative */
.narrative { background: var(--accent-soft); border-radius: 12px; padding: 16px; color: var(--text); line-height: 1.6; }
.blocker { color: var(--red); font-weight: 500; margin-top: 4px; }
.focus { margin-top: 12px; padding: 10px 12px; background: var(--bg); border-radius: 10px; color: var(--text); }
.hot-task { padding: 7px 0; border-bottom: 1px dashed var(--line); display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.hot-task:last-child { border-bottom: none; }
.hot-task.high { font-weight: 500; }

/* Horizontal bars (analytics) */
.hbar-row { display:flex; align-items:center; gap:10px; margin:9px 0; }
.hbar-row .lbl { width:150px; font-size:13px; color:var(--text); flex-shrink:0; }
.hbar-track { flex:1; height:14px; background:var(--bg); border-radius:7px; overflow:hidden; }
.hbar-fill { height:100%; background:var(--accent); border-radius:7px; min-width:2px; }
.hbar-fill.green { background:var(--green); }
.hbar-row .val { width:28px; text-align:right; font-weight:600; color:var(--navy); }

/* Suvvy ranking */
.rank-head, .rank-row { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
.rank-head { color:var(--muted); font-size:12px; font-weight:600; border-bottom:2px solid var(--line); }
.rank-row:last-child { border-bottom:none; }
.rank-row:hover { background:var(--bg); border-radius:8px; }
.rank-head .r-name, .rank-row .r-name { flex:2; }
.rank-head .r-col, .rank-row .r-col { flex:1; text-align:right; }
.rank-row .r-col .up { color:var(--green); font-size:12px; }
.rank-row .r-col .down { color:var(--red); font-size:12px; }

/* Timeline */
.tl-item { padding: 12px 0 12px 18px; border-left: 2px solid var(--line); position: relative; }
.tl-item::before { content:''; position:absolute; left:-6px; top:16px; width:10px; height:10px; border-radius:50%; background: var(--accent); }
.tl-date { font-weight: 600; color: var(--navy); }

/* Metrics */
.metric-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.metric-line:last-child { border-bottom: none; }
.metric-line .v { font-weight: 600; color: var(--navy); }

.back { color: var(--muted); font-size: 13px; margin-bottom: 14px; display: inline-block; }
.tag { font-size: 12px; color: var(--muted); }
.chip { display:inline-block; background: var(--bg); border-radius: 8px; padding: 2px 8px; font-size:12px; margin: 2px 4px 2px 0; }
.decision { padding: 6px 0 6px 14px; }
.dec-date { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 10px; }
.dec-date:first-child { margin-top: 0; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; }
.dot.high{background:var(--red)} .dot.medium{background:var(--amber)} .dot.low{background:var(--muted)}

/* Forms & buttons */
.btn {
  display:inline-block; background: var(--accent); color:#fff; border:none;
  padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: var(--bg); color: var(--navy); }
.btn.red { background: var(--red); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display:block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.form-row { display:flex; gap: 8px; align-items: flex-end; }
.form-row > * { flex: 1; }
.form-row .btn { flex: 0 0 auto; }
.inline-form { display:flex; gap:8px; align-items:center; margin-top: 8px; }
.inline-form select, .inline-form input { flex: 1; }
.toolbar { display:flex; justify-content: space-between; align-items:center; margin-bottom: 20px; }
.alert { background: var(--red-soft); color: var(--red); padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.ok { background: var(--green-soft); color: var(--green); padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.edit-grid { display:grid; grid-template-columns: 1fr; gap: 4px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,55,92,.45);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 50; padding: 48px 16px; overflow: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; max-width: 640px; width: 100%;
  padding: 24px 28px; box-shadow: 0 20px 60px rgba(26,55,92,.25);
}
.modal .close { float: right; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; }
.modal .close:hover { color: var(--text); }
.scroll-list { max-height: 540px; overflow: auto; padding-right: 6px; }
.tl-item.clickable { cursor: pointer; border-radius: 8px; padding-left: 12px; transition: background .1s; }
.tl-item.clickable:hover { background: var(--bg); }
.upd-field { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.upd-field:last-child { border-bottom: none; }
.upd-field .k { color: var(--muted); font-size: 13px; }
.upd-field .v { color: var(--navy); font-weight: 500; }
.raw-text { background: var(--bg); border-radius: 10px; padding: 12px; white-space: pre-wrap; font-size: 13px; color: var(--text); margin-top: 4px; }

/* Workload scale */
.month-nav { display:flex; align-items:center; justify-content:space-between; margin-bottom: 14px; }
.month-nav .m { font-weight: 600; color: var(--navy); font-size: 15px; }
.month-nav a { padding: 4px 12px; border-radius: 8px; background: var(--bg); color: var(--navy); font-weight: 600; }
.month-nav a.disabled { opacity: .35; pointer-events: none; }
.wbar { display:flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--bg); margin: 10px 0; }
.wbar .tickets { background: var(--amber); }
.wbar .projects { background: var(--accent); }
.wlegend { display:flex; gap: 20px; font-size: 13px; }
.wlegend .sw { display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:6px; vertical-align:middle; }
.wlegend .sw.t{background:var(--amber)} .wlegend .sw.p{background:var(--accent)}

/* Monthly chart */
.chart { display:flex; gap: 14px; align-items:flex-end; height: 170px; padding-top: 8px; }
.chart .col { flex:1; display:flex; flex-direction:column; align-items:center; cursor:pointer; border-radius:8px; padding:4px 0; transition: background .1s; }
.chart .col:hover { background: var(--bg); }
.chart .col.active { background: var(--accent-soft); }
.chart .col.active .lbl { color: var(--accent); font-weight: 600; }
.chart .bar {
  width: 100%; max-width: 44px; height: 130px; background: var(--bg);
  border-radius: 8px; overflow: hidden; display:flex; flex-direction: column-reverse;
}
.chart .bar .pr { background: var(--accent); width:100%; }
.chart .bar .t  { background: var(--amber); width:100%; }
.chart .lbl { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* GitHub brief */
.brief-body { white-space: pre-wrap; font-size: 13px; color: var(--text); background: var(--bg); border-radius: 10px; padding: 12px; max-height: 320px; overflow: auto; }
.label-chip { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 14px; padding: 2px 10px; font-size: 12px; margin: 0 4px 4px 0; }
.gh-card-pick { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: all .1s; }
.gh-card-pick:hover { background: var(--bg); border-color: var(--accent); }
.gh-card-pick .t { font-weight: 600; color: var(--navy); }
.gh-card-pick .m { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Accordion (details/summary) */
details.acc { border-top: 1px solid var(--line); margin-top: 8px; }
details.acc > summary {
  cursor: pointer; padding: 10px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--navy); font-weight: 500; font-size: 13px;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after {
  content: "▾"; color: var(--muted); transition: transform .15s; font-size: 12px;
}
details.acc[open] > summary::after { transform: rotate(180deg); }
details.acc > summary:hover { color: var(--accent); }
details.acc .acc-body { padding: 6px 0 12px; }

/* Horizontal stepper */
.stepper { display:flex; align-items:center; flex-wrap:wrap; gap:4px 0; }
.stepper .step { display:flex; align-items:center; gap:8px; }
.stepper .step .dot {
  width:26px; height:26px; border-radius:50%; display:flex; align-items:center;
  justify-content:center; font-size:12px; font-weight:700;
  background:var(--bg); color:var(--muted); border:2px solid var(--line); flex-shrink:0;
}
.stepper .step.done .dot { background:var(--green); color:#fff; border-color:var(--green); }
.stepper .step.current .dot { background:var(--accent); color:#fff; border-color:var(--accent); }
.stepper .step .name { font-size:13px; color:var(--muted); white-space:nowrap; }
.stepper .step.current .name { color:var(--navy); font-weight:600; }
.stepper .step.done .name { color:var(--text); }
.stepper .sep { flex:1; height:2px; background:var(--line); margin:0 10px; min-width:18px; }
.stepper .sep.done { background:var(--green); }
.stepper .sdate { font-size:11px; color:var(--muted); display:block; margin-top:2px; }
/* кликабельный шаг (кнопка) */
.stepper button.step {
  background:none; border:none; font:inherit; padding:4px 6px; border-radius:8px;
  cursor:pointer; transition: background .1s;
}
.stepper button.step:hover { background: var(--accent-soft); }
