@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #b7791f;
  --primary-strong: #975a16;
  --primary-soft: #fff5df;
  --secondary: #0f766e;
  --secondary-soft: #dff7f3;
  --accent: #1d4ed8;
  --accent-soft: #dbeafe;
  --danger: #b91c1c;
  --warning: #b45309;
  --success: #0f766e;
  --gray-50: #f6f7fb;
  --gray-100: #eef1f6;
  --gray-200: #d9e0ea;
  --gray-300: #b8c4d3;
  --gray-400: #8291a6;
  --gray-500: #5c6b80;
  --gray-600: #405065;
  --gray-700: #29384b;
  --gray-800: #172231;
  --gray-900: #0c1422;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-dark: #0f1726;
  --surface-dark-strong: #131d2d;
  --border: rgba(140, 155, 180, 0.22);
  --border-strong: rgba(111, 128, 156, 0.28);
  --shadow-sm: 0 10px 30px rgba(15, 23, 38, 0.06);
  --shadow-md: 0 20px 60px rgba(15, 23, 38, 0.10);
  --shadow-lg: 0 32px 90px rgba(15, 23, 38, 0.14);
  --radius-sm: 0.95rem;
  --radius: 1.3rem;
  --radius-lg: 1.8rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.10), transparent 28%),
    radial-gradient(circle at top right, rgba(183, 121, 31, 0.10), transparent 22%),
    linear-gradient(180deg, #f7f9fc 0%, #f2f5fa 48%, #edf2f7 100%);
  color: var(--gray-900);
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--gray-900);
  font-weight: 600;
  letter-spacing: -0.03em;
}

h1 { font-size: clamp(2rem, 4vw, 3.6rem); }
h2 { font-size: clamp(1.55rem, 2.3vw, 2.15rem); }
h3 { font-size: clamp(1.02rem, 1.5vw, 1.24rem); }

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.24);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 1rem;
  z-index: 2000;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: var(--surface-dark);
  color: #f8fafc;
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  top: 1rem;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 32px rgba(15, 23, 38, 0.05);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  display: block;
  width: min(196px, 100%);
  height: auto;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a:not(.btn) {
  color: var(--gray-600);
  font-weight: 600;
  padding: 0.62rem 0.9rem;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-links a:not(.btn):hover,
.nav-links a[aria-current="page"] {
  color: var(--gray-900);
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.72rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 0.9rem/1 "IBM Plex Sans", sans-serif;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #c7912f 0%, #b7791f 100%);
  color: #fffefb;
  box-shadow: 0 16px 30px rgba(183, 121, 31, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b7791f 0%, #975a16 100%);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.86);
  color: var(--gray-800);
  border-color: var(--border);
  box-shadow: 0 8px 20px rgba(15, 23, 38, 0.04);
}

.btn-secondary:hover {
  background: white;
  border-color: var(--border-strong);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  box-shadow: 0 16px 28px rgba(185, 28, 28, 0.18);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
  font-size: 0.92rem;
  font-weight: 600;
}

.form-control,
select,
input,
textarea {
  width: 100%;
  min-height: 2.95rem;
  padding: 0.72rem 0.92rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.84);
  color: var(--gray-900);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

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

.form-control:focus,
select:focus,
input:focus,
textarea:focus {
  outline: none;
  background: white;
  border-color: rgba(29, 78, 216, 0.34);
  box-shadow:
    0 0 0 4px rgba(29, 78, 216, 0.10),
    0 10px 20px rgba(15, 23, 38, 0.05);
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86));
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.74));
}

.card-body {
  padding: 1.35rem 1.4rem;
}

.table-wrap {
  overflow: auto;
  border-radius: calc(var(--radius) - 0.2rem);
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.76);
}

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

.table th,
.table td {
  padding: 0.86rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
  vertical-align: top;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(246, 247, 251, 0.96);
  color: var(--gray-500);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.92);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-success {
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
}

.badge-warning {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
}

.badge-danger {
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
}

.badge-info {
  background: rgba(29, 78, 216, 0.10);
  color: #1d4ed8;
}

.dashboard {
  display: flex;
  gap: 1.25rem;
  min-height: 100vh;
  padding: 1.25rem;
  align-items: stretch;
}

.sidebar {
  width: 292px;
  flex: 0 0 292px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(183, 121, 31, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(19, 29, 45, 0.98), rgba(12, 20, 34, 0.98));
  box-shadow: 0 32px 80px rgba(8, 15, 26, 0.26);
  color: #f8fafc;
  position: sticky;
  top: 1.25rem;
  align-self: flex-start;
}

.dashboard-brand {
  margin-bottom: 0.25rem;
  padding: 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dashboard-brand-link {
  display: block;
  text-decoration: none;
}

.dashboard-brand-copy {
  min-width: 0;
}

.dashboard-brand-logo {
  display: block;
  width: min(188px, 100%);
  height: auto;
}

.dashboard-brand-caption {
  display: inline-flex;
  margin-top: 0.55rem;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-nav {
  list-style: none;
  display: grid;
  gap: 0.42rem;
}

.sidebar-nav li {
  margin-bottom: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.9rem;
  padding: 0.72rem 0.92rem;
  border-radius: 1rem;
  color: rgba(226, 232, 240, 0.78);
  font-weight: 600;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: linear-gradient(135deg, rgba(183, 121, 31, 0.20), rgba(29, 78, 216, 0.18));
  color: #ffffff;
  text-decoration: none;
  transform: translateX(2px);
}

#user-info {
  padding: 0.95rem !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f8fafc;
}

#user-name {
  color: #f8fafc;
}

#user-email {
  color: rgba(226, 232, 240, 0.70) !important;
}

#logoutBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #fecaca !important;
  font-weight: 600;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 0.35rem;
}

.dashboard-footer {
  margin-top: 1.6rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at right top, rgba(29, 78, 216, 0.08), transparent 24%),
    rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) auto auto;
  gap: 1rem;
  align-items: center;
}

.dashboard-footer-block {
  min-width: 0;
}

.dashboard-footer-title {
  color: var(--gray-900);
  font-size: 0.92rem;
  font-weight: 700;
}

.dashboard-footer-copy {
  margin-top: 0.24rem;
  color: var(--gray-600);
  font-size: 0.84rem;
  line-height: 1.55;
}

.dashboard-footer-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-footer-links a {
  color: var(--gray-600);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dashboard-footer-links a:hover {
  color: var(--gray-900);
  text-decoration: none;
}

.dashboard-footer-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-footer-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.34rem 0.68rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--gray-600);
  font-size: 0.76rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.15rem;
  margin-bottom: 1.3rem;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.84));
  box-shadow: var(--shadow-sm);
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -18% -48% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(29, 78, 216, 0.07);
  filter: blur(8px);
}

.stat-card h3 {
  position: relative;
  z-index: 1;
  margin-bottom: 0.55rem;
  color: var(--gray-500);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card .value {
  position: relative;
  z-index: 1;
  font-size: clamp(1.8rem, 2.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--gray-900);
}

.balance-card {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 26%),
    linear-gradient(135deg, #1d4ed8 0%, #0f766e 46%, #0c1422 100%);
  border-color: rgba(255, 255, 255, 0.08);
}

.balance-card h3,
.balance-card .value,
.balance-card small {
  color: #f8fafc !important;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 20, 34, 0.55);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  width: min(680px, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 251, 253, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.4rem;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.modal-body {
  padding: 1.2rem;
}

.modal-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.close {
  cursor: pointer;
  font-size: 1.45rem;
  color: var(--gray-500);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--gray-600);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.icon-button:hover {
  background: white;
  color: var(--gray-900);
  transform: translateY(-1px);
}

.alert {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-success {
  background: rgba(15, 118, 110, 0.10);
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.16);
}

.alert-danger {
  background: rgba(185, 28, 28, 0.10);
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.14);
}

.alert-warning {
  background: rgba(180, 83, 9, 0.10);
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.16);
}

.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(148, 163, 184, 0.34);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.guide-content {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
}

.guide-content h1 {
  margin-bottom: 1.4rem;
}

.guide-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.85rem;
}

.guide-content h3 {
  margin-top: 1.35rem;
  margin-bottom: 0.7rem;
}

.guide-content p {
  margin-bottom: 1rem;
  color: var(--gray-700);
}

.guide-content ul,
.guide-content ol {
  margin-bottom: 1rem;
  padding-left: 1.35rem;
}

.guide-content code {
  background: var(--gray-100);
  padding: 0.2rem 0.42rem;
  border-radius: 0.45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

.guide-content pre {
  background: #0f1726;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.guide-content pre code {
  background: none;
  padding: 0;
}

.public-shell {
  min-height: 100vh;
}

.auth-shell {
  min-height: calc(100vh - 78px);
  padding: 2.5rem 0 3rem;
}

.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 450px);
  gap: 1.4rem;
  align-items: stretch;
}

.auth-aside,
.auth-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
}

.auth-aside {
  padding: 2rem;
  background:
    radial-gradient(circle at top right, rgba(183, 121, 31, 0.12), transparent 26%),
    linear-gradient(160deg, rgba(29, 78, 216, 0.08), rgba(15, 118, 110, 0.06)),
    rgba(255, 255, 255, 0.98);
}

.auth-kicker {
  display: inline-flex;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.08);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-aside h1 {
  margin-top: 1rem;
  max-width: 11ch;
}

.auth-aside p {
  margin-top: 1rem;
  color: var(--gray-600);
  max-width: 56ch;
}

.auth-points {
  margin-top: 1.45rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.auth-point {
  padding: 1rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.78);
}

.auth-point strong {
  display: block;
  color: var(--gray-900);
  margin-bottom: 0.35rem;
}

.auth-point span {
  color: var(--gray-600);
  font-size: 0.92rem;
}

.auth-card {
  padding: 2rem;
}

.auth-mini-logo {
  display: block;
  width: min(190px, 100%);
  height: auto;
  margin: 0 auto 1.25rem;
}

.public-footer {
  padding: 1.2rem 0 2rem;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.public-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.public-footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.public-footer-links a {
  color: var(--gray-600);
  font-weight: 700;
}

.public-footer-links a:hover {
  color: var(--gray-900);
  text-decoration: none;
}

@media (max-width: 980px) {
  .dashboard {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-basis: auto;
    position: static;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.2rem;
  }

  .sidebar-nav a {
    white-space: nowrap;
    flex: 0 0 auto;
  }
}

@media (max-width: 768px) {
  .navbar {
    position: static;
  }

  .navbar .container {
    min-height: 72px;
    flex-wrap: wrap;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
  }

  .auth-shell {
    padding-top: 1.25rem;
  }

  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-aside,
  .auth-card,
  .guide-content {
    padding: 1.25rem;
  }

  .auth-points {
    grid-template-columns: 1fr;
  }

  .dashboard {
    padding: 0.9rem;
  }

  .sidebar {
    padding: 1rem;
    border-radius: 1.35rem;
  }

  .main-content {
    padding: 0;
  }

  .card-header,
  .card-body,
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-footer {
    grid-template-columns: 1fr;
  }

  .dashboard-footer-links,
  .dashboard-footer-meta {
    justify-content: flex-start;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    min-width: 640px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 0.9rem;
  }

  .btn {
    width: 100%;
  }

  .nav-links {
    justify-content: stretch;
  }

  .nav-links a:not(.btn) {
    flex: 1 1 auto;
    text-align: center;
  }

  .logo img,
  .dashboard-brand-logo,
  .auth-mini-logo {
    width: min(170px, 100%);
  }

  .public-footer .container {
    align-items: flex-start;
  }
}
