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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
  overflow: hidden;
}

body.auth-locked {
  background:
    radial-gradient(circle at top, rgba(77, 163, 255, 0.18), transparent 42%),
    linear-gradient(180deg, #eef5ff 0%, #f7fbff 100%);
}

body.auth-locked .app {
  display: none;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(79, 162, 255, 0.18), transparent 24%),
    linear-gradient(135deg, #081b2f 0%, #0f4c81 45%, #0b2f52 100%);
  overflow: hidden;
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.06) 0%, transparent 30%),
    radial-gradient(circle at 70% 75%, rgba(88, 183, 255, 0.22), transparent 34%),
    radial-gradient(circle at 25% 80%, rgba(39, 174, 96, 0.14), transparent 26%);
  pointer-events: none;
}

.auth-screen::after {
  content: "";
  position: absolute;
  inset: -18%;
  background-image:
    radial-gradient(rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.12;
  transform: rotate(-10deg);
  pointer-events: none;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  align-items: stretch;
}

.auth-screen.hidden {
  display: none;
}

.auth-card {
  width: 100%;
  background:
    linear-gradient(180deg, rgba(16, 44, 76, 0.96) 0%, rgba(12, 34, 60, 0.96) 100%);
  border-radius: 22px;
  padding: 24px 22px;
  box-shadow: 0 28px 60px rgba(7, 27, 45, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  align-self: center;
}

.auth-card__eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.16);
  color: #d9ecff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.auth-card h2 {
  font-size: 24px;
  color: #f8fbff;
  margin-bottom: 8px;
}

.auth-card p {
  color: rgba(233, 242, 255, 0.78);
  margin-bottom: 16px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

.auth-form .form-group {
  margin-bottom: 14px;
}

.auth-form .form-group label {
  color: #e7f2ff;
  font-weight: 600;
}

.auth-form .form-control {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  height: 44px;
}

.auth-form .form-control::placeholder {
  color: rgba(230, 240, 250, 0.6);
}

.auth-form .form-control:focus {
  border-color: rgba(77, 163, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
}

.auth-form .form-control:-webkit-autofill,
.auth-form .form-control:-webkit-autofill:hover,
.auth-form .form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff;
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.08) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.auth-error {
  margin-top: -4px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(231, 76, 60, 0.12);
  border: 1px solid rgba(231, 76, 60, 0.28);
  color: #ffd6d1;
  font-size: 13px;
}

.auth-login-btn {
  width: 100%;
  padding: 11px 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: linear-gradient(135deg, #2ec866 0%, #1c9f52 100%);
  box-shadow: 0 14px 24px rgba(39, 174, 96, 0.24);
}

.auth-login-btn:hover {
  background: linear-gradient(135deg, #35d271 0%, #1c9f52 100%);
}

.app {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
  width: 280px;
  flex: 0 0 280px;
  background: linear-gradient(180deg, #0f4c81 0%, #0d3b66 100%);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 8px 0 24px rgba(13, 59, 102, 0.18);
}

.logo {
  padding: 24px 20px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.logo h2 {
  margin-bottom: 5px;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.logo p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

nav {
  padding: 14px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-btn {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #f8fbff;
  text-align: left;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.nav-btn.active {
  background: linear-gradient(135deg, #4da3ff 0%, #1e88e5 100%);
  color: white;
  box-shadow: 0 10px 20px rgba(30, 136, 229, 0.28);
}

/* Main Content Styles */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f5f5f5;
}

header {
  background: white;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 20;
}

header h1 {
  font-size: 24px;
  color: #2c3e50;
}

.header-right {
  color: #7f8c8d;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  text-align: right;
}

.header-logout {
  margin-top: 0;
  padding: 9px 14px;
}

.header-meta-sep {
  color: #b0b7bd;
}

.content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  min-width: 0;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.section > h2 {
  display: none;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #2c3e50;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: #3498db;
}

.search-select {
  position: relative;
}

.search-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #dfe6e9;
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  z-index: 20;
}

.search-select-list.hidden {
  display: none;
}

.search-select-item {
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
}

.search-select-item:hover,
.search-select-item.active {
  background: #ecf6fd;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.btn {
  padding: 12px 24px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn:hover {
  background: #2980b9;
}

.btn-primary {
  background: #27ae60;
}

.btn-primary:hover {
  background: #229954;
}

.btn-muted {
  background: #7f8c8d;
}

.btn-muted:hover {
  background: #6c7a7a;
}

#cancel-product-btn {
  display: none;
}

#cancel-customer-btn {
  display: none;
}

.btn-small {
  padding: 8px 16px;
  background: #95a5a6;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 5px;
}

/* Split Layout */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.product-layout {
  grid-template-columns: 360px 1fr;
}

.purchase-layout {
  grid-template-columns: 360px 1fr;
}

.customer-layout {
  grid-template-columns: 360px 1fr;
}

.left-panel, .right-panel {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.right-panel h3 {
  margin-bottom: 20px;
  color: #2c3e50;
}

/* Dashboard Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  padding: 22px 20px 18px;
  border-radius: 18px;
  border: 1px solid rgba(129, 176, 234, 0.18);
  box-shadow:
    0 12px 24px rgba(15, 76, 129, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.92);
  transform: translateY(0);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  animation: statCardIn 0.7s ease both;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.62) 0%, transparent 42%),
    linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 72%);
  opacity: 0.45;
  pointer-events: none;
}

.stat-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 255, 255, 0.95));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7);
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 22px 38px rgba(15, 76, 129, 0.14),
    0 0 0 1px rgba(255,255,255,0.7) inset;
  border-color: rgba(129, 176, 234, 0.38);
}

.stat-card h3 {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: #4e6b86;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 700;
}

.stat-card p {
  position: relative;
  z-index: 1;
  font-size: 28px;
  font-weight: bold;
  color: #12324f;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(255,255,255,0.75);
}

.stat-card:nth-child(1) { --accent: #2f80ed; animation-delay: 0.03s; }
.stat-card:nth-child(2) { --accent: #00b8d9; animation-delay: 0.08s; }
.stat-card:nth-child(3) { --accent: #ff9800; animation-delay: 0.13s; }
.stat-card:nth-child(4) { --accent: #8e44ad; animation-delay: 0.18s; }
.stat-card:nth-child(5) { --accent: #27ae60; animation-delay: 0.23s; }
.stat-card:nth-child(6) { --accent: #e74c3c; animation-delay: 0.28s; }
.stat-card:nth-child(7) { --accent: #16a085; animation-delay: 0.33s; }
.stat-card:nth-child(8) { --accent: #f39c12; animation-delay: 0.38s; }

@keyframes statCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Dashboard Charts */
.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  margin-top: 20px;
}

.chart-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(129, 176, 234, 0.16);
  box-shadow: 0 12px 24px rgba(15, 76, 129, 0.07);
  overflow: hidden;
}

.chart-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, #2f80ed 0%, #00b8d9 100%);
}

.chart-title {
  position: relative;
  z-index: 1;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
}

.chart-sub {
  position: relative;
  z-index: 1;
  color: #7f8c8d;
  font-size: 12px;
  margin-bottom: 12px;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.trend-widget--premium {
  gap: 12px;
  min-height: 320px;
  padding: 6px 2px 0;
}

.trend-summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "badge badge"
    "value value"
    "text text";
  gap: 4px 0;
  align-items: start;
  padding: 2px 4px 0;
}

.trend-summary__badge {
  grid-area: badge;
  justify-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(47, 128, 237, 0.12), rgba(22, 160, 133, 0.12));
  color: #184d86;
  border: 1px solid rgba(47, 128, 237, 0.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.trend-summary__value {
  grid-area: value;
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  color: #16324f;
  letter-spacing: -0.5px;
}

.trend-summary__text {
  grid-area: text;
  color: #6f8296;
  font-size: 12px;
}

.trend-chart {
  position: relative;
  min-height: 210px;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(47, 128, 237, 0.12), transparent 30%),
    radial-gradient(circle at 85% 25%, rgba(22, 160, 133, 0.10), transparent 26%),
    linear-gradient(180deg, #fbfdff 0%, #f5f9fe 100%);
  border: 1px solid rgba(129, 176, 234, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 10px 24px rgba(15, 76, 129, 0.06);
}

.trend-chart__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.trend-chart__grid line {
  stroke: rgba(125, 145, 166, 0.18);
  stroke-width: 1;
}

.trend-chart__labels {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  color: #5f7288;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255,255,255,0.9);
}

.trend-chart__footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.trend-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f4f8fc;
  color: #4e6b86;
  border: 1px solid #dce7f2;
  font-size: 12px;
  font-weight: 600;
}

.trend-pill--up {
  background: linear-gradient(135deg, #eaf7ef 0%, #dbf3e4 100%);
  border-color: #bfe7cd;
  color: #1f8f52;
}

.month-pie-chart {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: center;
  min-height: 220px;
}

.month-pie-chart__ring {
  --paid-angle: 0deg;
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(#2f80ed 0 var(--paid-angle), #f2994a var(--paid-angle) 100%);
  box-shadow:
    0 14px 28px rgba(15, 76, 129, 0.10),
    inset 0 0 0 1px rgba(255,255,255,0.78);
  margin: 0 auto;
}

.month-pie-chart__ring::before {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.month-pie-chart__center {
  position: absolute;
  inset: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 50%;
  z-index: 1;
}

.month-pie-chart__label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #6c8198;
  margin-bottom: 4px;
}

.month-pie-chart__center strong {
  font-size: 30px;
  line-height: 1;
  color: #16324f;
}

.month-pie-chart__center small {
  margin-top: 4px;
  color: #6a7e93;
  font-size: 12px;
  font-weight: 600;
}

.month-pie-chart__legend {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.month-pie-legend__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid rgba(129, 176, 234, 0.18);
}

.month-pie-legend__item strong {
  display: block;
  color: #16324f;
  font-size: 16px;
}

.month-pie-legend__item small {
  display: block;
  color: #6f8296;
  font-size: 12px;
  margin-top: 2px;
}

.month-pie-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.month-pie-swatch.paid {
  background: #2f80ed;
}

.month-pie-swatch.pending {
  background: #f2994a;
}

.year-line-chart {
  position: relative;
  min-height: 220px;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(47, 128, 237, 0.12), transparent 30%),
    radial-gradient(circle at 85% 25%, rgba(22, 160, 133, 0.10), transparent 26%),
    linear-gradient(180deg, #fbfdff 0%, #f5f9fe 100%);
  border: 1px solid rgba(129, 176, 234, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 10px 24px rgba(15, 76, 129, 0.06);
  padding: 12px 12px 44px;
}

.year-line-chart__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.year-line-chart__grid line {
  stroke: rgba(125, 145, 166, 0.18);
  stroke-width: 1;
}

.year-line-chart__area.sales {
  fill: rgba(47, 128, 237, 0.10);
}

.year-line-chart__area.purchase {
  fill: rgba(22, 160, 133, 0.10);
}

.year-line-chart__line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.year-line-chart__line.sales {
  stroke: url(#yearSalesStroke);
}

.year-line-chart__line.purchase {
  stroke: url(#yearPurchaseStroke);
}

.year-line-chart__points circle {
  fill: #fff;
  stroke-width: 4;
}

.year-line-chart__points.sales circle {
  stroke: #2f80ed;
}

.year-line-chart__points.purchase circle {
  stroke: #16a085;
}

.year-line-chart__labels {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  color: #5f7288;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255,255,255,0.9);
}

.year-line-chart__legend {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  z-index: 1;
  font-size: 12px;
  font-weight: 600;
  color: #4e6b86;
}

.year-line-chart__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(129, 176, 234, 0.18);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-swatch--sales {
  background: #2f80ed;
}

.legend-swatch--purchase {
  background: #16a085;
}

.trend-widget {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
  padding-top: 6px;
  position: relative;
  z-index: 1;
}

.trend-widget--premium .trend-chart {
  flex: 1;
}

.trend-widget--premium .trend-chart__labels {
  bottom: 14px;
}

.trend-bars {
  height: 165px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: end;
  padding: 10px 8px 0;
  background:
    linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border: 1px solid rgba(129, 176, 234, 0.18);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}

.trend-bar {
  height: var(--h);
  border-radius: 14px 14px 6px 6px;
  background: linear-gradient(180deg, #2f80ed 0%, #74b9ff 100%);
  box-shadow:
    0 10px 20px rgba(47, 128, 237, 0.22),
    inset 0 -1px 0 rgba(255,255,255,0.3);
  transform-origin: bottom;
  animation: barRise 0.8s ease both;
  animation-delay: var(--delay);
}

.trend-bar:nth-child(2n) {
  background: linear-gradient(180deg, #16a085 0%, #5bd6c2 100%);
  box-shadow:
    0 10px 20px rgba(22, 160, 133, 0.18),
    inset 0 -1px 0 rgba(255,255,255,0.3);
}

.trend-bar:nth-child(3n) {
  background: linear-gradient(180deg, #1e88e5 0%, #9dd4ff 100%);
}

.trend-labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  font-size: 12px;
  color: #6f8296;
  text-align: center;
  letter-spacing: 0.2px;
}

.trend-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #6f8296;
}

.trend-mini {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f7fb;
  border: 1px solid #dce7f2;
}

.trend-mini.up {
  background: #eef8f3;
  border-color: #ccefd7;
  color: #1f8f52;
  font-weight: 700;
}

@keyframes barRise {
  from {
    transform: scaleY(0.15);
    opacity: 0.35;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* Invoice Items */
.invoice-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

.invoice-add-card {
  background: rgba(52, 152, 219, 0.18);
  border: 1px solid rgba(52, 152, 219, 0.35);
  border-radius: 12px;
  padding: 18px;
}

.invoice-add-title {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 12px;
}

.invoice-add-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.invoice-add-form .form-group {
  margin-bottom: 14px;
}

.invoice-add-form .form-group:last-child {
  margin-bottom: 0;
}

.invoice-add-form .btn {
  width: 100%;
  margin-top: 8px;
}

.invoice-add-hint {
  color: #2c3e50;
  font-size: 13px;
  line-height: 1.4;
}

.invoice-main-card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.invoice-top-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
  margin-bottom: 16px;
}

.invoice-items,
.manual-invoice-items {
  background: rgba(52, 152, 219, 0.12);
  border: 1px solid rgba(52, 152, 219, 0.25);
  border-radius: 10px;
  overflow: hidden;
}

.invoice-items-header,
.manual-invoice-items-header {
  display: grid;
  grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 0.9fr 1fr 1fr 0.8fr;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(52, 152, 219, 0.35);
  color: #2c3e50;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.invoice-item-row,
.manual-invoice-item-row {
  display: grid;
  grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 0.9fr 1fr 1fr 0.8fr;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid rgba(44, 62, 80, 0.12);
  align-items: center;
}

.invoice-items-header > div,
.manual-invoice-items-header > div,
.invoice-item-row > *,
.manual-invoice-item-row > * {
  min-height: 24px;
  display: flex;
  align-items: center;
}

.invoice-item-row .btn-small,
.manual-invoice-item-row .btn-small {
  margin-top: 0;
}

.invoice-items-header > div:last-child,
.manual-invoice-items-header > div:last-child,
.invoice-item-row > :last-child,
.manual-invoice-item-row > :last-child {
  justify-content: flex-end;
}


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

.invoice-items-total,
.manual-invoice-items-total {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  font-weight: 600;
  background: rgba(52, 152, 219, 0.35);
  color: #2c3e50;
}

.invoice-summary {
  background: white;
  padding: 16px 0 0;
  margin-top: 16px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 16px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.modal-card {
  position: relative;
  width: min(900px, 92vw);
  max-height: 85vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  padding: 18px 22px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eef1f4;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.modal-header h3 {
  margin: 0;
  color: #2c3e50;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  color: #7f8c8d;
}

.modal-body {
  color: #2c3e50;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  border-top: 1px solid #eef1f4;
  padding-top: 12px;
}

.invoice-dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-bottom: 16px;
  font-size: 14px;
}

.invoice-dialog-grid .label {
  color: #7f8c8d;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.invoice-dialog-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}

.invoice-dialog-table th,
.invoice-dialog-table td {
  border-bottom: 1px solid #eef1f4;
  padding: 10px 8px;
  text-align: left;
}

.invoice-dialog-table th {
  color: #2c3e50;
  font-weight: 600;
  background: #f2f6fa;
}

.invoice-dialog-total {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  justify-content: end;
  margin-top: 12px;
  font-weight: 600;
}

.section-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  overflow: hidden;
}

.section-card__title {
  background: linear-gradient(180deg, #3a4c62 0%, #2d3f54 100%);
  color: #f6f8fa;
  padding: 14px 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.section-card__body {
  padding: 20px;
}

.product-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.product-search-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.product-search-row .form-control {
  flex: 1;
}

.product-table {
  margin-top: 18px;
  border: 1px solid #e6e9ee;
  border-radius: 10px;
  overflow: hidden;
}

.product-table-row {
  display: grid;
  grid-template-columns: 2.2fr 0.9fr 1fr 0.8fr 0.9fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f4;
  background: #fff;
}

.product-table-row.header {
  background: #2d3f54;
  color: #f6f8fa;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.6px;
}

.product-table-row:nth-child(even):not(.header) {
  background: #f2f3f5;
}

.product-cell-title {
  font-weight: 600;
  color: #2c3e50;
}

.product-cell-sub {
  color: #7f8c8d;
  font-size: 12px;
  margin-top: 4px;
}

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

.btn-action {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  cursor: pointer;
  color: #fff;
}

.btn-edit {
  background: #f39c12;
}

.btn-edit:hover {
  background: #d78b0c;
}

.btn-delete {
  background: #e74c3c;
}

.btn-delete:hover {
  background: #cf3f30;
}

.purchase-search-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.purchase-search-row .form-control {
  flex: 1;
}

.purchase-table {
  margin-top: 18px;
  border: 1px solid #e6e9ee;
  border-radius: 10px;
  overflow: hidden;
}

  .purchase-table-row {
    display: grid;
    grid-template-columns: 2.2fr 0.8fr 0.8fr 0.8fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f4;
  background: #fff;
}

.purchase-table-row.header {
  background: #2d3f54;
  color: #f6f8fa;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.6px;
}

.purchase-table-row:nth-child(even):not(.header) {
  background: #f2f3f5;
}

.customer-search-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.customer-search-row .form-control {
  flex: 1;
}

.project-search-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.project-search-row .form-control {
  flex: 1;
}

.customer-table {
  margin-top: 18px;
  border: 1px solid #e6e9ee;
  border-radius: 10px;
  overflow: hidden;
}

.customer-table-row {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1.2fr 0.9fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f4;
  background: #fff;
}

.customer-table-row.header {
  background: #2d3f54;
  color: #f6f8fa;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.6px;
}

.customer-table-row:nth-child(even):not(.header) {
  background: #f2f3f5;
}

/* Lists */
.products-grid, .customers-grid, .invoices-grid, .purchases-grid {
  display: grid;
  gap: 15px;
  margin-top: 20px;
}

.item-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-info h4 {
  margin-bottom: 5px;
  color: #2c3e50;
}

.item-info p {
  color: #7f8c8d;
  font-size: 13px;
}

.stock-badge {
  background: #27ae60;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

/* Search Box */
.search-box {
  margin-bottom: 20px;
}

.section-footer {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid #e6e9ee;
  color: #7f8c8d;
  font-size: 12px;
  text-align: center;
}

/* Invoice List */
.invoice-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.invoice-summary-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  text-align: center;
}

.invoice-summary-title {
  color: #7f8c8d;
  font-weight: 600;
  margin-bottom: 6px;
}

.invoice-summary-value {
  font-size: 26px;
  font-weight: 700;
  color: #27ae60;
  margin-bottom: 6px;
}

.invoice-summary-sub {
  color: #7f8c8d;
  font-size: 12px;
}

.invoice-search-row {
  margin-bottom: 16px;
}

.invoice-filter-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.7fr) minmax(160px, 0.8fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.invoice-filter-row--compact {
  margin-bottom: 14px;
}

.invoice-filter-row .form-group {
  margin-bottom: 0;
}

.invoice-filter-row label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #415a75;
}

.invoice-table {
  border: 1px solid #e6e9ee;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.invoice-table-row {
  display: grid;
  grid-template-columns: 1.2fr 2fr 1.1fr 1fr 1fr 1fr 0.75fr 0.9fr minmax(240px, 1.6fr);
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f4;
  background: #fff;
}

.invoice-table-row > div {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.invoice-table-row.header {
  background: #2d3f54;
  color: #f6f8fa;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.6px;
}

.invoice-table-row:nth-child(even):not(.header) {
  background: #f2f3f5;
}

#projects-list .invoice-table-row {
  grid-template-columns: minmax(90px, 0.7fr) minmax(160px, 1.6fr) minmax(100px, 0.8fr) minmax(95px, 0.8fr) minmax(110px, 0.9fr) minmax(100px, 0.8fr) minmax(160px, 1fr);
}

#projects-list .invoice-actions {
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
  width: 100%;
}

#projects-list .invoice-actions .btn-action {
  min-width: 78px;
  white-space: nowrap;
}

#khata-list .invoice-table-row {
  grid-template-columns: minmax(110px, 0.8fr) minmax(160px, 1.6fr) minmax(90px, 0.8fr) minmax(90px, 0.8fr) minmax(90px, 0.8fr) minmax(90px, 0.7fr);
}

#khata-invoices-list .invoice-table-row {
  grid-template-columns: minmax(130px, 1.7fr) minmax(110px, 0.95fr) minmax(105px, 0.9fr) minmax(95px, 0.9fr) minmax(100px, 0.95fr) minmax(70px, 0.5fr) minmax(90px, 0.8fr) minmax(100px, 0.85fr);
}

#khata-invoices-list .khata-invoice-row {
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

#khata-invoices-list .khata-invoice-row:hover {
  background: #eaf2ff;
}

#khata-invoices-list .khata-invoice-row:focus {
  outline: 2px solid #3498db;
  outline-offset: -2px;
}

#khata-payments-list .invoice-table-row {
  grid-template-columns: minmax(120px, 1fr) minmax(100px, 0.8fr);
}

#khata-advance-list .invoice-table-row {
  grid-template-columns: minmax(120px, 1fr) minmax(100px, 0.8fr) auto;
}

#khata-invoices-list .invoice-table-row > div:nth-child(8) {
  font-weight: 700;
}

#khata-advance-list .invoice-actions {
  justify-content: center;
}

#khata-advance-list .btn-action.icon-only {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1;
}

#khata-advance-list .btn-action.icon-only:hover {
  transform: translateY(-1px);
}

.khata-row {
  cursor: pointer;
}

.invoice-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.btn-view {
  background: #27ae60;
}

.btn-view:hover {
  background: #229954;
}

.btn-payment {
  background: #2980b9;
}

.btn-payment:hover {
  background: #2471a3;
}

.invoice-actions .btn-action {
  padding: 8px 10px;
  font-size: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 54px;
  text-align: center;
}

.project-form-card {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.khata-toolbar {
  display: grid;
  grid-template-columns: 2fr auto 2fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.khata-payment-inline {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.2fr auto auto;
  gap: 12px;
  align-items: center;
}

.khata-dual-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
  gap: 14px;
  margin-top: 16px;
  align-items: start;
}

.khata-dual-layout .section-card {
  min-width: 0;
}

.khata-dual-layout .section-card:nth-child(1) {
  min-height: 360px;
}

.khata-dual-layout .section-card:nth-child(2),
.khata-dual-layout .section-card:nth-child(3) {
  min-height: 260px;
}

.invoice-customer-balance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.invoice-customer-balance .summary-item {
  margin: 0;
}

.invoice-customer-balance-card {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #dde5ee;
  background: linear-gradient(135deg, #f8fbff 0%, #f3f8ff 100%);
}

.paid-amount-box {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #dbe5f1;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
  box-shadow: 0 8px 18px rgba(35, 58, 86, 0.08);
}

.paid-amount-box label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #3f5874;
}

.paid-amount-box input.form-control {
  border: 1px solid #c8d7ea;
  background: #fdfefe;
  font-size: 17px;
  font-weight: 700;
  color: #1f354d;
}

.paid-amount-box input.form-control:focus {
  border-color: #8db2e6;
  box-shadow: 0 0 0 3px rgba(72, 125, 197, 0.15);
}

.manual-paid-amount-box {
  background: linear-gradient(135deg, #fff2f2 0%, #ffe7e7 100%);
  border: 1px solid #efb6b6;
}

.manual-paid-amount-box label {
  color: #000000;
}

.manual-paid-amount-box input.form-control {
  border: 1px solid #d99c9c;
  background: #fffaf9;
  color: #000000;
}

.manual-paid-amount-box input.form-control::placeholder {
  color: #444444;
}

.manual-paid-amount-box input.form-control:focus {
  border-color: #c96f6f;
  box-shadow: 0 0 0 3px rgba(201, 111, 111, 0.16);
}

.invoice-customer-balance-title {
  font-size: 12px;
  font-weight: 700;
  color: #415a75;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}

.invoice-customer-balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.invoice-balance-pill {
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invoice-balance-pill.pending {
  background: #fff7f7;
  border-color: #ffd2d2;
}

.invoice-balance-pill.advance {
  background: #fff3f3;
  border-color: #f5c2c7;
}

.invoice-balance-label {
  font-size: 12px;
  color: #5b6d80;
}

.invoice-balance-value {
  font-size: 20px;
  font-weight: 700;
  color: #24364a;
}

.invoice-balance-pill.advance .invoice-balance-value {
  color: #c0392b;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  background: #ffffff;
  border: 1px solid #e6e9ee;
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.16);
  padding: 14px 16px;
  width: min(360px, 90vw);
}

.toast.hidden {
  display: none;
}

.toast-title {
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 6px;
}

.toast-body {
  color: #506070;
  font-size: 14px;
  margin-bottom: 12px;
}

.toast-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.project-detail-meta {
  display: flex;
  gap: 16px;
  color: #5a6b7d;
  font-size: 14px;
  margin-top: 4px;
}

@media (max-width: 1024px) {
  .invoice-summary-cards {
    grid-template-columns: 1fr;
  }

  .khata-toolbar {
    grid-template-columns: 1fr;
  }

  .khata-payment-inline {
    grid-template-columns: 1fr;
  }

  .khata-dual-layout {
    grid-template-columns: 1fr;
  }

  .invoice-customer-balance-grid {
    grid-template-columns: 1fr;
  }

  #khata-list .invoice-table-row,
  #khata-invoices-list .invoice-table-row,
  #khata-payments-list .invoice-table-row,
  #khata-advance-list .invoice-table-row {
    grid-template-columns: 1fr;
  }
}

/* Statements Grid */
.statements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.statement-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.statement-card h3 {
  margin-bottom: 20px;
  color: #2c3e50;
}

/* Project Section */
#project-invoice-section {
  border-top: 2px solid #eee;
  padding-top: 30px;
}

/* Responsive */
@media (max-width: 1024px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    box-shadow: none;
    max-height: 240px;
  }

  .logo {
    padding: 18px 18px 12px;
  }

  nav {
    padding: 12px;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-btn {
    width: auto;
    flex: 1 1 160px;
  }

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

  .product-layout {
    grid-template-columns: 1fr;
  }

  .purchase-layout {
    grid-template-columns: 1fr;
  }

  .customer-layout {
    grid-template-columns: 1fr;
  }

  .invoice-layout {
    grid-template-columns: 1fr;
  }

  .invoice-top-row {
    grid-template-columns: 1fr;
  }

  .invoice-filter-row {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .invoice-table-row {
    grid-template-columns: 1fr 1.4fr 0.9fr 0.8fr 0.8fr 0.8fr 0.6fr 0.7fr 1.4fr;
  }

  .invoice-table,
  .product-table,
  .purchase-table,
  .customer-table {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .invoice-items,
  .manual-invoice-items {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .month-pie-chart {
    grid-template-columns: 1fr;
    gap: 16px;
    justify-items: center;
  }

  .year-line-chart {
    min-height: 200px;
  }

  .year-line-chart__labels {
    left: 12px;
    right: 12px;
    font-size: 10px;
  }

  .year-line-chart__legend {
    top: 12px;
    right: 12px;
  }

  .trend-chart__footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100vh;
    width: 100%;
    flex-direction: column;
    overflow: visible;
  }

  .main-content {
    overflow: visible;
    min-height: 0;
  }

  .content {
    overflow: visible;
  }

  .auth-screen {
    padding: 14px;
  }

  .auth-card {
    padding: 20px 16px;
  }

  .auth-card h2 {
    font-size: 24px;
  }

  header {
    padding: 16px 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .content {
    padding: 16px;
  }

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

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

  .chart-card {
    border-radius: 16px;
  }

  .sidebar {
    max-height: none;
    position: relative;
    top: auto;
    z-index: auto;
    width: 100%;
    flex: 0 0 auto;
    box-shadow: none;
  }

  nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 12px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-btn {
    flex: 0 0 auto;
    min-width: 140px;
    text-align: center;
    white-space: nowrap;
    font-size: 12px;
  }

  .invoice-summary-cards {
    grid-template-columns: 1fr;
  }

  .invoice-layout,
  .split-layout,
  .invoice-top-row {
    grid-template-columns: 1fr;
  }

  .invoice-filter-row {
    grid-template-columns: 1fr;
  }

  .section-card__body {
    padding: 14px;
  }

  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-detail-meta {
    flex-direction: column;
    gap: 4px;
  }

  .invoice-filter-row label,
  .form-group label {
    font-size: 11px;
  }

  .form-control {
    font-size: 13px;
  }

  .btn,
  .btn-small {
    padding-left: 14px;
    padding-right: 14px;
  }

  .invoice-table,
  .product-table,
  .purchase-table,
  .customer-table {
    border-radius: 8px;
  }

  .invoice-table-row,
  .product-table-row,
  .purchase-table-row,
  .customer-table-row,
  .invoice-items-header,
  .invoice-item-row,
  .manual-invoice-items-header,
  .manual-invoice-item-row {
    min-width: 620px;
  }

  .invoice-items,
  .manual-invoice-items {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .invoice-actions {
    gap: 6px;
  }

  .invoice-actions .btn-action,
  .btn-action {
    min-width: 42px;
    padding: 6px 7px;
    font-size: 10px;
  }

  .trend-summary__value {
    font-size: 26px;
  }

  .nav-btn {
    flex: 1 1 100%;
  }
}
