﻿:root {
  --bg: #f4f7fe;
  --line: #d8e1f4;
  --txt: #15213e;
  --muted: #60739c;
  --primary: #3f79e6;
  --primary2: #1fa0cc;
  --ok: #00b894;
  --danger: #e74c3c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--txt);
  background:
    radial-gradient(1000px 360px at 6% -10%, #dfe9ff 0%, transparent 60%),
    radial-gradient(1000px 360px at 96% 110%, #dcfff3 0%, transparent 60%),
    var(--bg);
}

.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 480px;
}

.login-left {
  background: linear-gradient(135deg, #2367d1 0%, #2b86d1 54%, #19b8be 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.hero-content {
  max-width: 560px;
  color: #fff;
  position: relative;
  z-index: 3;
}

.hero-content h1 {
  margin: 0;
  font-size: clamp(34px, 3vw, 56px);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero-content p {
  margin-top: 14px;
  line-height: 1.7;
  opacity: 0.95;
}

.shape {
  position: absolute;
  opacity: 0.12;
  background: #fff;
  animation: float 16s ease-in-out infinite;
}

.shape-1 { width: 280px; height: 280px; border-radius: 999px; top: 8%; left: 8%; }
.shape-2 { width: 210px; height: 210px; border-radius: 38% 62% 45% 55%; right: 10%; bottom: 18%; animation-delay: 4s; }
.shape-3 { width: 140px; height: 140px; border-radius: 999px; left: 28%; bottom: 10%; animation-delay: 7s; }

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-28px) rotate(16deg); }
}

.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: #fff;
}

.login-card {
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(15, 35, 80, 0.08);
}

h2, h3, h4 {
  margin: 0 0 10px;
}

label {
  display: block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 13px;
}

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

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

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #8da2ff;
  box-shadow: 0 0 0 3px rgba(97, 119, 239, 0.15);
}

textarea { resize: vertical; }

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.02); }

.btn-primary {
  color: #fff;
  background: linear-gradient(130deg, var(--primary), var(--primary2));
}

.btn-light {
  color: #1d315d;
  background: #eef3ff;
  border: 1px solid #d6e1ff;
}

.btn-success {
  color: #fff;
  background: linear-gradient(130deg, #00a884, #00c79a);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(130deg, #e74c3c, #ff7d4d);
}

.msg {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  border-radius: 10px;
  padding: 8px 10px;
  background: #eef4ff;
  border: 1px dashed #c8d9ff;
}
.msg-ok {
  background: #ebfff5;
  border-color: #b8ead3;
}
.msg-err {
  background: #fff0ed;
  border-color: #f3c2b8;
}

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

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px;
}

.user-box {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 12px;
  padding: 10px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(130deg, #6270e6, #904dcb);
  font-weight: 800;
}

.name { font-weight: 700; }
.balance { color: var(--muted); font-size: 13px; margin-top: 2px; }

.menu {
  margin-top: 16px;
  display: grid;
  gap: 6px;
}

.menu a {
  text-decoration: none;
  color: #324a79;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: all 0.18s ease;
}

.menu a.active,
.menu a:hover {
  background: #eef3ff;
  color: #0d2f77;
  transform: translateX(2px);
}

.main { display: grid; grid-template-rows: 62px 1fr; }

.topbar {
  height: 62px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.brand {
  font-size: 12px;
  color: #0000fa;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.content {
  padding: clamp(12px, 2vw, 28px);
  display: grid;
  gap: 16px;
  width: min(2200px, 100%);
  margin: 0 auto;
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(14px, 1.8vw, 24px);
  box-shadow: 0 14px 34px rgba(39, 72, 133, 0.08);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 12px;
}

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

.stat {
  border-radius: 14px;
  color: #fff;
  padding: clamp(14px, 1.4vw, 20px);
  box-shadow: 0 14px 30px rgba(36, 48, 96, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(36, 48, 96, 0.3);
}

.stat h4 {
  margin: 0 0 6px;
  font-size: clamp(12px, 0.9vw, 14px);
  opacity: 0.95;
}
.stat-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  display: grid;
  place-items: center;
  font-size: 13px;
}

.stat p {
  margin: 0;
  font-size: clamp(22px, 2vw, 34px);
  font-weight: 800;
}
.metric-unit {
  font-size: 0.58em;
  opacity: 0.9;
  margin-left: 3px;
}
.stat-sub {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.92;
}

.grad-a { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.grad-b { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.grad-c { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.grad-d { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.service {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(28, 45, 89, 0.08);
}

.service-title { font-weight: 700; }
.service-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.service-meta {
  display: inline-block;
  margin-top: 6px;
  margin-right: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #edf4ff;
  color: #2d538f;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(13px, 0.92vw, 15px);
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

th, td {
  border-bottom: 1px solid #e8eefb;
  padding: 10px;
  text-align: left;
}

th { color: #526b99; font-size: 13px; }

.badge {
  font-size: 11px;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 700;
}
.badge i { margin-right: 4px; }

.b-wait { background: #fff6da; color: #966500; }
.b-ok { background: #dcfff5; color: #0d8b6c; }
.b-timeout { background: #ffe8e3; color: #ac3a2a; }

.code-box {
  background: #0a1838;
  color: #dce8ff;
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  overflow: auto;
  white-space: pre-wrap;
  box-shadow: inset 0 0 0 1px rgba(151, 180, 255, 0.15);
}

@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-screen { grid-template-columns: 1fr; }
  .login-left { min-height: 280px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (min-width: 1920px) {
  .content { width: min(2440px, 100%); }
  .menu a { padding: 12px 14px; font-size: 15px; }
  .card { border-radius: 18px; }
}

@media (min-width: 2560px) {
  .content { width: min(3000px, 100%); gap: 20px; }
  .topbar { height: 70px; }
  .main { grid-template-rows: 70px 1fr; }
  .card { padding: 24px 26px; }
}

@media (min-width: 3840px) {
  body { font-size: 18px; }
  .content { width: min(4400px, 100%); }
  .sidebar { width: 360px; }
  .app-shell { grid-template-columns: 360px 1fr; }
}
