:root {

  --bg: #06070b;
  --bg-secondary: #0d1017;

  --glass: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.08);

  --text: #f5f7ff;
  --text-secondary: #8c93a8;

  --blue: #3b82ff;
  --blue-soft: rgba(59,130,255,0.18);

  --success: #1ce783;

  --radius: 24px;

  --shadow:
    0 20px 40px rgba(0,0,0,0.45);

  --blur: blur(18px);

}

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

body {

  background: var(--bg);
  color: var(--text);

  font-family:
    Inter,
    system-ui,
    sans-serif;

  min-height: 100vh;
  overflow-x: hidden;
}

.app-bg {

  position: fixed;
  inset: 0;

  background:
    radial-gradient(
      circle at top left,
      rgba(59,130,255,0.15),
      transparent 30%
    ),

    radial-gradient(
      circle at bottom right,
      rgba(0,255,200,0.08),
      transparent 30%
    ),

    var(--bg);

  z-index: -2;
}

.noise {

  position: fixed;
  inset: 0;

  opacity: 0.03;
  z-index: -1;

  background-image:
    url("https://grainy-gradients.vercel.app/noise.svg");
}

.app-shell {

  width: 100%;
  max-width: 640px;

  margin: 0 auto;

  padding:
    env(safe-area-inset-top)
    0 0 0;

  position: relative;
}

.glass {

  background: var(--glass);

  border:
    1px solid
    var(--glass-border);

  backdrop-filter: var(--blur);

  -webkit-backdrop-filter: var(--blur);

  box-shadow: var(--shadow);
}

.topbar {

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 18px;
  border-radius: 28px;

  position: sticky;
  top: 12px;

  z-index: 100;

  margin: 12px 18px 0 18px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-wrapper {
  position: relative;
}

.logo-glow {

  position: absolute;
  inset: -10px;

  background: #7FFFD4;
  filter: blur(24px);

  opacity: 0.6;
}

.logo {

  width: 100px;
  height: 100px;

  border-radius: 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  object-fit: contain;
}

.brand h1 {
  font-size: 16px;
}

.brand span {

  color: var(--text-secondary);
  font-size: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {

  border: none;
  outline: none;

  background:
    rgba(255,255,255,0.05);

  color: white;

  padding: 10px 14px;

  border-radius: 14px;

  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {

  width: 8px;
  height: 8px;

  border-radius: 999px;
  background: var(--success);
}

.avatar {

  width: 40px;
  height: 40px;

  border-radius: 50%;

  background:
    linear-gradient(
      135deg,
      #4f46e5,
      #3b82ff
    );
}

.company-display {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-display span {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.hero-card {

  border-radius: 32px;
  padding: 28px;

  overflow: hidden;
  position: relative;
}

.hero-content {

  display: flex;
  flex-direction: column;
  gap: 24px;
}

.badge {

  display: inline-flex;
  width: fit-content;

  padding: 8px 12px;

  border-radius: 999px;

  background: var(--blue-soft);

  color: #8db7ff;

  font-size: 12px;
  font-weight: 600;
}

.hero-text h2 {

  margin-top: 16px;

  font-size: 38px;
  line-height: 1.05;

  letter-spacing: -1.4px;
}

.hero-text p {

  margin-top: 16px;

  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-actions {

  margin-top: 24px;

  display: flex;
  gap: 12px;
}

.primary-btn {

  border: none;

  background:
    linear-gradient(
      135deg,
      #3b82ff,
      #005eff
    );

  color: white;

  padding: 16px 20px;

  border-radius: 18px;

  font-weight: 600;
}

.secondary-btn {

  border: 1px solid rgba(255,255,255,0.08);

  background:
    rgba(255,255,255,0.04);

  color: white;

  padding: 16px 20px;

  border-radius: 18px;
}

.hero-stats {

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.floating-card {

  padding: 18px;
  border-radius: 24px;
}

.floating-card span {

  color: var(--text-secondary);
  font-size: 13px;
}

.floating-card h3 {

  margin-top: 10px;
  font-size: 28px;
}

.kpi-grid {

  margin-top: 22px;

  display: grid;
  grid-template-columns: repeat(2, 1fr);

  gap: 16px;
}

.kpi-card {

  border-radius: 24px;
  padding: 18px;
}

.kpi-top {

  display: flex;
  justify-content: space-between;
}

.live-indicator {

  width: 10px;
  height: 10px;

  border-radius: 999px;

  background: var(--success);

  box-shadow:
    0 0 14px var(--success);
}

.kpi-card h3 {

  margin-top: 18px;

  font-size: 28px;
}

.kpi-card p {

  margin-top: 8px;

  color: var(--text-secondary);
}

.dashboard-grid {

  margin-top: 22px;

  display: grid;
  gap: 18px;
}

.dashboard-card {

  border-radius: 28px;
  padding: 22px;
  margin-top: 7x;
}

.card-header {

  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header button {

  background:
    rgba(255,255,255,0.05);

  border: none;

  color: white;

  padding: 10px 14px;

  border-radius: 12px;
}

.chart-placeholder {

  margin-top: 24px;

  height: 220px;

  border-radius: 22px;

  background:
    linear-gradient(
      180deg,
      rgba(59,130,255,0.18),
      transparent
    );

  position: relative;
}

.chart-line {

  position: absolute;

  left: 0;
  right: 0;
  bottom: 50px;

  height: 3px;

  background:
    linear-gradient(
      90deg,
      transparent,
      #3b82ff,
      transparent
    );
}

.ai-insight {

  margin-top: 18px;

  display: flex;
  gap: 14px;
}

.ai-dot {

  width: 12px;
  height: 12px;

  border-radius: 999px;

  margin-top: 6px;

  background: #3b82ff;

  box-shadow:
    0 0 16px #3b82ff;
}

.ai-insight p {

  margin-top: 6px;

  color: var(--text-secondary);
  line-height: 1.5;
}

.task-item,
.activity-item {

  margin-top: 18px;

  display: flex;
  gap: 14px;
}

.task-status {

  width: 12px;
  height: 12px;

  border-radius: 999px;

  background: orange;

  margin-top: 6px;
}

.activity-time {

  color: #7c86a5;
  min-width: 50px;
}

.bottom-nav {

  position: fixed;

  left: 50%;
  transform: translateX(-50%);

  bottom: 18px;

  width: calc(100% - 32px);
  max-width: 608px;

  padding: 14px;

  border-radius: 28px;

  display: flex;
  justify-content: space-around;

  z-index: 999;
}

.nav-item {

  background: transparent;
  border: none;

  color: #9ea5bb;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;

  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-item.active {
  color: white;
}

/* SCREENS */

.screens-container {
  width: 100%;
}

.screen {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.main-content {
  padding: 24px 18px 120px 18px;
}

/* FORMS */

.invoice-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-section {
  margin-top: 22px;
  padding: 20px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.products-select {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background 0.2s;
}

.product-item:hover {
  background: rgba(255,255,255,0.06);
}

.product-info {
  flex: 1;
}

.product-name {
  font-weight: 500;
  font-size: 14px;
}

.product-price {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.product-actions {
  display: flex;
  gap: 8px;
}

.qty-input {
  width: 60px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-align: center;
  font-size: 12px;
}

/* CART */

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  font-size: 13px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-weight: 600;
}

.cart-summary {
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border-top: 1px solid var(--glass-border);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin: 6px 0;
}

/* BUTTONS */

.primary-btn {

  border: none;

  background:
    linear-gradient(
      135deg,
      #3b82ff,
      #005eff
    );

  color: white;

  padding: 16px 20px;

  border-radius: 18px;

  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.primary-btn:active {
  transform: scale(0.98);
}

.secondary-btn {

  border: 1px solid rgba(255,255,255,0.08);

  background:
    rgba(255,255,255,0.04);

  color: white;

  padding: 16px 20px;

  border-radius: 18px;
  cursor: pointer;
  transition: background 0.2s;
}

.secondary-btn:hover {
  background: rgba(255,255,255,0.06);
}

.btn-full {
  width: 100%;
}

.back-btn {
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  margin-bottom: 16px;
}

.view-btn {
  background: rgba(255,255,255,0.05);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
}

/* INVOICE DETAILS */

.invoice-details {
  padding: 24px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.invoice-header h2 {
  font-size: 24px;
  margin: 0;
}

.invoice-header p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--blue-soft);
  color: #8db7ff;
}

.status-badge.draft {
  background: rgba(255,255,255,0.1);
  color: var(--text-secondary);
}

.status-badge.pending {
  background: rgba(255,165,0,0.2);
  color: #FFB347;
}

.status-badge.posted {
  background: rgba(28,231,131,0.2);
  color: var(--success);
}

.invoice-items-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.table-header {
  display: grid;
  grid-template-columns: 1fr 80px 100px;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
}

.invoice-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.invoice-item-row {
  display: grid;
  grid-template-columns: 1fr 80px 100px;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  font-size: 13px;
}

.col {
  display: flex;
  align-items: center;
}

.col-center {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.col-right {
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.invoice-totals {
  padding: 16px;
  background: rgba(59,130,255,0.1);
  border-radius: 12px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 16px;
}

.invoice-actions {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

/* WAREHOUSE */

.warehouse-controls {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 16px;
  margin-top: 22px;
}

.warehouse-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 352px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #4f6cff transparent;
}

.products-select,
.cart-items,
.invoices-list,
.activity-list,
.documents-list,
.invoice-items-list {
  scrollbar-width: thin;
  scrollbar-color: #4f6cff transparent;
}

.warehouse-table::-webkit-scrollbar,
.products-select::-webkit-scrollbar,
.cart-items::-webkit-scrollbar,
.invoices-list::-webkit-scrollbar,
.activity-list::-webkit-scrollbar,
.documents-list::-webkit-scrollbar,
.invoice-items-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.warehouse-table::-webkit-scrollbar-track,
.products-select::-webkit-scrollbar-track,
.cart-items::-webkit-scrollbar-track,
.invoices-list::-webkit-scrollbar-track,
.activity-list::-webkit-scrollbar-track,
.documents-list::-webkit-scrollbar-track,
.invoice-items-list::-webkit-scrollbar-track {
  background: transparent;
}

.warehouse-table::-webkit-scrollbar-thumb,
.products-select::-webkit-scrollbar-thumb,
.cart-items::-webkit-scrollbar-thumb,
.invoices-list::-webkit-scrollbar-thumb,
.activity-list::-webkit-scrollbar-thumb,
.documents-list::-webkit-scrollbar-thumb,
.invoice-items-list::-webkit-scrollbar-thumb {
  background-color: #4f6cff;
  border-radius: 999px;
}

.warehouse-table::-webkit-scrollbar-thumb:hover,
.warehouse-table::-webkit-scrollbar-thumb:active,
.products-select::-webkit-scrollbar-thumb:hover,
.products-select::-webkit-scrollbar-thumb:active,
.cart-items::-webkit-scrollbar-thumb:hover,
.cart-items::-webkit-scrollbar-thumb:active,
.invoices-list::-webkit-scrollbar-thumb:hover,
.invoices-list::-webkit-scrollbar-thumb:active,
.activity-list::-webkit-scrollbar-thumb:hover,
.activity-list::-webkit-scrollbar-thumb:active,
.documents-list::-webkit-scrollbar-thumb:hover,
.documents-list::-webkit-scrollbar-thumb:active,
.invoice-items-list::-webkit-scrollbar-thumb:hover,
.invoice-items-list::-webkit-scrollbar-thumb:active {
  background-color: #3b54d1;
}

.warehouse-item {
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.warehouse-item-name {
  font-weight: 500;
  font-size: 14px;
}

.warehouse-item-stock {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stock-number {
  font-weight: 600;
  color: var(--blue);
}

/* INVOICES LIST */

.invoices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  min-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.invoice-list-item {
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.invoice-list-item:hover {
  background: rgba(255,255,255,0.05);
}

.invoice-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.invoice-item-number {
  font-weight: 600;
  font-size: 13px;
}

.invoice-item-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ACTIVITY */

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.activity-item {
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.activity-time {
  color: var(--text-secondary);
  min-width: 50px;
  font-weight: 500;
}

.activity-text {
  flex: 1;
  color: var(--text);
}

/* DOCUMENTS */

.documents-list {
  display: grid;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.document-item {
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.document-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.document-icon {
  font-size: 20px;
}

.document-details {
  display: flex;
  flex-direction: column;
}

.document-name {
  font-weight: 500;
  font-size: 13px;
}

.document-date {
  font-size: 11px;
  color: var(--text-secondary);
}

.document-download {
  background: var(--blue-soft);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

@media (max-width: 480px) {

  .hero-text h2 {
    font-size: 32px;
  }

}