:root {
  --bg: #f3f6f5;
  --panel: #ffffff;
  --line: #dfe5e2;
  --text: #18231e;
  --muted: #647069;
  --accent: #0d7a5c;
  --accent-strong: #0a5f47;
  --accent-soft: #e5f4ed;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --info: #245a8a;
  --info-soft: #e8f1fa;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 34, 27, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.hidden {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}

.brand-mark svg {
  width: 17px;
  height: 17px;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}

.nav-tab {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 600;
}

.nav-tab.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 9px 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:hover {
  border-color: #b9c6bf;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-danger {
  color: var(--danger);
  background: #fff;
}

.btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 13px;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: rgba(24, 35, 30, 0.06);
  color: var(--text);
}

.content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.stat strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 15px;
}

.panel-body {
  padding: 16px 18px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  background: var(--panel);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(13, 122, 92, 0.25);
  border-color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  background: #fafcfb;
}

tbody tr:hover {
  background: #fafcfb;
}

.meeting-title {
  font-weight: 700;
}

.meeting-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-ended {
  background: #eef0f2;
  color: var(--muted);
}

.status-pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-minutes {
  background: var(--info-soft);
  color: var(--info);
}

.row-actions {
  display: flex;
  gap: 6px;
}

.empty-state {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.detail-layout > .panel {
  min-width: 0;
}

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

.meta-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.meta-item strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.link-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.link-row input {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  background: #f7f9f8;
  font-size: 13px;
}

.participant-list,
.transcript-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.participant-list li,
.transcript-list li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.participant-list li:first-child,
.transcript-list li:first-child {
  border-top: 0;
}

.participant-name {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
}

.participant-name time {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.transcript-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.minutes-body h3 {
  margin: 18px 0 6px;
  font-size: 14px;
}

.minutes-body h3:first-child {
  margin-top: 0;
}

.minutes-summary {
  margin: 0;
  color: #2a3630;
}

.minutes-list {
  margin: 6px 0 0;
  padding-left: 20px;
}

.minutes-list li {
  margin-bottom: 5px;
}

.notes-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.settings-list {
  display: grid;
  gap: 14px;
}

.settings-item {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.settings-item:last-child {
  border-bottom: 0;
}

.settings-item span {
  color: var(--muted);
  font-size: 12px;
  display: block;
}

.settings-item code {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
  background: #f4f7f5;
  padding: 6px 8px;
  border-radius: 6px;
}

.settings-value {
  min-width: 0;
  max-width: 65%;
}

.login-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-panel {
  width: 100%;
  max-width: 390px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-panel .brand {
  margin-bottom: 18px;
}

.login-panel h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.login-panel .login-hint {
  margin: 0 0 18px;
  color: var(--muted);
}

.form-stack {
  display: grid;
  gap: 14px;
}

.form-stack label {
  display: grid;
  gap: 5px;
  font-weight: 600;
  font-size: 13px;
}

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

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 23, 18, 0.42);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 50;
  overflow-y: auto;
}

.modal-panel {
  width: 100%;
  max-width: 560px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: 0 20px 48px rgba(12, 23, 18, 0.2);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  padding: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 80;
}

.toast {
  background: #17231d;
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(12, 23, 18, 0.2);
  font-size: 13px;
}

.room-body {
  height: 100vh;
  overflow: hidden;
}

.entry-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.room-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 22px;
}

.entry-panel {
  width: 100%;
  max-width: 430px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.entry-heading {
  margin-bottom: 18px;
}

.entry-kicker {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.entry-heading h1 {
  margin: 4px 0 6px;
  font-size: 24px;
}

.entry-heading p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.room-view {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.room-toolbar {
  height: 58px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: #14201a;
  color: #fff;
}

.room-toolbar-left,
.room-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.room-toolbar .brand-mark {
  width: 28px;
  height: 28px;
}

.room-tag {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.room-timer {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #c7d4cd;
}

.room-toolbar .btn-ghost {
  color: #d7e3dc;
}

.room-toolbar .btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.jitsi-container {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #0b1410;
}

.jitsi-container iframe {
  border: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.jitsi-error {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  text-align: center;
  color: var(--danger);
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  padding: 28px;
}

@media (max-width: 860px) {
  .header-inner {
    padding: 0 16px;
  }

  .nav-tabs {
    margin-left: 0;
  }

  .content {
    padding: 20px 16px 48px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .room-toolbar {
    padding: 0 10px;
  }

  .room-title {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .btn-sm span {
    display: none;
  }

  .settings-value {
    max-width: 70%;
  }
}
