:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --line: #dfe5ee;
  --primary: #1769e0;
  --primary-dark: #0f4fb3;
  --accent: #0f9f7a;
  --warn: #d97706;
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(23, 32, 51, .58), rgba(23, 32, 51, .50)),
    url("https://images.unsplash.com/photo-1503387762-592deb58ef4e?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-panel {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .26);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

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

label {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

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

.primary,
.filters button,
.inline-form button {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.primary:hover,
.filters button:hover,
.inline-form button:hover {
  background: var(--primary-dark);
}

.ghost {
  border-radius: 6px;
  background: #eef2f7;
  color: var(--text);
  padding: 10px 12px;
}

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

.captcha-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.captcha-row button {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  background: #eef2f7;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 22px;
  background: #172033;
  color: white;
}

.sidebar-actions {
  display: grid;
  gap: 8px;
}

.brand {
  display: grid;
  gap: 6px;
}

.brand span {
  color: #b9c2d1;
  font-size: 13px;
}

nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

nav button {
  text-align: left;
  border-radius: 6px;
  padding: 11px 12px;
  background: transparent;
  color: #cbd5e1;
}

nav button.active {
  background: #24324c;
  color: #fff;
}

nav b {
  float: right;
  min-width: 22px;
  border-radius: 999px;
  padding: 1px 6px;
  background: #ef4444;
  color: #fff;
  text-align: center;
  font-size: 12px;
}

.content {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h2 {
  margin: 0;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff1f2;
  color: #991b1b;
}

.error-banner span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.error-banner button {
  min-height: 30px;
  border-radius: 6px;
  padding: 0 10px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}

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

.metric,
.panel,
.mobile-board article,
.drawer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.metric span {
  color: var(--muted);
}

.metric strong {
  font-size: 26px;
}

.panel {
  padding: 18px;
}

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

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

.project-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px auto;
  gap: 10px;
  margin-bottom: 14px;
}

.user-form {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.security-panel {
  max-width: 520px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-line input {
  width: auto;
}

.table-wrap {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: #f8fafc;
}

.table-actions,
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions button,
.row-actions button {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 10px;
  background: #eef2f7;
  color: var(--text);
  font-weight: 700;
}

.row-actions button:first-child {
  background: #dff7ec;
  color: #0f513f;
}

.danger,
.row-actions .danger {
  background: #fee2e2;
  color: #991b1b;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f8fbff;
}

.progress {
  height: 8px;
  overflow: hidden;
  background: #e8edf5;
  border-radius: 999px;
}

.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  color: #0f513f;
  background: #dff7ec;
  font-size: 12px;
  font-weight: 700;
}

.mobile-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

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

.approval-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

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

.approval-item small,
.money-list small,
.empty {
  color: var(--muted);
}

.empty {
  margin: 12px 0 0;
}

.mobile-board article {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.mobile-board footer {
  display: flex;
  justify-content: space-between;
}

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

.drawer {
  width: min(780px, 100%);
  height: 100%;
  overflow: auto;
  border-radius: 0;
  padding: 22px;
}

.drawer > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--text);
  font-size: 24px;
}

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

.wide {
  grid-column: 1 / -1;
}

.detail-summary {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.detail-summary strong {
  font-size: 30px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}

.tabs button.active {
  color: var(--primary);
  border-color: var(--primary);
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.timeline li,
.money-list article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.timeline span,
.money-list span {
  color: var(--muted);
  font-size: 13px;
}

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

.file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-chips button {
  max-width: 100%;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef2f7;
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.preview-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .54);
}

.preview-panel {
  width: min(1040px, 100%);
  height: min(82vh, 760px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
}

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

.preview-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: #f8fafc;
}

.preview-body img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
}

.preview-body iframe {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  background: white;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: 68px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: 68px;
    z-index: 9;
    grid-template-columns: 1fr;
    padding: 8px 10px;
  }

  .brand,
  .sidebar-actions {
    display: none;
  }

  nav {
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    gap: 6px;
  }

  nav button {
    text-align: center;
    padding: 10px 4px;
    font-size: 13px;
  }

  .content {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
  }

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

  .filters,
  .form-grid,
  .inline-form,
  .approval-grid,
  .user-form {
    grid-template-columns: 1fr;
  }

  .approval-item {
    grid-template-columns: 1fr;
  }

  .drawer {
    padding: 16px;
  }
}
