:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --line: #dfe7f1;
  --text: #233042;
  --muted: #6f7d90;
  --primary: #1d74f5;
  --primary-soft: #e9f2ff;
  --green: #16a34a;
  --orange: #ea580c;
  --nav: #0f172a;
  --nav-soft: #162134;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.warning {
  color: var(--orange);
}

.section-space {
  margin-bottom: 18px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top right, rgba(29,116,245,.10), transparent 28%),
    radial-gradient(circle at bottom left, rgba(14,165,164,.10), transparent 24%),
    linear-gradient(180deg, #f7fbff 0%, #eef4fb 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(15,23,42,.12);
}

.login-left {
  padding: 44px;
  background: linear-gradient(135deg, #1173f4, #3f92ff);
  color: #fff;
  position: relative;
}

.login-left::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.logo-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.16);
  font-size: 20px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.login-left h1 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.2;
}

.login-left p {
  margin: 0;
  color: rgba(255,255,255,.88);
  line-height: 1.7;
  max-width: 520px;
}

.feature-points {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.feature-pill {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(4px);
}

.login-right {
  padding: 40px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-right h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-right p {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.6;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #9ac3ff;
  box-shadow: 0 0 0 4px rgba(29,116,245,.10);
}

.row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(29,116,245,.20);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-soft {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid #cfe0ff;
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}

.demo-hint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  background: #f8fbff;
  border: 1px dashed #c9daf7;
  border-radius: 14px;
  padding: 12px 14px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
}

.app-body {
  min-width: 0;
}

.sidebar {
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-soft) 100%);
  color: #fff;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-top .logo-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2684ff, #58a2ff);
}

.sidebar h3 {
  margin: 0;
  font-size: 17px;
}

.sidebar small {
  color: rgba(255,255,255,.62);
}

.menu-group-title {
  color: rgba(255,255,255,.48);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin: 10px 10px 4px;
}

.nav-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.88);
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-btn:hover,
.nav-btn.active {
  background: rgba(255,255,255,.10);
  color: #fff;
}

.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244,247,251,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-topbar .menu-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.main {
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.search {
  flex: 1;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.company-chip,
.user-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.hero {
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 760px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.grid-4,
.grid-3,
.grid-2 {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card.highlight {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 700;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
}

.stat-note {
  font-size: 13px;
  color: var(--green);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 18px;
}

.muted {
  color: var(--muted);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.paid {
  background: #dcfce7;
  color: #166534;
}

.due {
  background: #ffedd5;
  color: #9a3412;
}

.draft {
  background: #e5e7eb;
  color: #374151;
}

.tax {
  background: #ede9fe;
  color: #6d28d9;
}

.mini-chart {
  height: 230px;
  border-radius: 18px;
  background: linear-gradient(180deg, #eef5ff 0%, #ffffff 100%);
  border: 1px solid #e4efff;
  position: relative;
  overflow: hidden;
}

.bars {
  position: absolute;
  inset: 18px 18px 36px;
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
}

.bar {
  flex: 1;
  min-height: 24px;
  border-radius: 12px 12px 8px 8px;
  background: linear-gradient(180deg, #61a6ff, #1d74f5);
  position: relative;
}

.bar span {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.report-box {
  border: 1px dashed #cfe0ff;
  background: #f8fbff;
  border-radius: 16px;
  padding: 14px 16px;
}

.report-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed #dbeafe;
}

.report-line:last-child {
  border-bottom: 0;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.inventory-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}

.inventory-item h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
  margin-top: 10px;
}

.progress > div {
  height: 100%;
  background: linear-gradient(90deg, #1d74f5, #57a6ff);
  border-radius: inherit;
}

.bank-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.bank-card {
  border-radius: 20px;
  padding: 18px;
  color: #fff;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.bank-card.blue {
  background: linear-gradient(135deg, #1d74f5, #4f9dff);
}

.bank-card.green {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.bank-card.dark {
  background: linear-gradient(135deg, #111827, #334155);
}

.bank-label {
  opacity: .8;
  font-size: 13px;
}

.bank-amount {
  font-size: 24px;
  font-weight: 800;
  margin-top: 8px;
}

.bank-meta {
  opacity: .8;
  font-size: 13px;
}

.coa-list {
  display: grid;
  gap: 10px;
}

.coa-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.kpi-stack {
  display: grid;
  gap: 12px;
}

.floating-mobile-nav {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: rgba(15,23,42,.94);
  color: #fff;
  border-radius: 18px;
  padding: 8px;
  z-index: 30;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  box-shadow: 0 18px 40px rgba(15,23,42,.22);
  backdrop-filter: blur(10px);
}

.floating-mobile-nav button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.78);
  border-radius: 12px;
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.floating-mobile-nav button.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

@media (max-width: 1180px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .inventory-grid,
  .bank-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 960px) {
  .login-card,
  .app,
  .grid-2,
  .row-2,
  .grid-3,
  .inventory-grid,
  .bank-cards {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    width: 280px;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-topbar {
    display: flex;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    max-width: none;
    width: 100%;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .main {
    padding: 16px 16px 90px;
  }

  .floating-mobile-nav {
    display: grid;
  }
}

@media (max-width: 640px) {
  .login-left,
  .login-right {
    padding: 24px;
  }

  .login-left h1 {
    font-size: 28px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 16px;
  }

  th,
  td {
    font-size: 13px;
    padding: 10px 8px;
  }

  .stat-value {
    font-size: 22px;
  }
}