﻿@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  --bg: #f5f7f5;
  --bg-soft: #fbfcfb;
  --surface: #ffffff;
  --surface-muted: #f4f7f4;
  --surface-strong: #eef3ef;
  --text: #14251f;
  --text-muted: #5f746c;
  --line: #d8e3dc;
  --accent: #1b7a63;
  --accent-strong: #125846;
  --accent-soft: #d4f0e7;
  --warn: #f59f44;
  --success: #1f8f5f;
  --error: #cc3b3b;
  --pending: #6f6bc5;
  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
  --shadow: 0 18px 40px rgba(20, 37, 31, 0.08);
  --shadow-soft: 0 8px 20px rgba(20, 37, 31, 0.06);
  --desktop-nav: 248px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Plus Jakarta Sans", "Noto Sans SC", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -8%, rgba(27, 122, 99, 0.18), transparent 44%),
    radial-gradient(circle at 88% 0%, rgba(245, 159, 68, 0.14), transparent 38%),
    var(--bg);
  line-height: 1.45;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.role-body {
  padding: 14px;
}

.app-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 246, 0.96));
  border: 1px solid var(--line);
  border-radius: 24px;
  min-height: calc(100svh - 28px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.side-rail {
  background: linear-gradient(170deg, #f2f7f4 0%, #eef4f1 100%);
  border-bottom: 1px solid var(--line);
  padding: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.mark-dot {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #219070, #155946);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.role-badge {
  border: 1px solid #bfd6cb;
  background: #f3fbf8;
  color: #1b7a63;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.rail-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.nav-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.nav-item {
  border: 1px solid #c9d9d1;
  background: #fff;
  color: #2e473f;
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 160ms ease;
  cursor: pointer;
}

.nav-item:hover {
  border-color: #8ebead;
  color: #114b3b;
}

.nav-item.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 16px rgba(27, 122, 99, 0.22);
}

.workspace {
  padding: 14px;
}

.workspace-head {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 16px;
  margin-bottom: 14px;
  display: grid;
  gap: 14px;
}

.head-main {
  display: grid;
  gap: 6px;
}

.kicker {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5f786e;
  font-weight: 700;
}

.headline {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

.head-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

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

.kpi {
  background: var(--surface-muted);
  border: 1px solid #d8e4dd;
  border-radius: 12px;
  padding: 10px 12px;
}

.kpi-label {
  margin: 0;
  color: #5f746c;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.kpi-sub {
  margin: 6px 0 0;
  color: #5f746c;
  font-size: 12px;
}

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

.workspace-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 15px;
  display: none;
  animation: panelFade 320ms ease;
}

.workspace-panel.is-active {
  display: block;
}

@keyframes panelFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-head {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.panel-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.surface-grid {
  display: grid;
  gap: 10px;
}

.surface {
  border: 1px solid #d7e2dc;
  border-radius: var(--radius-m);
  background: #fbfdfc;
  padding: 12px;
}

.surface h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.surface p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

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

.entity-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border-radius: 12px;
  background: #f4f8f6;
  border: 1px solid #d8e3dd;
}

.entity-main {
  min-width: 0;
}

.entity-title {
  margin: 0;
  font-weight: 700;
  font-size: 13px;
}

.entity-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.chip.pending {
  background: #f4f1ff;
  color: var(--pending);
  border-color: #d6cef8;
}

.chip.success {
  background: #e6f8ef;
  color: var(--success);
  border-color: #bfead2;
}

.chip.warning {
  background: #fff4e7;
  color: #b77012;
  border-color: #ffd7a7;
}

.chip.error {
  background: #ffeded;
  color: var(--error);
  border-color: #f5c7c7;
}

.chip.neutral {
  background: #edf3f0;
  color: #537166;
  border-color: #d5e2db;
}

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

.bucket {
  border-radius: 14px;
  border: 1px solid #d8e4dd;
  padding: 12px;
}

.bucket h4 {
  margin: 0;
  font-size: 13px;
}

.bucket p {
  margin: 7px 0 0;
  font-size: 22px;
  font-weight: 800;
}

.bucket small {
  color: var(--text-muted);
  font-size: 12px;
}

.bucket.withdrawable {
  background: linear-gradient(145deg, #ecfff8, #f5fffb);
}

.bucket.non-withdrawable {
  background: linear-gradient(145deg, #f7fbff, #fcfeff);
}

.bucket.frozen {
  background: linear-gradient(145deg, #fff6ef, #fffaf5);
}

.table-wrap {
  border: 1px solid #d9e3dd;
  border-radius: 14px;
  overflow: auto;
}

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

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #edf2ef;
  font-size: 13px;
}

.data-table th {
  background: #f4f8f5;
  color: #3f5d52;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.auth-grid input,
.auth-grid select,
.auth-grid textarea {
  width: 100%;
  font: inherit;
  border: 1px solid #cbdad3;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}

.form-grid textarea,
.auth-grid textarea {
  min-height: 94px;
  resize: vertical;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  border-radius: 11px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.btn.ghost {
  background: #fff;
  color: #174739;
  border-color: #b8cfc4;
}

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

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

.api-console {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid #2d473d;
  background: #10261d;
  color: #d5efe4;
  padding: 10px;
  font-family: Consolas, Menlo, Monaco, monospace;
  font-size: 12px;
  min-height: 110px;
  white-space: pre-wrap;
}

.state-grid {
  display: grid;
  gap: 10px;
}

.state-card {
  border-radius: 13px;
  border: 1px solid #d9e4de;
  background: #fbfdfc;
  padding: 12px;
}

.state-title {
  margin: 0;
  font-weight: 800;
  font-size: 13px;
}

.state-note {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.loading-bar {
  margin-top: 10px;
  height: 7px;
  background: #e2ece6;
  border-radius: 999px;
  overflow: hidden;
}

.loading-bar::after {
  content: "";
  display: block;
  width: 34%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1b7a63, #43ae8d);
  animation: loadingSlide 1.2s ease-in-out infinite;
}

@keyframes loadingSlide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.hero {
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.95), rgba(246, 250, 247, 0.94)),
    radial-gradient(circle at 78% 16%, rgba(27, 122, 99, 0.2), transparent 45%);
  border: 1px solid #d5e4dc;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(26px, 4.8vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: #49665d;
  max-width: 700px;
}

.role-grid {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.role-link {
  display: block;
  text-decoration: none;
  border: 1px solid #d8e3dc;
  border-radius: 15px;
  padding: 12px;
  background: #fff;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.role-link:hover {
  transform: translateY(-2px);
  border-color: #9abead;
  box-shadow: var(--shadow-soft);
}

.role-link h3 {
  margin: 0;
  font-size: 15px;
}

.role-link p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-bar {
  border: 1px solid #d7e3db;
  border-radius: var(--radius-m);
  background: #f8fbf9;
  padding: 12px;
}

.auth-grid {
  display: grid;
  gap: 8px;
}

.inline-note {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0;
}

.hidden {
  display: none !important;
}

@media (min-width: 720px) {
  .role-body {
    padding: 18px;
  }

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

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

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

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

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

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

@media (min-width: 1080px) {
  .role-body {
    padding: 24px;
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    display: grid;
    grid-template-columns: var(--desktop-nav) 1fr;
  }

  .side-rail {
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 18px 16px;
    min-height: calc(100vh - 48px);
  }

  .nav-scroll {
    display: grid;
    gap: 7px;
    overflow: visible;
  }

  .nav-item {
    border-radius: 11px;
    width: 100%;
    text-align: left;
  }

  .workspace {
    padding: 18px;
  }

  .workspace-head {
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
  }

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

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

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

