:root {
  --bg: #eef7f3;
  --panel: #ffffff;
  --panel-soft: #f6fbf8;
  --ink: #14231e;
  --muted: #65756f;
  --line: #dbe8e2;
  --line-strong: #bfd4ca;
  --green: #12805c;
  --green-soft: #dff8ed;
  --amber: #b56a16;
  --amber-soft: #fff0d4;
  --red: #c4473f;
  --red-soft: #ffe3df;
  --blue: #1d6f9f;
  --blue-soft: #e3f3fb;
  --coral: #ef6b4a;
  --coral-soft: #ffe6dc;
  --mint: #22b981;
  --sun: #ffc94d;
  --shadow: 0 22px 55px rgba(23, 67, 52, 0.12);
  --shadow-soft: 0 10px 26px rgba(28, 76, 59, 0.08);
  --radius: 8px;
  --max: 1440px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(34, 185, 129, 0.16) 0 18%, transparent 18% 100%),
    linear-gradient(160deg, transparent 0 64%, rgba(239, 107, 74, 0.13) 64% 76%, transparent 76% 100%),
    linear-gradient(180deg, #f7fffb 0%, var(--bg) 38%, #f6f8fb 100%);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px max(24px, calc((100vw - var(--max)) / 2));
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(190, 216, 205, 0.82);
  box-shadow: 0 8px 24px rgba(25, 83, 62, 0.06);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 6px;
  color: #43826c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.3;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.header-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-shell {
  display: grid;
  gap: 20px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 24px 52px;
}

.status-hero,
.panel,
.toolbar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.status-hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-color: rgba(72, 171, 135, 0.35);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.96) 0 54%, rgba(222, 249, 237, 0.95) 54% 100%),
    linear-gradient(135deg, rgba(34, 185, 129, 0.22), rgba(255, 201, 77, 0.18));
}

.status-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(18, 128, 92, 0.08) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(18, 128, 92, 0.06) 0 1px, transparent 1px 100%);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.55), transparent 68%);
}

.status-hero > * {
  position: relative;
}

.status-hero h2 {
  font-size: 38px;
  line-height: 1.18;
}

.status-copy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.capacity-progress {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  border: 1px solid rgba(207, 225, 217, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
}

.progress-head,
.progress-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress-head strong {
  font-size: 18px;
}

.progress-track {
  display: flex;
  overflow: hidden;
  height: 18px;
  border-radius: 999px;
  background: #eef5f1;
  box-shadow: inset 0 1px 4px rgba(30, 75, 58, 0.14);
}

.progress-used,
.progress-remaining {
  min-width: 0;
  transition: width 220ms ease;
}

.progress-used {
  background: linear-gradient(90deg, var(--coral), var(--sun));
}

.progress-remaining {
  background: linear-gradient(90deg, var(--mint), var(--blue));
}

.progress-legend {
  flex-wrap: wrap;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.progress-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-used {
  background: var(--coral);
}

.legend-remaining {
  background: var(--mint);
}

.legend-warning {
  background: var(--sun);
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(207, 225, 217, 0.9);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
  box-shadow: var(--shadow-soft);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--mint);
}

.metric-card:nth-child(2)::before {
  background: var(--blue);
}

.metric-card:nth-child(3)::before {
  background: var(--coral);
}

.metric-card:nth-child(4)::before {
  background: var(--sun);
}

.metric-card:nth-child(5)::before {
  background: linear-gradient(180deg, var(--mint), var(--blue));
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.panel {
  min-width: 0;
  padding: 20px;
  border-color: rgba(207, 225, 217, 0.94);
  box-shadow: var(--shadow-soft);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-color: rgba(239, 107, 74, 0.22);
  background: linear-gradient(135deg, #fff 0%, #fff8f3 100%);
}

label {
  display: grid;
  gap: 7px;
  color: #3e4a46;
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.secondary-link {
  min-height: 40px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, #12805c, #1d6f9f);
  color: #fff;
  box-shadow: 0 10px 22px rgba(29, 111, 159, 0.22);
}

.secondary-button {
  border-color: rgba(34, 185, 129, 0.32);
  background: #ffffff;
  color: var(--ink);
}

.secondary-link,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.secondary-link {
  border-color: rgba(34, 185, 129, 0.32);
  background: #ffffff;
  color: var(--ink);
}

.ghost-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink);
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: #fff;
  border-color: var(--line);
  font-size: 22px;
  line-height: 1;
}

.mode-pill,
.sync-pill,
.tag,
.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mode-pill {
  background: linear-gradient(135deg, var(--blue-soft), #edf8f1);
  color: var(--blue);
  border: 1px solid rgba(29, 111, 159, 0.18);
}

.sync-pill {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(181, 106, 22, 0.18);
}

.sync-pill[data-status="online"] {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(18, 128, 92, 0.18);
}

.sync-pill[data-status="offline"] {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(196, 71, 63, 0.18);
}

.tag {
  background: #ffffff;
  color: #33574d;
  border: 1px solid rgba(34, 185, 129, 0.22);
  box-shadow: 0 6px 14px rgba(22, 84, 61, 0.06);
}

.status-good {
  background: var(--green-soft);
  color: var(--green);
}

.status-tight,
.status-progress {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-full,
.status-risk {
  background: #f2efe5;
  color: #75633d;
}

.status-blocked {
  background: var(--red-soft);
  color: var(--red);
}

.status-info,
.status-done {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-archive {
  background: #edf1ef;
  color: #596761;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(207, 225, 217, 0.9);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #fff;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: linear-gradient(180deg, #f8fffb, #eff8f3);
  color: #3f4b47;
  font-size: 12px;
  font-weight: 900;
}

th.past-day,
td.past-day,
.calendar-day.past-day,
.calendar-cell.past-day {
  background: #f0f3f2;
  color: #87918d;
}

td.past-day .status-tag,
.calendar-cell.past-day .calendar-event,
.calendar-cell.past-day .calendar-project {
  filter: grayscale(0.6);
  opacity: 0.72;
}

.past-label {
  display: inline-flex;
  margin-left: 6px;
  border-radius: 999px;
  background: #e2e8e5;
  color: #6e7773;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 900;
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: #f8fffb;
}

tr:last-child td {
  border-bottom: 0;
}

.schedule-cell {
  min-width: 124px;
}

.cell-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 900;
}

.cell-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.request-list {
  display: grid;
  gap: 10px;
}

.request-card,
.event-card,
.history-card,
.empty-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(207, 225, 217, 0.9);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
  box-shadow: 0 8px 18px rgba(26, 82, 61, 0.06);
}

.request-card header,
.event-card header,
.history-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.request-card p,
.event-card p,
.history-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.request-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.request-detail-grid span,
.request-detail-grid a {
  min-height: 38px;
  border: 1px solid rgba(207, 225, 217, 0.88);
  border-radius: 7px;
  background: #ffffff;
  padding: 9px 10px;
  color: #44504c;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.request-detail-grid a {
  color: var(--blue);
}

.internal-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.internal-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 180px;
  border: 1px solid rgba(207, 225, 217, 0.92);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.internal-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.internal-column header div {
  display: grid;
  gap: 4px;
}

.internal-column header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mini-button {
  border: 1px solid rgba(23, 145, 118, 0.22);
  border-radius: 999px;
  background: #ecfbf5;
  color: #176b59;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.mini-button:hover {
  border-color: rgba(23, 145, 118, 0.45);
  background: #dcf7ed;
}

.internal-task-list {
  display: grid;
  gap: 8px;
}

.internal-task {
  display: grid;
  gap: 7px;
  border-left: 4px solid var(--mint);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
}

.internal-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.internal-task h3 {
  margin: 0;
  font-size: 14px;
}

.internal-task p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.inline-edit,
.inline-danger {
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.inline-edit {
  background: #ecfbf5;
  color: #176b59;
}

.inline-edit:hover {
  background: #dcf7ed;
}

.inline-danger {
  background: #fff0ed;
  color: #b94731;
}

.inline-danger:hover {
  background: #ffe2db;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-preview-list,
.history-list-full {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.history-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.history-preview-head a {
  color: var(--blue);
  text-decoration: none;
}

.archive-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.archive-summary article {
  border: 1px solid rgba(207, 225, 217, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.archive-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.archive-summary strong {
  display: block;
  margin-top: 7px;
  font-size: 28px;
  line-height: 1;
}

.archive-summary small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-filter {
  min-width: 220px;
}

.week-archive-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.week-archive-summary article {
  border: 1px solid rgba(207, 225, 217, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
  padding: 12px;
}

.week-archive-summary span,
.week-archive-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.week-archive-summary strong {
  display: block;
  margin: 7px 0 5px;
  font-size: 22px;
  line-height: 1;
}

.week-archive {
  display: grid;
  gap: 18px;
}

.week-archive section {
  display: grid;
  gap: 10px;
}

.week-archive h3 {
  margin: 0;
  font-size: 17px;
}

.week-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.week-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(207, 225, 217, 0.9);
  border-left: 4px solid var(--mint);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.week-card h3,
.week-card p {
  margin: 0;
}

.week-card h3 {
  font-size: 14px;
}

.week-card p,
.week-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.history-card {
  border-left: 5px solid var(--blue);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 250, 0.96)),
    linear-gradient(135deg, rgba(29, 111, 159, 0.08), rgba(34, 185, 129, 0.06));
}

.history-card-button {
  width: 100%;
  border-top: 1px solid rgba(207, 225, 217, 0.9);
  border-right: 1px solid rgba(207, 225, 217, 0.9);
  border-bottom: 1px solid rgba(207, 225, 217, 0.9);
  color: inherit;
  text-align: left;
}

.history-card-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(26, 82, 61, 0.1);
}

.history-card:has(.status-archive) {
  border-left-color: var(--line-strong);
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-meta span {
  border: 1px solid rgba(207, 225, 217, 0.9);
  border-radius: 7px;
  background: #fff;
  padding: 7px 9px;
  color: #44504c;
  font-size: 12px;
  font-weight: 800;
}

.tag-link {
  color: var(--blue);
  text-decoration: none;
}

.empty-card {
  min-height: 78px;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.history-shell .archive-hero .archive-summary {
  max-width: 820px;
  margin-top: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.history-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 1fr));
  gap: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid span {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(207, 225, 217, 0.9);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
  color: #44504c;
  font-size: 13px;
}

.detail-grid strong {
  color: var(--muted);
  font-size: 12px;
}

.detail-note {
  margin: 12px 0 0;
  border-left: 4px solid var(--mint);
  border-radius: 7px;
  background: var(--panel-soft);
  padding: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.detail-link {
  width: fit-content;
  margin-top: 12px;
  text-decoration: none;
}

.calendar-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(207, 225, 217, 0.95);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.event-calendar {
  --calendar-days: 5;
  display: grid;
  grid-template-columns: 168px repeat(var(--calendar-days), minmax(160px, 1fr));
  min-width: calc(168px + var(--calendar-days) * 160px);
  background: #fff;
}

.calendar-corner,
.calendar-day,
.calendar-member,
.calendar-cell {
  border-right: 1px solid rgba(219, 232, 226, 0.95);
  border-bottom: 1px solid rgba(219, 232, 226, 0.95);
}

.calendar-corner,
.calendar-day {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 44px;
  background: linear-gradient(180deg, #f8fffb, #edf8f3);
  color: #3f4b47;
  padding: 13px 12px;
  font-size: 12px;
  font-weight: 900;
}

.calendar-member {
  position: sticky;
  left: 0;
  z-index: 1;
  min-height: 136px;
  background: linear-gradient(180deg, #ffffff, #f8fffb);
  padding: 14px 12px;
}

.calendar-member strong {
  display: block;
}

.calendar-cell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 136px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 252, 250, 0.92)),
    linear-gradient(135deg, rgba(34, 185, 129, 0.05), transparent);
}

.calendar-events {
  display: grid;
  gap: 8px;
  flex: 1;
}

.calendar-event {
  display: grid;
  gap: 5px;
  border-left: 4px solid var(--blue);
  border-radius: 7px;
  background: linear-gradient(135deg, var(--blue-soft), #f7fcff);
  padding: 9px 10px;
  box-shadow: 0 8px 16px rgba(29, 111, 159, 0.1);
}

.calendar-event:nth-child(2n) {
  border-left-color: var(--sun);
  background: linear-gradient(135deg, var(--amber-soft), #fffdf7);
}

.calendar-event:nth-child(3n) {
  border-left-color: var(--mint);
  background: linear-gradient(135deg, var(--green-soft), #f8fffb);
}

.calendar-project {
  border-left-color: var(--mint);
  background:
    linear-gradient(135deg, rgba(234, 255, 246, 0.95), rgba(255, 252, 246, 0.95)),
    linear-gradient(135deg, rgba(34, 185, 129, 0.14), transparent);
  box-shadow: 0 8px 16px rgba(34, 185, 129, 0.1);
}

.calendar-event strong {
  font-size: 13px;
}

.calendar-event span,
.calendar-event p,
.empty-slot {
  margin: 0;
  color: #53615c;
  font-size: 12px;
  line-height: 1.45;
}

.empty-slot {
  color: #9aa4a0;
}

.event-delete-button {
  justify-self: start;
  min-height: 26px;
  border: 1px solid rgba(196, 71, 63, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--red);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

.mini-button {
  min-height: 30px;
  border: 1px dashed rgba(29, 111, 159, 0.42);
  border-radius: 7px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.mini-button:hover {
  transform: translateY(-1px);
  border-color: var(--blue);
  background: var(--blue-soft);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.edit-only {
  display: none;
}

body.editing .edit-only {
  display: inline-flex;
}

body.editing .toolbar.edit-only {
  display: grid;
}

body.editing .panel.edit-only {
  display: block;
}

.management-panel {
  border-color: rgba(29, 111, 159, 0.22);
  background: linear-gradient(135deg, #ffffff 0%, #f3fbff 100%);
}

.member-manager {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 14px;
  align-items: start;
}

.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid rgba(207, 225, 217, 0.92);
  border-radius: 8px;
  background: #fff;
  padding: 7px 8px 7px 12px;
  box-shadow: var(--shadow-soft);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.danger-button {
  min-height: 30px;
  border: 1px solid rgba(196, 71, 63, 0.24);
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.modal {
  width: min(620px, calc(100vw - 32px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: transparent;
}

.wide-modal {
  width: min(860px, calc(100vw - 32px));
}

.modal::backdrop {
  background: rgba(19, 28, 24, 0.45);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0 72%, rgba(223, 248, 237, 0.96) 72% 100%);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid label.full {
  grid-column: 1 / -1;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(34, 185, 129, 0.22);
  border-radius: 7px;
  background: rgba(223, 248, 237, 0.45);
  padding: 11px 12px;
}

.checkbox-field input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--green);
}

.checkbox-field span {
  color: #31544a;
  font-size: 13px;
  font-weight: 900;
}

.quick-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.quick-block {
  border: 1px solid rgba(207, 225, 217, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  padding: 14px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 360px;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1040px) {
  .status-hero,
  .two-column {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .week-archive-summary,
  .week-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .app-shell {
    padding: 16px 14px 34px;
  }

  .status-hero {
    padding: 18px;
  }

  .status-hero h2 {
    font-size: 27px;
  }

  .metric-grid,
  .toolbar,
  .request-detail-grid,
  .history-preview-list,
  .history-list-full,
  .history-shell .archive-hero .archive-summary,
  .history-filters,
  .archive-summary,
  .week-archive-summary,
  .week-card-grid,
  .detail-grid,
  .member-manager,
  .inline-form,
  .quick-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }
}
