:root {
  --bg: #f4f5f7;
  --panel: #fff;
  --border: #dfe1e6;
  --text: #172b4d;
  --muted: #6b778c;
  --brand: #0052cc;
  --brand-dark: #0747a6;
  --danger: #de350b;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(9, 30, 66, .15);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; color: var(--text); background: var(--bg); font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* Sign-in */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #0747a6; }
.auth-card { background: var(--panel); border-radius: 8px; padding: 28px; width: 100%; max-width: 400px; box-shadow: 0 8px 24px rgba(9,30,66,.3); }
.auth-card h1 { margin: 0 0 4px; font-size: 20px; }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.auth-card label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .3px; }
.auth-error { background: #ffebe6; color: #bf2600; padding: 8px 10px; border-radius: var(--radius); font-size: 13px; margin: 12px 0 0; }
.code-input { letter-spacing: 8px; text-align: center; font-size: 20px; font-family: ui-monospace, Menlo, monospace; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.qr { display: grid; place-items: center; padding: 12px 0; }
.qr canvas, .qr img { border: 1px solid var(--border); border-radius: 4px; }
.manual summary { cursor: pointer; font-size: 12px; color: var(--brand); }
.manual code { word-break: break-all; font-size: 11px; }
.btn-block { width: 100%; margin-top: 18px; padding: 10px; }

/* Shell */
.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }
.sidebar { background: var(--brand-dark); color: #deebff; padding: 16px 12px; display: flex; flex-direction: column; overflow-y: auto; }
.brand { font-weight: 700; font-size: 16px; color: #fff; padding: 6px 8px 16px; }
.brand span { opacity: .7; font-weight: 400; }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: var(--radius); color: #deebff; }
.nav-item:hover { background: rgba(255,255,255,.12); }
.nav-item.active { background: rgba(255,255,255,.22); color: #fff; font-weight: 600; }
.nav-item.subtle { opacity: .75; font-size: 13px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; opacity: .6; padding: 14px 10px 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 8px; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.18); padding-top: 10px; margin-top: 10px; }
.who { display: flex; align-items: center; gap: 8px; padding: 4px 10px 8px; font-size: 13px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); padding: 12px 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 18px; }
.spacer { flex: 1; }
.content { flex: 1; overflow: auto; padding: 16px 20px; }

/* Controls */
.btn { border: 1px solid var(--border); background: var(--panel); padding: 6px 12px; border-radius: var(--radius); font-weight: 500; }
.btn:hover { background: #f0f1f4; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { color: var(--danger); }
.input, .select, .textarea { border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; background: #fff; width: 100%; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid #4c9aff; outline-offset: -1px; }
.textarea { min-height: 90px; resize: vertical; font-family: inherit; }
.search { max-width: 240px; }
.select { max-width: 170px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.t-story { background: #e3fcef; color: #006644; }
.t-bug { background: #ffebe6; color: #bf2600; }
.t-task { background: #deebff; color: #0747a6; }
.t-epic { background: #eae6ff; color: #403294; }
.t-support_request { background: #deebff; color: #0747a6; }
.t-isms_incident { background: #ffebe6; color: #bf2600; }
.t-visit { background: #fffae6; color: #974f0c; }
.prio { font-weight: 700; font-size: 12px; }
.p-highest, .p-high { color: #bf2600; }
.p-medium { color: #ff8b00; }
.p-low, .p-lowest { color: #00875a; }
.status { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 3px; text-transform: uppercase; white-space: nowrap; }
.c-todo { background: #dfe1e6; color: #42526e; }
.c-in_progress { background: #deebff; color: #0747a6; }
.c-done { background: #e3fcef; color: #006644; }
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #dfe1e6; font-size: 10px; font-weight: 700; color: var(--text); flex: none; }
.avatar.none { background: transparent; border: 1px dashed currentColor; opacity: .6; }
.key { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }
.chip { font-size: 11px; background: #dfe1e6; border-radius: 3px; padding: 1px 6px; }

/* Board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; align-items: start; }
.column { background: #ebecf0; border-radius: var(--radius); display: flex; flex-direction: column; }
.column.over { background: #dfe8f9; }
.column-head { padding: 10px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); display: flex; justify-content: space-between; }
.column-body { padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 48px; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; border: 1px solid transparent; }
.card:hover { border-color: #b3d4ff; }
.card.dragging { opacity: .45; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.row-gap { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Table */
.table-wrap { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); background: #fafbfc; position: sticky; top: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f4f5f7; }
td.wrap { white-space: normal; min-width: 220px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 14px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 44px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.bar-track { background: #ebecf0; border-radius: 3px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(9,30,66,.54); display: none; justify-content: center; padding: 40px 16px; z-index: 50; overflow-y: auto; }
.overlay.open { display: flex; align-items: flex-start; }
.modal { background: var(--panel); border-radius: 8px; width: 100%; max-width: 900px; box-shadow: 0 8px 24px rgba(9,30,66,.3); }
.modal-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: center; }
.modal-head h2 { margin: 0; font-size: 18px; flex: 1; }
.modal-body { padding: 20px; display: grid; grid-template-columns: 1fr 250px; gap: 24px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .3px; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 20px 0 8px; }
.desc { white-space: pre-wrap; line-height: 1.5; background: #fafbfc; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.comment { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.comment.internal { background: #fffae6; border-color: #ffe380; }
.comment-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; gap: 8px; }
.comment-body { white-space: pre-wrap; line-height: 1.45; }
.log { font-size: 12px; color: var(--muted); padding: 3px 0; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.inline { display: flex; gap: 8px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #172b4d; color: #fff; padding: 10px 16px; border-radius: var(--radius); opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 100; }
.toast.show { opacity: 1; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  #nav { flex-direction: row; flex-wrap: wrap; }
  .modal-body, .two-col { grid-template-columns: 1fr; }
  .search, .select { max-width: none; }
}

.logo-login{display:block;max-height:110px;max-width:220px;margin:0 auto 14px}
.logo-nav{height:26px;width:auto;vertical-align:middle;margin-right:8px;background:#fff;border-radius:4px;padding:2px 4px}
