body {
  min-width: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tabs button {
  align-items: center;
  border-bottom: 2px solid transparent;
  color: #64748b;
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  padding: 14px 16px;
}

.tabs button.active {
  border-bottom-color: #1d4ed8;
  color: #1d4ed8;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.metric-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  transition: border-color 0.2s ease;
}

.metric-card:hover {
  border-color: #93c5fd;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 8px;
}

.badge-red { background: #fef2f2; color: #b91c1c; }
.badge-amber { background: #fffbeb; color: #b45309; }
.badge-green { background: #ecfdf5; color: #047857; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-slate { background: #f1f5f9; color: #475569; }

.btn {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
}

[data-lucide] {
  height: 16px;
  stroke-width: 2;
  width: 16px;
}

.btn-primary { background: #1d4ed8; color: white; }
.btn-primary:hover { background: #1e40af; }
.btn-ghost { background: white; border: 1px solid #e2e8f0; color: #334155; }
.btn-ghost:hover { background: #f8fafc; }

input,
select,
textarea {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  min-height: 96px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

td {
  font-size: 14px;
}


.btn-sm {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.drawer {
  background: rgba(15, 23, 42, 0.28);
  display: none;
  inset: 0;
  justify-content: flex-end;
  position: fixed;
  z-index: 50;
}

.drawer.open {
  display: flex;
}

.drawer-panel {
  background: white;
  box-shadow: -18px 0 45px rgba(15, 23, 42, 0.14);
  height: 100vh;
  overflow-y: auto;
  width: 560px;
}

.file-link {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.drawer-section-title {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.drawer-fields {
  display: grid;
  gap: 1px;
}

.drawer-field {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 148px minmax(0, 1fr);
  padding: 5px 0;
}

.drawer-field-label {
  align-items: center;
  color: #64748b;
  display: flex;
  font-size: 13px;
  font-weight: 500;
  gap: 8px;
  min-height: 30px;
}

.drawer-field-label [data-lucide] {
  color: #94a3b8;
  height: 15px;
  width: 15px;
}

.drawer-field-control {
  min-width: 0;
}

.drawer-value {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 500;
  min-height: 30px;
  padding: 4px 8px;
  width: 100%;
}

.drawer-value:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.drawer-value:focus {
  background: white;
  border-color: #60a5fa;
  outline: none;
}

.drawer-textarea {
  line-height: 1.45;
  min-height: 54px;
  resize: vertical;
}

.activity-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  display: flex;
  font-size: 13px;
  gap: 9px;
  padding: 9px;
}

.activity-icon {
  align-items: center;
  background: #dbeafe;
  border-radius: 999px;
  color: #1d4ed8;
  display: flex;
  flex: 0 0 auto;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.activity-icon [data-lucide] {
  height: 13px;
  width: 13px;
}

.inline-form input,
.inline-form select {
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  background: white;
  min-width: 120px;
}

.inline-form input:focus,
.inline-form select:focus {
  border-color: #3b82f6;
  outline: none;
}

.clickable-row {
  cursor: pointer;
  transition: background 0.15s;
}
.clickable-row:hover {
  background: #f1f5f9;
}

.save-status {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.save-status[data-tone="success"] {
  color: #059669;
}

.save-status[data-tone="danger"] {
  color: #dc2626;
}

.comment-box {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.comment-box:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.comment-input {
  border: 0;
  border-radius: 0;
  color: #0f172a;
  display: block;
  font-size: 13px;
  line-height: 1.55;
  min-height: 78px;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}

.comment-input:focus {
  outline: none;
}

.comment-toolbar {
  align-items: center;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  padding: 7px 8px;
}

.comment-tools {
  align-items: center;
  color: #64748b;
  display: flex;
  gap: 12px;
}


.toolbar-icon {
  border-radius: 4px;
  cursor: pointer;
  padding: 3px;
  transition: background 0.15s;
}
.toolbar-icon:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.comment-tools span {
  background: #e2e8f0;
  display: inline-block;
  height: 18px;
  width: 1px;
}

.comment-tools [data-lucide] {
  height: 15px;
  width: 15px;
}

.btn:disabled,
.btn:disabled:hover {
  background: #e2e8f0;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

.activity-delete {
  align-items: center;
  border-radius: 5px;
  color: #94a3b8;
  display: inline-flex;
  flex: 0 0 auto;
  height: 26px;
  justify-content: center;
  opacity: 0;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  width: 26px;
}

.activity-item:hover .activity-delete {
  opacity: 1;
}

.activity-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

.activity-delete [data-lucide] {
  height: 14px;
  width: 14px;
}
