:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --ink: #1a1a1a;
  --muted: #666666;
  --line: #d0d0d0;
  --line-strong: #b5b5b5;
  --sidebar-bg: #f7f7f7;
  --orange: #f0b429;
  --orange-deep: #d99912;
  --orange-soft: #ffe6a8;
  --link: #0b57d0;
  --warn-bg: #fff8e8;
  --ok-bg: #e8f5e9;
  --font: "Segoe UI", Tahoma, Arial, sans-serif;
  --mono: Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; border-radius: 0; }
code {
  font-family: var(--mono);
  font-size: 12px;
  background: #f3f3f3;
  border: 1px solid var(--line);
  padding: 1px 5px;
  cursor: pointer;
}

/* ===== top app bar ===== */
.app-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.app-bar-left, .app-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.app-bar-left strong { font-size: 14px; font-weight: 600; }
.app-role {
  color: var(--muted);
  font-size: 13px;
}
.app-org { color: var(--muted); font-size: 13px; }
.app-logout {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  background: var(--orange);
  border: 1px solid var(--orange-deep);
  color: #1a1a1a;
  font-weight: 600;
  font-size: 13px;
}
.app-logout:hover { filter: brightness(1.05); }

/* ===== shell ===== */
.shell {
  display: grid;
  grid-template-columns: 252px 1fr;
  min-height: calc(100vh - 44px);
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  padding: 0.5rem 0.45rem 0.85rem 0.85rem;
}
.side-filter { margin-bottom: 0.4rem; padding: 0 0.15rem; }
.side-filter input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 0.32rem 0.45rem;
  outline: none;
}
.side-filter input:focus { border-color: #888; }

.side-nav { display: grid; gap: 0; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.36rem 0.45rem;
  color: #222;
  font-size: 13px;
  border: 1px solid transparent;
  line-height: 1.25;
}
.side-nav a .nav-ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
}
.side-nav a .nav-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}
.side-nav a em {
  margin-left: auto;
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}
.side-nav a:hover { background: #ececec; }
.side-nav a.active {
  font-weight: 600;
  background: transparent;
  border-color: transparent;
  box-shadow: inset 3px 0 0 #c98a4a;
}
.side-nav a.nav-lk {
  margin-bottom: 0.05rem;
}
.side-nav a.nav-news {
  margin-bottom: 0.12rem;
}
.side-nav a.nav-crm {
  margin-bottom: 0.18rem;
}
.side-nav a.nav-ads {
  margin-bottom: 0.12rem;
}
.side-nav a.nav-dev {
  margin-top: 0.22rem;
}
.side-nav a.nav-ratings {
  margin-top: 0.05rem;
}
.side-nav a.nav-msg {
  margin-top: 0.18rem;
}
.side-nav a.nav-msg .msg-unread-badge {
  margin-left: auto;
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  background: none;
  border: 0;
  padding: 0;
  min-width: 0;
  height: auto;
  line-height: inherit;
  box-shadow: none;
  border-radius: 0;
}
.side-nav a.nav-msg .msg-unread-badge[hidden] {
  display: none !important;
}
.side-nav a.nav-backups {
  margin-top: 0.05rem;
}
.side-nav a.nav-downloads {
  margin-top: 0.05rem;
}
.side-nav a.nav-settings {
  margin-top: 0.28rem;
}

.wip-panel {
  max-width: 40rem;
  margin-top: 0.5rem;
}
.wip-badge {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid #e0a800;
  background: #fff4ce;
  color: #7a5300;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.wip-panel h2 {
  margin: 0 0 0.55rem;
  font-size: 18px;
}
.wip-panel p {
  margin: 0 0 0.55rem;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

.shell-messenger {
  height: calc(100vh - 44px);
  min-height: calc(100vh - 44px);
}
.messenger-main {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  min-height: 0;
  overflow: hidden;
}
.messenger-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}
.messenger-toolbar strong {
  display: block;
  font-size: 14px;
}
.messenger-toolbar .muted-line {
  margin-top: 0.1rem;
}
.messenger-open-ext {
  font-size: 12px;
  font-weight: 600;
  color: var(--link);
  white-space: nowrap;
}
.messenger-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #f7f8fa;
}

.main {
  background: #fff;
  padding: 1rem 1.15rem 1.6rem;
  min-width: 0;
}

.page-title {
  margin: 0 0 0.2rem;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-sub {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 13px;
}
.back-link {
  display: inline-flex;
  margin: 0 0 0.9rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fff, #ececec);
  font-size: 13px;
  font-weight: 600;
}
.back-link:hover { background: #e8f2fc; border-color: #7eb4ea; }

/* ===== filters ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.8rem;
  align-items: flex-end;
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.75rem;
  background: #fafafa;
  border: 1px solid var(--line);
}
.flt {
  display: grid;
  gap: 0.25rem;
  min-width: 160px;
}
.flt span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.flt input,
.flt select {
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 0.4rem 0.5rem;
  min-width: 180px;
  outline: none;
}
.flt input:focus,
.flt select:focus { border-color: #777; }
.flt-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.filters button,
.btn {
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fff, #e8e8e8);
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.filters button:hover,
.btn:hover {
  background: #e8f2fc;
  border-color: #7eb4ea;
}
.btn-reset {
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fff, #e8e8e8);
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  font-size: 13px;
}
.btn-reset:hover {
  background: #e8f2fc;
  border-color: #7eb4ea;
}

/* ===== data table ===== */
.table-wrap {
  border: 1px solid var(--line);
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  background: #efefef;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #e0e0e0;
  padding: 0.5rem 0.65rem;
  font-weight: 600;
  white-space: nowrap;
}
.data-table th:last-child,
.data-table td:last-child { border-right: 0; }
.data-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #ececec;
  border-right: 1px solid #f0f0f0;
  vertical-align: top;
}
.data-table tbody tr:nth-child(even) { background: #f7f7f7; }
.data-table tbody tr:hover { background: #fff4d6; }
.data-table tbody tr.row-warn { background: var(--warn-bg); }
.data-table tbody tr.row-done { opacity: 0.7; }
.data-table tbody tr.row-timer-warn { background: #fff8e8; }
.data-table tbody tr.row-timer-danger {
  background: #fdecea;
  box-shadow: inset 3px 0 0 #c62828;
}
.data-table tbody tr.row-timer-warn:hover { background: #fff0d0; }
.data-table tbody tr.row-timer-danger:hover { background: #f9d6d4; }
.timer-cell { text-align: center; vertical-align: middle; }
.task-flag {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  color: #8a93a0;
  min-width: 3.2rem;
}
.task-flag svg {
  width: 22px;
  height: 22px;
  display: block;
}
.task-flag em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  max-width: 4.5rem;
  color: inherit;
}
.task-flag.flag-ok { color: #2e7d32; }
.task-flag.flag-warn { color: #ef6c00; }
.task-flag.flag-danger {
  color: #c62828;
  animation: flag-pulse 1.4s ease-in-out infinite;
}
.task-flag.flag-done { color: #607d8b; }
.task-flag.flag-none { color: #9aa3ad; }
.chip-due {
  background: #f3f6f9;
  border-color: #c5ced9;
  color: #455a64;
}
.timer-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  background: #f7f9fb;
}
.timer-banner .task-flag { min-width: auto; }
.timer-banner .task-flag svg { width: 28px; height: 28px; }
.timer-banner strong { font-size: 14px; }
.timer-banner.flag-ok {
  background: #eef7ee;
  border-color: #b7d7b7;
  color: #1b5e20;
}
.timer-banner.flag-warn {
  background: #fff8e8;
  border-color: #e6d2a8;
  color: #7a4a12;
}
.timer-banner.flag-danger {
  background: #fdecea;
  border-color: #f1b6bb;
  color: #8b1e1e;
}
.timer-banner.flag-done {
  background: #f3f3f3;
  border-color: #d0d0d0;
  color: #455a64;
}
@keyframes flag-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.name-link {
  color: #111;
  font-weight: 600;
}
a.name-link:hover { color: var(--link); text-decoration: underline; }
.url-link {
  color: var(--link);
  word-break: break-all;
}
.url-link:hover { text-decoration: underline; }
.muted-line {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.chip {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--line);
  background: #f3f3f3;
  font-size: 12px;
  white-space: nowrap;
}
.chip-urgent { background: #fde7e9; border-color: #f1b6bb; color: #a4262c; }
.chip-high { background: #fff4ce; border-color: #f0d889; color: #835c00; }
.chip-normal { background: #e8f3ff; border-color: #9ec9f5; color: #0b5cab; }
.chip-low { background: #f3f3f3; border-color: #c8c8c8; color: #666; }
.row-action {
  color: var(--link);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
}
.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem !important;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 0.75rem;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.85rem 0.9rem 1rem;
}
.panel h2 {
  margin: 0 0 0.65rem;
  font-size: 15px;
}
.panel h3 {
  margin: 0.9rem 0 0.45rem;
  font-size: 13px;
  color: #333;
}
.kv { margin: 0; display: grid; gap: 0.45rem; }
.kv > div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.45rem;
}
.kv dt { margin: 0; color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; word-break: break-word; font-size: 13px; }
.note-block {
  margin: 0;
  padding: 0.65rem 0.7rem;
  background: var(--warn-bg);
  border: 1px solid #e6d2a8;
  color: #5f4718;
  font-size: 13px;
  line-height: 1.45;
}
.hint { margin: -0.15rem 0 0.7rem; color: var(--muted); font-size: 12px; }

.access-list { display: grid; gap: 0.55rem; }
.access-row {
  border: 1px solid var(--line);
  background: #fafafa;
}
.access-row.legacy { background: #f7f4ea; }
.access-kind {
  padding: 0.35rem 0.6rem;
  background: #efefef;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}
.access-body {
  padding: 0.55rem 0.6rem;
  display: grid;
  gap: 0.3rem;
}
.access-body > div {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 0.4rem;
  align-items: center;
}
.access-body span { color: var(--muted); font-size: 12px; }
.reveal {
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 0.18rem 0.45rem;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.status-chips a,
.status-chips .chip-open {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  background: #f3f3f3;
  font-size: 12px;
  font-weight: 600;
}
.status-chips a:hover { background: #fff4d6; }
.status-chips a.on {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
.status-chips .chip-open {
  background: #fff4ce;
  border-color: #f0d889;
  color: #835c00;
}

.kind-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}
.kind-opt {
  display: inline-flex;
  cursor: pointer;
}
.kind-opt input { display: none; }
.kind-opt span {
  display: inline-flex;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
}
.kind-opt input:checked + span {
  background: var(--orange-soft);
  border-color: #e0a800;
}
.kind-hint {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 12px;
}
.fld-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.mono, .mono-link {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.mono-link { color: var(--link); }
.mono-link:hover { text-decoration: underline; }

.chip-critical { background: #fde7e9; border-color: #f1b6bb; color: #a4262c; }
.chip-high { background: #fff4ce; border-color: #f0d889; color: #835c00; }
.chip-normal { background: #e8f3ff; border-color: #9ec9f5; color: #0b5cab; }
.chip-low { background: #f3f3f3; border-color: #c8c8c8; color: #666; }

.inline-form, .stack-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.35rem;
}
.stack-form {
  flex-direction: column;
  align-items: stretch;
}
.inline-form select,
.stack-form textarea,
.stack-form input[type="file"],
.inline-form button,
.stack-form button {
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 0.4rem 0.55rem;
}
.inline-form button,
.stack-form button {
  background: linear-gradient(180deg, #fff, #e8e8e8);
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
}
.file-list {
  margin: 0 0 0.6rem;
  padding-left: 1.1rem;
}
.file-list li { margin-bottom: 0.25rem; }
.comments { display: grid; gap: 0.45rem; margin-bottom: 0.55rem; }
.comment {
  border: 1px solid var(--line);
  background: #fafafa;
  padding: 0.45rem 0.55rem;
}
.comment-meta { font-size: 12px; color: var(--muted); margin-bottom: 0.2rem; }
.comment-text { font-size: 13px; white-space: pre-wrap; }
.btn-action {
  border: 1px solid #2e7d32 !important;
  background: linear-gradient(180deg, #e8f5e9, #c8e6c9) !important;
  color: #1b5e20 !important;
  font-weight: 700 !important;
}
.note-ok {
  background: #e8f5e9 !important;
  border-color: #9fd89f !important;
  color: #0b5a0b !important;
}
.comment-done {
  background: #e8f5e9;
  border-color: #9fd89f;
}

.dev-targets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
.dev-target {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.6rem;
  background: #fff;
  border: 1px solid var(--line);
  min-width: 0;
}
.dev-target:hover { background: #fff8e8; border-color: #e0a800; }
.dev-target strong { font-size: 13px; }
.dev-target span { color: var(--muted); font-size: 12px; }
.dev-target em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--link);
  word-break: break-all;
}
.dev-target b {
  margin-top: 0.2rem;
  font-size: 12px;
  color: #0b5a0b;
  font-weight: 700;
  display: inline-block;
  width: fit-content;
  padding: 0.18rem 0.45rem;
  background: #dff6dd;
  border: 1px solid #9fd89f;
}

.dev-layout {
  display: grid;
  grid-template-columns: minmax(320px, max-content) 1fr;
  gap: 0.75rem;
  align-items: start;
}
.dev-form.panel {
  overflow: visible;
  width: fit-content;
  min-width: 320px;
  max-width: 780px;
}
.dev-form { display: grid; gap: 0.3rem; }
.dev-form h2 { margin: 0 0 0.35rem; font-size: 15px; }
.dev-form label {
  margin-top: 0.3rem;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.dev-form input,
.dev-form select,
.dev-form textarea {
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 0.4rem 0.5rem;
  width: 100%;
  outline: none;
  resize: vertical;
}
.description-field-wrap {
  overflow: visible;
  position: relative;
  z-index: 2;
}
.description-resize-hint {
  margin: 0.15rem 0 0;
  font-size: 10px;
  color: #888;
}
.description-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.3rem;
}
.description-toolbar .description-label {
  margin-top: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.dev-form textarea.description-field {
  resize: both !important;
  display: block;
  width: 300px;
  min-width: 280px;
  max-width: 760px;
  min-height: 140px;
  overflow: auto;
  box-sizing: border-box;
}
.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fff, #eef4fb);
  padding: 0.22rem 0.45rem;
  font-size: 11px;
  font-weight: 600;
  color: #1a4a7a;
  cursor: pointer;
  white-space: nowrap;
}
.voice-btn:hover:not(:disabled) {
  background: #e8f2fc;
  border-color: #7eb4ea;
}
.voice-btn.is-listening {
  background: #fff0f0;
  border-color: #e07070;
  color: #a01818;
  animation: voice-pulse 1.2s ease-in-out infinite;
}
.voice-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.voice-hint {
  margin: 0.25rem 0 0;
  font-size: 11px;
  color: #555;
  font-style: italic;
}
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 112, 112, 0.35); }
  50% { box-shadow: 0 0 0 4px rgba(224, 112, 112, 0.12); }
}
.dev-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.dev-form button {
  margin-top: 0.45rem;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fff, #e8e8e8);
  padding: 0.45rem 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.dev-form button:hover {
  background: #e8f2fc;
  border-color: #7eb4ea;
}
.status-form select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 0.3rem 0.35rem;
}
.task-desc {
  margin-top: 0.35rem;
  color: #333;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
}

/* ===== login (eagle) ===== */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 5.5rem;
  position: relative;
  overflow: hidden;
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fa 55%, #eef1f4 100%);
}
.auth-glow {
  pointer-events: none;
  position: absolute;
  inset: 0 0 auto 0;
  height: 10rem;
  background: linear-gradient(180deg, rgba(255, 196, 77, 0.12) 0%, transparent 100%);
}
.auth-stage {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.auth-eagle-wrap {
  width: 100%;
  max-width: 420px;
  margin-bottom: 1.35rem;
  background: #fff;
  padding: 0.75rem;
}
.auth-eagle {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
}
.auth-kicker {
  margin: 0 0 0.75rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #b8860b;
}
.auth-brand {
  margin: 0 0 0.45rem;
  font-size: clamp(2rem, 5vw, 2.35rem);
  font-weight: 700;
  color: #1c2733;
}
.auth-product {
  margin: 0 0 1.35rem;
  font-size: 15px;
  font-weight: 600;
  color: #6b7c8e;
}
.auth-lead {
  margin: 0 0 1.25rem;
  max-width: 26rem;
  font-size: 15px;
  line-height: 1.55;
  color: #3a4654;
}
.auth-form {
  width: min(280px, 100%);
  display: grid;
  gap: 0.35rem;
  text-align: left;
}
.auth-form label {
  font-size: 0.82rem;
  color: #6b7c8e;
  font-weight: 600;
}
.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-pass-wrap input {
  border: 1px solid #c5ced9;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.4rem;
  background: #fff;
  outline: none;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}
.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus,
.auth-pass-wrap input:focus {
  border-color: #c98a4a;
  box-shadow: 0 0 0 3px rgba(255, 181, 106, 0.28);
}
.auth-pass-wrap {
  position: relative;
  margin-bottom: 0.15rem;
}
.auth-pass-wrap input {
  padding-right: 2.6rem;
  margin-bottom: 0.35rem;
}
.auth-eye {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(calc(-50% - 0.1rem));
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: #6b7c8e;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.auth-eye:hover { color: #3a4654; }
.auth-eye svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}
.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.15rem 0 0.55rem;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  color: #3a4654 !important;
  cursor: pointer;
  user-select: none;
}
.auth-remember input {
  width: auto !important;
  margin: 0 !important;
  accent-color: #c98a4a;
}
.auth-form button[type="submit"] {
  border: 1px solid #c98a4a;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, #ffe2bf 0%, #ffc889 45%, #ffb56a 100%);
  color: #3a2a12;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.auth-error {
  width: min(280px, 100%);
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  background: #f4e2e2;
  color: #8b2e2e;
  font-size: 0.88rem;
  font-weight: 600;
}
.auth-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid #e8e8e8;
  background: rgba(255,255,255,0.9);
  padding: 1rem 1.25rem;
  text-align: center;
  color: #8b97a8;
  font-size: 11px;
  line-height: 1.5;
}
.auth-footer a { color: #6b7c8e; font-weight: 600; }

/* ===== pulse (PM board) ===== */
.pulse-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.85rem 0 1rem;
}
.pulse-kpi {
  border: 1px solid var(--line);
  background: #fafafa;
  padding: 0.65rem 0.7rem;
  display: grid;
  gap: 0.2rem;
}
.pulse-kpi span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.25;
}
.pulse-kpi strong {
  font-size: 1.45rem;
  font-weight: 700;
  color: #1c2733;
}
.pulse-kpi.warn { background: #fff8e8; border-color: #e6d2a8; }
.pulse-kpi.work { background: #e7f2ff; border-color: #9ec9f5; }
.pulse-kpi.risk { background: #f8ecec; border-color: #e0b4b4; }
.pulse-kpi.ok { background: #eef7ee; border-color: #b7d7b7; }
.pulse-kpi.attn { background: #fff3e0; border-color: #f0c090; }
.pulse-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.pulse-block { margin-bottom: 0.75rem; }
.pulse-note-form textarea {
  width: 100%;
  border: 1px solid #c5ced9;
  padding: 0.65rem 0.7rem;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
  min-height: 6rem;
  box-sizing: border-box;
}
.pulse-note-meta {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.pulse-note-meta button {
  border: 1px solid #c98a4a;
  padding: 0.45rem 0.85rem;
  background: linear-gradient(180deg, #ffe2bf 0%, #ffc889 45%, #ffb56a 100%);
  color: #3a2a12;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.pulse-table td,
.pulse-table th { font-size: 12px; vertical-align: top; }
.pulse-tag {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.15rem 0.4rem;
  background: #fff3e0;
  border: 1px solid #f0c090;
  font-size: 11px;
  font-weight: 600;
  color: #7a4a12;
}
.pulse-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.pulse-list li {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #eee;
}
.pulse-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.pulse-list a { font-weight: 600; font-size: 13px; }
.pulse-list span { color: var(--muted); font-size: 12px; }
.pulse-done {
  max-width: 28rem;
  white-space: pre-wrap;
  line-height: 1.4;
}
.flash-ok {
  margin: 0.65rem 0;
  padding: 0.55rem 0.7rem;
  background: #eef7ee;
  border: 1px solid #b7d7b7;
  color: #1b5e20;
  font-size: 13px;
  font-weight: 600;
}
.flash-err {
  margin: 0.65rem 0;
  padding: 0.55rem 0.7rem;
  background: #f8ecec;
  border: 1px solid #e0b4b4;
  color: #7f1d1d;
  font-size: 13px;
  font-weight: 600;
}
.empty-line {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ===== users page (Windows sample layout) ===== */
.users-page .page-title {
  margin: 0 0 0.55rem;
  font-size: 22px;
  font-weight: 700;
}

.users-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 0.95rem;
  margin-bottom: 0.95rem;
  border: 1px solid #b0b0b0;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #efefef 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 1px 2px rgba(0, 0, 0, 0.08);
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
}
.users-back:hover {
  background: linear-gradient(180deg, #f7fbff 0%, #e6eef8 100%);
  border-color: #8aa8d0;
}

.users-card {
  background: #fff;
  border: 1px solid #d5d5d5;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.users-card-head {
  padding: 0.55rem 0.85rem;
  background: linear-gradient(180deg, #f6f6f6, #ececec);
  border-bottom: 1px solid #d8d8d8;
  font-size: 13px;
  font-weight: 700;
}
.users-list-card {
  padding: 0;
}

.users-form {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr 1fr auto;
  gap: 0.65rem 0.75rem;
  align-items: end;
  padding: 0.85rem;
}
.users-field {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}
.users-field > span {
  font-size: 12px;
  font-weight: 600;
  color: #666;
}
.users-field > span em {
  font-style: normal;
  font-weight: 500;
  color: #999;
}
.users-field input,
.users-field select {
  width: 100%;
  height: 34px;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  background: #fff;
  padding: 0 0.55rem;
  outline: none;
}
.users-field input:focus,
.users-field select:focus {
  border-color: #7aa2d8;
  box-shadow: 0 0 0 2px rgba(122, 162, 216, 0.25);
}

.users-form-submit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 1px;
}
.users-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 92px;
  padding: 0 0.95rem;
  border: 1px solid #b0b0b0;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #efefef 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 1px 2px rgba(0, 0, 0, 0.08);
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.users-btn:hover {
  background: linear-gradient(180deg, #f7fbff 0%, #e6eef8 100%);
  border-color: #8aa8d0;
}
.users-btn:active {
  background: #e8e8e8;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
.users-btn-ghost {
  background: linear-gradient(180deg, #fff, #f3f3f3);
}

.users-roles-hint {
  margin: 0;
  padding: 0 0.85rem 0.75rem;
  color: #777;
  font-size: 12px;
  line-height: 1.45;
  font-style: italic;
}

.users-table-wrap { overflow: auto; }
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.users-table th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #e4e4e4;
  color: #666;
  font-weight: 600;
  font-size: 12px;
  background: #fafafa;
  white-space: nowrap;
}
.users-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid #efefef;
  vertical-align: middle;
}
.users-table tbody tr:last-child td { border-bottom: 0; }
.users-table tbody tr:hover { background: #fcfcfc; }

.role-badge,
.status-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.role-badge.role-admin { background: #ffe8cc; color: #8a4b00; }
.role-badge.role-project_manager { background: #e8ddf8; color: #4a2d7a; }
.role-badge.role-programmer { background: #dceeff; color: #0b4f8a; }
.role-badge.role-viewer { background: #e8e8e8; color: #555; }
.status-badge { background: #e5f6ea; color: #1b7a3a; }

.users-actions {
  white-space: nowrap;
  text-align: right;
}
.users-actions a,
.users-actions button {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: #e67e22;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.users-actions a:hover,
.users-actions button:hover { text-decoration: underline; }
.users-actions form {
  display: inline;
  margin: 0;
  padding: 0;
}
.users-actions a + form::before,
.users-actions a + a::before {
  content: " ";
  white-space: pre;
}
.users-actions a + form {
  margin-left: 0.65rem;
}

.you-tag {
  margin-left: 0.35rem;
  font-style: normal;
  font-size: 11px;
  color: #0b57d0;
  font-weight: 700;
}


/* ===== ratings / task score badges ===== */
.task-score-badge {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.15rem 0.5rem;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.task-score-badge.s5 { background: #e5f6ea; color: #1b7a3a; border-color: #b7d7b7; }
.task-score-badge.s4 { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.task-score-badge.s3 { background: #fff8e8; color: #8a5a00; border-color: #e6d2a8; }
.task-score-badge.s2 { background: #fff3e0; color: #b35c00; border-color: #f0c090; }
.task-score-badge.s1 { background: #fdecea; color: #b71c1c; border-color: #f0b4b4; }

.rating-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.rating-opt input { position: absolute; opacity: 0; pointer-events: none; }
.rating-opt span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 32px;
  padding: 0 0.45rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}
.rating-opt input:checked + span,
.rating-opt span:hover {
  background: #fff8e8;
  border-color: #d99912;
  color: #8a5a00;
}
.chip-busy {
  display: inline-block;
  font-size: 11px;
  padding: 0.12rem 0.4rem;
  background: #e8f2fc;
  border: 1px solid #9ec9f5;
  color: #0d47a1;
  font-weight: 600;
}
.task-actions-cell { min-width: 130px; }
.take-form { margin: 0; }
.btn-take { background: linear-gradient(180deg, #e8f5e9, #c8e6c9) !important; border-color: #2e7d32 !important; color: #1b5e20 !important; }
.btn-close { background: linear-gradient(180deg, #fff8e8, #ffe082) !important; border-color: #e0a800 !important; color: #6d4c00 !important; }
.assign-form select { min-width: 220px; }

/* Messenger contour notifications — compact envelope, bottom-left */
.msg-notify-host {
  position: fixed !important;
  left: 14px !important;
  right: auto !important;
  top: auto !important;
  bottom: 14px !important;
  z-index: 120;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
  max-width: 340px;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
.msg-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: #2a2f2b;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 8px 22px rgba(24, 32, 27, 0.1);
  padding: 6px 8px 6px 6px;
  border-radius: 10px;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.msg-toast.is-in {
  transform: translateY(0);
  opacity: 1;
}
.msg-toast.is-out {
  transform: translateY(8px);
  opacity: 0;
}
.msg-toast-open {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
}
.msg-mail-badge {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #FFF6D6;
  border: 1px solid #E8D48A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.msg-mail-ico {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px;
  max-height: 18px;
  display: block;
}
.msg-toast-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.msg-toast-from {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #8a6d12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-toast-body {
  font-size: 12px;
  color: #4a524c;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.msg-toast-read {
  appearance: none;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #9aa19b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.msg-toast-read:hover {
  color: #18201b;
  background: rgba(24, 32, 27, 0.06);
}

@media (max-width: 1100px) {
  .users-form {
    grid-template-columns: 1fr 1fr;
  }
  .users-form-submit {
    grid-column: 1 / -1;
  }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .detail-grid, .dev-layout, .pulse-grid { grid-template-columns: 1fr; }
  .dev-targets { grid-template-columns: 1fr 1fr; }
  .pulse-kpis { grid-template-columns: 1fr 1fr 1fr; }
  .users-form { grid-template-columns: 1fr; }
  .app-bar { align-items: flex-start; flex-direction: column; }
  .msg-notify-host {
    left: 10px !important;
    bottom: 10px !important;
  }
}
