:root {
  --bg: #0f1419;
  --surface: #1a222c;
  --surface2: #232d3a;
  --border: #2e3a49;
  --text: #e8eef5;
  --muted: #9aa8b6;
  --accent: #3dd6c6;
  --accent-dim: #2ba89c;
  --danger: #f07178;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 10% -10%, #1a2a32 0%, var(--bg) 55%);
  color: var(--text);
  font-family: inherit;
  line-height: 1.5;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  font-weight: 700;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #e8eef5, var(--accent), #e8eef5);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 4s linear infinite;
  text-shadow: 0 0 24px rgba(61, 214, 198, 0.35);
  filter: drop-shadow(0 0 12px rgba(61, 214, 198, 0.25));
}

@keyframes shine {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: -200% center;
  }
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.login-panel {
  max-width: 420px;
  margin: 2rem auto;
}

.panel-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 500;
}

.muted {
  color: var(--muted);
  margin-top: 0;
}

.muted.small {
  font-size: 0.875rem;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.field span {
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 214, 198, 0.2);
}

.input[readonly] {
  opacity: 0.85;
  cursor: default;
}

.btn {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #0a1014;
  font-weight: 600;
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.secondary {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
  margin-top: 0.75rem;
}

.btn.secondary:hover {
  border-color: var(--accent);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn.ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.btn.icon {
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
  line-height: 1;
  background: transparent;
  color: var(--danger);
  border-color: rgba(240, 113, 120, 0.35);
}

.btn.icon:hover {
  background: rgba(240, 113, 120, 0.1);
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0;
}

.app-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tab {
  font: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--text);
  background: var(--surface2);
}

.tab.active {
  color: #0a1014;
  background: var(--accent);
  font-weight: 500;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status {
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.status.ok {
  color: var(--accent);
}

.status.err {
  color: var(--danger);
}

.section-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 500;
}

.subsection-title {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 500;
}

.tab-panels {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.tab-panel[hidden] {
  display: none !important;
}

.du-dau-doc-sheet {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid rgba(61, 214, 198, 0.35);
  background: linear-gradient(135deg, rgba(61, 214, 198, 0.08), rgba(26, 34, 44, 0.9));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.du-dau-doc-label {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.du-dau-doc-value {
  margin: 0;
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.du-dau-doc-hint {
  margin: 0.5rem 0 0;
}

.grid-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0.75rem 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  text-align: left;
  background: var(--surface2);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: rgba(61, 214, 198, 0.04);
}

.data-table .input {
  min-width: 96px;
}

.col-act {
  width: 4rem;
  text-align: center;
}

.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.card-value {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

@media (max-width: 640px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    justify-content: stretch;
  }

  .toolbar-actions .btn {
    flex: 1;
  }

  .tabs {
    justify-content: center;
  }
}
