:root {
  --bg: #e8ecf1;
  --card: #fff;
  --border: #c5cdd8;
  --border-light: #dde3ea;
  --text: #111;
  --text-muted: #111;
  --blue: #4a7cbf;
  --blue-dark: #3a6aaf;
  --blue-light: #e8f0fa;
  --green: #5cb85c;
  --green-dark: #4cae4c;
  --red: #d9534f;
  --orange: #f0ad4e;
  --header-h: 48px;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", -apple-system, sans-serif;
  font-size: 15px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { background: var(--bg); color: var(--text); min-height: 100vh; }

input, select, textarea {
  color: var(--text);
}
input::placeholder,
textarea::placeholder {
  color: #444;
}

.hidden { display: none !important; }

/* ── Login ── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dce6f5, #e8ecf1);
}
.login-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem 2.5rem;
  width: 360px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.login-box h1 { font-size: 1.25rem; color: var(--blue); margin-bottom: .25rem; }
.login-box > p { color: var(--text); font-size: .85rem; margin-bottom: 1.5rem; }
.login-box label { display: block; font-size: .8rem; color: var(--text); font-weight: 600; margin: .6rem 0 .2rem; }
.login-box input {
  width: 100%;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .9rem;
}
.error-text { color: var(--red); font-size: .8rem; margin-top: .5rem; }

/* ── Header ── */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.app-header {
  height: var(--header-h);
  background: linear-gradient(180deg, #5a8fd4, var(--blue));
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.header-left { display: flex; align-items: center; gap: .5rem; }
.header-left h1 { font-size: 1rem; font-weight: 600; }
.header-logo { font-size: 1.1rem; }
.header-stats { display: flex; gap: .5rem; flex: 1; justify-content: center; flex-wrap: wrap; }
.stat-tab {
  background: rgba(255,255,255,.15);
  padding: .2rem .65rem;
  border-radius: 4px;
  font-size: .78rem;
  white-space: nowrap;
}
.stat-tab strong { margin-left: .2rem; }
.header-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.user-name { font-size: .85rem; opacity: .9; }

.settings-wrap { position: relative; }
.settings-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: .35rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .75rem;
  width: 220px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  z-index: 100;
  color: var(--text);
}
.settings-panel h4 { font-size: .8rem; margin-bottom: .5rem; color: var(--blue); }
.settings-panel input {
  width: 100%;
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .8rem;
  margin-bottom: .4rem;
}

/* ── Workspace: 좌측 패널 + 우측 ── */
.workspace {
  flex: 1;
  display: flex;
  gap: 8px;
  padding: 8px;
  overflow: hidden;
  min-height: 0;
}

.panel-left {
  width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.panel-left .project-list-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel-left .card-grow { flex: 0 0 auto; max-height: 42%; min-height: 180px; }

.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
}
.panel-right .card-dashboard {
  flex: 0 0 auto;
  min-height: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.panel-right .card-dashboard .card-body { padding: 0; }

.right-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
}
.right-content-split {
  display: flex;
  gap: 8px;
  flex: 1;
  min-height: 0;
}
.left-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
}
.card-grow-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.budget-card {
  width: 42%;
  min-width: 280px;
  max-width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.budget-body {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  min-height: 0;
}
.budget-top {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
  align-items: stretch;
}
.budget-summary {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .45rem .5rem;
  background: #f5f7fa;
  border: 1px solid var(--border-light);
  border-radius: 6px;
}
.budget-sum-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  color: var(--text);
}
.budget-sum-item span { font-weight: 500; }
.budget-sum-item b { font-weight: 700; }
.budget-sum-item.balance b { color: var(--blue-dark); }
.budget-sum-item.balance.negative b { color: var(--red); }
.budget-form {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.budget-form input {
  width: 100%;
  padding: .28rem .4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .78rem;
  font-family: inherit;
}
.budget-amount-row {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.budget-amount-row #be-amount {
  flex: 1;
  min-width: 0;
}
.budget-amount-row .reg-form-actions {
  flex-shrink: 0;
  display: flex;
  gap: .2rem;
}
.input-money { text-align: right; }
.num-col { text-align: right; }
.data-table td.num-col { text-align: right; font-weight: 600; }
.card-grow { display: flex; flex-direction: column; min-height: 0; }
.table-scroll { flex: 1; overflow: auto; min-height: 0; }
.issue-body { display: flex; flex-direction: column; min-height: 0; }

@media (max-width: 1100px) {
  .workspace { flex-direction: column; overflow: auto; }
  .panel-left { width: 100%; max-height: none; }
  .panel-left .list-body { max-height: 140px; }
  .right-content-split { flex-direction: column; }
  .budget-card { width: 100%; max-width: none; }
  .budget-top { flex-direction: column; }
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .65rem;
  background: #f5f7fa;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.card-titlebar.blue { background: var(--blue-light); border-bottom-color: #b8d4f0; }
.card-titlebar.green { background: #e8f5e9; border-bottom-color: #c8e6c9; }
.card-title { font-weight: 600; font-size: .85rem; color: var(--text); }
.card-titlebar.blue .card-title { color: var(--blue-dark); }
.card-titlebar.green .card-title { color: #2e7d32; }
.card-actions { display: flex; gap: .25rem; }
.card-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; padding: .5rem; min-height: 0; }

/* ── Tables ── */
.search-input {
  width: 100%;
  padding: .3rem .5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .8rem;
  margin-bottom: .4rem;
}
.list-table-wrap { flex: 1; overflow: auto; min-height: 0; }
.list-table-wrap.tall { max-height: none; }
.list-table, .data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}
.list-table th, .data-table th {
  background: #f0f3f7;
  padding: .35rem .4rem;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1;
}
.list-table td, .data-table td {
  padding: .35rem .4rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text);
}
.list-table tbody tr { cursor: pointer; }
.list-table tbody tr:hover { background: #f0f7ff; }
.list-table tbody tr.active { background: #d6e8ff; font-weight: 600; }
.data-table tbody tr.active { background: #e8f4ff; }
.desc-cell { max-width: 120px; color: var(--text); font-size: .75rem; }
.data-table.compact td, .data-table.compact th { padding: .25rem .35rem; }

.row-actions { display: flex; gap: .2rem; white-space: nowrap; }
.btn-row {
  padding: .15rem .35rem;
  font-size: .7rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  color: var(--text);
}
.btn-row:hover { background: #f0f3f7; }
.btn-row.del:hover { background: #fde8e8; color: var(--red); border-color: #f5c6c6; }
.sched-status-select {
  font-size: inherit;
  padding: .1rem;
}
.reg-select-sm {
  padding: .28rem .35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .78rem;
  font-family: inherit;
  min-width: 4.5rem;
  color: var(--text);
}
.reg-form-actions {
  display: flex;
  gap: .25rem;
  flex-shrink: 0;
}
.list-row-clickable { cursor: pointer; }
.list-row-clickable:hover { background: #f0f7ff; }
.data-table tbody tr.list-row-clickable.active { background: #d6e8ff; font-weight: 600; }

/* ── Forms ── */
.detail-form { display: flex; flex-direction: column; height: 100%; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem .5rem;
  flex: 1;
  overflow-y: auto;
  align-content: start;
}
.form-grid.tight { gap: .3rem; }
.field label { display: block; font-size: .72rem; color: var(--text); font-weight: 600; margin-bottom: .1rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: .3rem .45rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .8rem;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(74,124,191,.15);
}
.field.span-2 { grid-column: span 2; }
.compact-form .field { margin-bottom: .35rem; }
.compact-form .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
}
.progress-mini {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .25rem 0 .35rem;
}
.progress-mini-bar {
  flex: 1;
  height: 6px;
  background: #e8ecf1;
  border-radius: 3px;
  overflow: hidden;
}
.progress-mini-bar > div {
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
  width: 0%;
  transition: width .2s;
}
.progress-mini span { font-size: .72rem; color: var(--text); min-width: 2rem; }

/* Project list tabs */
.proj-tabs {
  display: flex;
  gap: 2px;
  padding: 0 .4rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.proj-tab {
  flex: 1;
  padding: .35rem .25rem;
  border: none;
  background: transparent;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}
.proj-tab:hover { background: #f5f7fa; }
.proj-tab.active { color: var(--blue-dark); border-bottom-color: var(--blue); font-weight: 700; }
.proj-tab span { font-weight: 600; }
.proj-list {
  list-style: none;
  margin: 0;
  padding: .35rem;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.proj-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  padding: .4rem .45rem;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  margin-bottom: 4px;
  background: #fff;
  font-size: .78rem;
}
.proj-item:hover { background: #fafbfc; }
.proj-item.active { border-color: var(--blue); background: #f0f7ff; }
.proj-item-main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
}
.proj-item-name {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj-item-pct { font-size: .68rem; color: var(--text); font-weight: 600; flex-shrink: 0; }
.proj-item-actions { display: flex; gap: 3px; flex-shrink: 0; }
.btn-move {
  padding: .15rem .35rem;
  font-size: .65rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #f5f7fa;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.btn-move:hover { background: #e8f0fa; border-color: var(--blue); color: var(--blue-dark); }
.proj-empty {
  padding: .75rem;
  text-align: center;
  color: var(--text);
  font-size: .75rem;
}
.hint-text { font-size: .8rem; color: var(--text); text-align: center; padding: 1rem .5rem; }

/* Layer popup */
.layer-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 25, 45, .45);
  display: flex; align-items: center; justify-content: center;
  z-index: 5000;
  backdrop-filter: blur(2px);
}
.layer-popup {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  overflow: hidden;
}
.layer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem;
  background: linear-gradient(135deg, #5a8fd4, var(--blue));
  color: #fff;
}
.layer-header h2 { font-size: 1rem; font-weight: 600; }
.layer-close {
  background: rgba(255,255,255,.2); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; line-height: 1;
}
.layer-body { padding: 1rem; }
.layer-footer { display: flex; gap: .5rem; justify-content: flex-end; padding-top: .75rem; margin-top: .5rem; border-top: 1px solid var(--border-light); }
.btn-ghost { background: #f0f3f7; color: var(--text); border: 1px solid var(--border); }

/* Dashboard */
.dashboard-body { overflow: visible; padding: 0 !important; }
.dash-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  padding: .4rem .6rem;
  background: #f5f7fa;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: .8rem;
  color: var(--text);
  font-weight: 500;
}
.dash-stats-row b {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-left: .15rem;
}
.dash-prog-section {
  margin-top: 6px;
  padding: .4rem .5rem;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
}
.dash-prog-title {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .35rem;
}
.dash-prog-list { display: flex; flex-direction: column; gap: 4px; max-height: 140px; overflow-y: auto; }
.prog-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 1fr auto;
  align-items: center;
  gap: .4rem;
  padding: .2rem .25rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .75rem;
}
.prog-row:hover { background: #f5f7fa; }
.prog-row.selected { background: #e8f0fa; }
.prog-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}
.prog-bar {
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}
.prog-bar > div {
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
  transition: width .2s;
}
.prog-pct { font-size: .7rem; color: var(--text); font-weight: 600; min-width: 2rem; text-align: right; }

/* Compact registration bar */
.reg-compact-bar {
  flex-shrink: 0;
  padding: .4rem .55rem !important;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.reg-inline {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.reg-inline .reg-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text);
  min-width: 2rem;
  flex-shrink: 0;
}
.reg-inline input[type="text"],
.reg-inline input[type="date"] {
  flex: 1;
  min-width: 70px;
  padding: .28rem .4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .78rem;
  font-family: inherit;
}
.reg-inline input[type="text"]:first-of-type { min-width: 100px; }
.file-mini {
  font-size: .72rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  padding: .2rem .35rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
}
.file-mini input { display: none; }
.file-chips-inline {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding-left: 2.5rem;
}

/* Registration cards */
.reg-card { border: none; overflow: visible; }
.reg-card .card-body { padding: 0; }
.reg-card-head {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--border-light);
}
.reg-icon { font-size: 1.4rem; line-height: 1; }
.reg-card-head h3 { font-size: .9rem; font-weight: 700; color: var(--text); }
.reg-sub { font-size: .72rem; color: var(--text-muted); margin-top: .1rem; }
.reg-form { padding: .65rem .75rem .75rem; }
.reg-input-lg {
  width: 100%; padding: .55rem .65rem;
  border: 2px solid var(--border-light);
  border-radius: 8px; font-size: .9rem;
  margin-bottom: .5rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.reg-input-lg:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74,124,191,.15); }
.reg-input {
  width: 100%; padding: .4rem .55rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: .85rem; margin-bottom: .45rem; font-family: inherit;
}
.reg-textarea {
  width: 100%; padding: .45rem .55rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: .85rem; margin-bottom: .45rem; resize: vertical;
  min-height: 72px; font-family: inherit;
}
.reg-date-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-bottom: .45rem;
}
.reg-date-row label { display: flex; flex-direction: column; gap: .2rem; }
.reg-date-row label span { font-size: .7rem; color: var(--text-muted); font-weight: 600; }
.reg-date-row input {
  padding: .4rem; border: 1px solid var(--border); border-radius: 6px; font-size: .85rem; font-family: inherit;
}
.reg-schedule { border-top: 3px solid #4263eb; }
.reg-issue { border-top: 3px solid #37b24d; }
.btn-reg {
  width: 100%; padding: .55rem; border: none; border-radius: 8px;
  font-size: .88rem; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: transform .1s, box-shadow .15s;
}
.btn-reg:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.btn-reg:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-reg-blue { background: linear-gradient(135deg, #4dabf7, #339af0); color: #fff; }
.btn-reg-green { background: linear-gradient(135deg, #51cf66, #37b24d); color: #fff; }
.file-drop {
  display: flex; align-items: center; justify-content: center;
  min-height: 56px; border: 2px dashed #c5cdd8; border-radius: 8px;
  background: #fafbfc; cursor: pointer; margin-bottom: .45rem;
  transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--blue); background: #f0f7ff; }
.file-drop input { display: none; }
.file-drop-text { font-size: .78rem; color: var(--text-muted); pointer-events: none; }
.file-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }
.file-chip {
  font-size: .7rem; background: #e8f0fa; color: var(--blue-dark);
  padding: .2rem .45rem; border-radius: 12px;
}

.form-actions {
  display: flex;
  gap: .4rem;
  justify-content: flex-end;
  padding-top: .5rem;
  border-top: 1px solid var(--border-light);
  margin-top: .4rem;
  flex-shrink: 0;
}

/* Quick register */
.register-body { overflow-y: auto; }
.register-block h4 {
  font-size: .8rem;
  color: var(--blue-dark);
  margin-bottom: .4rem;
  font-weight: 600;
}
.quick-form input, .quick-form select, .quick-form textarea {
  width: 100%;
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .8rem;
  margin-bottom: .35rem;
  font-family: inherit;
}
.quick-form textarea { resize: vertical; min-height: 60px; }
.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.quick-row .field label { font-size: .69rem; }
.quick-row input { margin-bottom: 0; }
.divider { border: none; border-top: 1px solid var(--border-light); margin: .6rem 0; }
.file-btn {
  display: block;
  text-align: center;
  padding: .35rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
  font-size: .78rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: .35rem;
}
.file-btn input { display: none; }
.file-preview { font-size: .72rem; color: var(--text-muted); margin-bottom: .35rem; }

.inline-edit-panel {
  border-top: 2px solid var(--blue-light);
  margin-top: .5rem;
  padding: .5rem;
  background: #fafbfc;
  flex-shrink: 0;
}
.inline-edit-panel input,
.inline-edit-panel textarea,
.inline-edit-panel select {
  width: 100%;
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .8rem;
  margin-bottom: .35rem;
  font-family: inherit;
}
.inline-edit-title { font-size: .79rem; font-weight: 600; color: var(--blue); margin-bottom: .35rem; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: .1rem .35rem;
  border-radius: 3px;
  font-size: .68rem;
  font-weight: 600;
}
.badge-planning, .badge-pending, .badge-open { background: #e3f2fd; color: #1565c0; }
.badge-in_progress { background: #fff3e0; color: #e65100; }
.badge-completed, .badge-resolved, .badge-closed { background: #e8f5e9; color: #2e7d32; }
.badge-on_hold, .badge-delayed { background: #fce4ec; color: #c62828; }
.badge-cancelled { background: #eee; color: #666; }
.badge-high, .badge-critical { background: #ffebee; color: #c62828; }
.badge-medium { background: #fff8e1; color: #f57f17; }
.badge-low { background: #f5f5f5; color: #757575; }

.attach-link {
  font-size: .7rem;
  color: var(--blue);
  text-decoration: none;
  display: block;
}
.attach-link:hover { text-decoration: underline; }

.empty-msg { color: var(--text); font-size: .78rem; padding: .5rem; text-align: center; }

/* ── Buttons ── */
.btn {
  padding: .4rem .85rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: .25rem .55rem; font-size: .75rem; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover:not(:disabled) { background: var(--blue-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { background: var(--green-dark); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover:not(:disabled) { background: #c9302c; }
.btn-outline {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
}
.btn-outline:hover { background: rgba(255,255,255,.3); }

.btn-icon {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
.btn-icon.btn-green { background: var(--green); color: #fff; }
.btn-icon.btn-red { background: var(--red); color: #fff; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: #333;
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 6px;
  font-size: .85rem;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
