:root {
  --bg: #f3f6f2;
  --bg-deep: #e7eee4;
  --surface: #ffffff;
  --ink: #1c2a22;
  --muted: #5f7267;
  --line: #d5e0d8;
  --line-strong: #b9c9be;
  --brand: #1f6b4a;
  --brand-dark: #154c35;
  --brand-soft: #e8f3ed;
  --accent: #c9782a;
  --danger: #b42318;
  --success: #067647;
  --shadow: 0 10px 30px rgba(28, 42, 34, 0.06);
  --shadow-focus: 0 0 0 4px rgba(31, 107, 74, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --control-h: 46px;
  --sidebar: 260px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --display: "DM Sans", "IBM Plex Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(31, 107, 74, 0.08), transparent 32%),
    linear-gradient(180deg, #f7faf6 0%, var(--bg) 100%);
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

/* ========== Global form controls ========== */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-height: var(--control-h);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(28, 42, 34, 0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
}

textarea {
  min-height: 110px;
  resize: vertical;
  padding-top: 0.85rem;
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.4rem;
  cursor: pointer;
}

input:hover:not(:disabled):not([readonly]),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--shadow-focus);
  background: #fcfffd;
}

input:disabled,
select:disabled,
textarea:disabled,
input[readonly] {
  background: #f1f5f2;
  color: #4d5f55;
  cursor: not-allowed;
  opacity: 0.92;
}

input::placeholder,
textarea::placeholder {
  color: #8a9b91;
}

input[type="file"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #f7faf7;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}
input[type="file"]:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}

label > span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #3f5348;
}

.master-form label,
.auth-form label,
.form-grid > label {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.25rem;
}
.form-grid label.full { grid-column: 1 / -1; }

.form-panel.panel,
.panel.form-panel {
  padding: 1.35rem 1.4rem 1.5rem;
  border: 1px solid rgba(31, 107, 74, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfb 100%);
}

.form-section {
  margin: 1.35rem 0;
  padding: 1.15rem 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbf8 0%, #ffffff 70%);
}
.form-section h3 {
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
}

.form-actions {
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

.check-inline {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.35rem 0;
}
.check-inline span { margin: 0; font-weight: 500; }

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.filter-form input,
.filter-form select {
  width: auto;
  min-width: 160px;
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  background: #fff;
}
.filter-form input[type="search"] { min-width: 240px; }

#linesTable input,
#linesTable select,
#posCart input,
#posCart select {
  width: 100%;
  min-width: 72px;
  min-height: 38px;
  padding: 0.4rem 0.55rem;
  font-size: 0.88rem;
  border-radius: 8px;
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  background: linear-gradient(180deg, #163b2b 0%, #0f2a1e 100%);
  color: #e8f2ec;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: #2f8f64; color: white; font-weight: 700;
  font-family: var(--display);
}
.brand-mark.lg { width: 52px; height: 52px; font-size: 1.4rem; }
.sidebar-brand strong { display: block; font-family: var(--display); }
.sidebar-brand small, .sidebar-user small { color: rgba(232,242,236,0.7); }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; padding: 1rem 0; overflow: auto; flex: 1; }
.sidebar-nav a {
  color: rgba(232,242,236,0.86);
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  font-size: 0.94rem;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.nav-label {
  margin: 0.9rem 0.8rem 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(232,242,236,0.45);
}
.sidebar-user {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1rem 0.75rem 0.25rem;
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.5rem 0.5rem;
}
.page-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
}
.navbar-right { display: flex; gap: 0.75rem; align-items: center; }
.navbar-date { color: var(--muted); font-size: 0.9rem; }
.app-content { padding: 0.75rem 1.5rem 1.5rem; }
.app-footer {
  margin-top: auto;
  padding: 1rem 1.5rem 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.btn {
  border: 0;
  border-radius: var(--radius-sm);
  min-height: 42px;
  padding: 0.65rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #248057 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(31, 107, 74, 0.22);
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost {
  background: #fff;
  color: var(--muted);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: #f7faf7;
}
.btn-block { width: 100%; min-height: var(--control-h); }
.btn-sm { min-height: 34px; padding: 0.35rem 0.7rem; font-size: 0.82rem; border-radius: 8px; }
.btn-danger { background: #fef3f2; color: var(--danger); border: 1px solid #fecdca; }
.btn-danger:hover { background: #fee4e2; }
.inline-form { display: inline; }

.alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.alert-success { background: #e8f8ef; color: var(--success); border-color: #abe2c3; }
.alert-error { background: #fef3f2; color: var(--danger); border-color: #fecdca; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
}
.stat-card span { display: block; color: var(--muted); font-size: 0.82rem; margin-bottom: 0.35rem; }
.stat-card strong { font-family: var(--display); font-size: 1.15rem; }
.tone-sales strong { color: var(--brand); }
.tone-profit strong { color: #0f766e; }
.tone-due strong, .tone-expense strong { color: var(--accent); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.dashboard-grid.three { grid-template-columns: repeat(3, 1fr); }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.85rem;
  gap: 0.75rem;
}
.panel-head h2 {
  margin: 0; font-family: var(--display); font-size: 1.05rem;
}
.muted { color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.7rem 0.45rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.badge {
  display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px;
  background: #e8f2ec; color: var(--brand); font-size: 0.75rem; font-weight: 600;
}
.feature-list { margin: 0.75rem 0 0; padding-left: 1.1rem; color: var(--muted); }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}
.table-wrap { overflow-x: auto; }
.actions { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.badge-success { background: #e8f8ef; color: var(--success); }
.badge-muted { background: #f2f4f3; color: var(--muted); }
.thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: inline-grid;
  place-items: center;
  background: #f3f6f2;
  font-size: 0.75rem;
  color: var(--muted);
}
.thumb.mt { margin-top: 0.4rem; width: 72px; height: 72px; }
.small { font-size: 0.78rem; }
.text-warn { color: var(--accent); font-weight: 600; }

.toolbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}
.perm-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.95rem;
  background: #f8fbf8;
}
.perm-card h4 {
  margin: 0 0 0.7rem;
  font-family: var(--display);
  font-size: 0.92rem;
}
.perm-card .check-inline { margin-bottom: 0.2rem; }
.perm-list { list-style: none; margin: 0; padding: 0; }
.perm-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.perm-list code, code {
  font-size: 0.78rem;
  color: var(--muted);
  background: #eef3ef;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.35rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.settings-tab {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}
.settings-tab.active, .settings-tab:hover {
  background: var(--brand);
  color: #fff;
}
.inline-edit summary { list-style: none; cursor: pointer; }
.inline-edit summary::-webkit-details-marker { display: none; }
.edit-pop {
  margin-top: 0.6rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbf8;
  min-width: 280px;
}

.pos-layout {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 1rem;
}
.pos-search-bar { margin-bottom: 0.85rem; }
.pos-search-wrap {
  position: relative;
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
}
.pos-search-wrap input {
  flex: 1;
  min-height: 50px;
  font-size: 1rem;
  border-radius: 12px;
  border-width: 1.5px;
}
.pos-suggestions {
  display: none;
  position: absolute;
  left: 0;
  right: 92px;
  top: calc(100% + 6px);
  z-index: 30;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(28, 42, 34, 0.12);
  max-height: 280px;
  overflow: auto;
}
.pos-suggestions.open { display: block; }
.pos-suggest-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.pos-suggest-item:last-child { border-bottom: 0; }
.pos-suggest-item span { color: var(--muted); font-size: 0.8rem; }
.pos-suggest-item:hover,
.pos-suggest-item.active { background: var(--brand-soft); }

/* Customer autosuggest (POS + Sales invoice) */
.customer-suggest {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.75rem 1rem;
  align-items: start;
  z-index: 5;
}
.customer-suggest-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.customer-suggest-field .field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.customer-suggest-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.customer-suggest-row input[type="text"] {
  flex: 1;
  min-width: 0;
}
.customer-suggest-box {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(28, 42, 34, 0.14);
  max-height: 280px;
  overflow: auto;
}
.customer-suggest-box.open { display: block; }
.customer-suggest-item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.customer-suggest-item:last-child { border-bottom: 0; }
.customer-suggest-item span { color: var(--muted); font-size: 0.8rem; }
.customer-suggest-item:hover,
.customer-suggest-item.active { background: var(--brand-soft); }
.customer-suggest-item.is-new {
  background: #f7faf8;
  border-top: 1px dashed var(--line);
}
.customer-suggest-status {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.customer-suggest-status.is-selected { color: #1f6b45; font-weight: 600; }
.customer-suggest-status.is-new { color: #9a5b00; }
.customer-suggest-status.is-walkin { color: var(--muted); }
@media (max-width: 720px) {
  .customer-suggest { grid-template-columns: 1fr; }
}
.pos-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f3f8f4, #eef6f1);
}
.pos-totals .grand { font-size: 1.05rem; }
.pos-actions { justify-content: flex-end; border-top: 0; padding-top: 0.25rem; }
.pos-search { display: flex; gap: 0.6rem; margin: 1rem 0; }

/* ========== Professional Invoice ========== */
.invoice-sheet {
  max-width: 920px;
  margin: 0 auto 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem 2.1rem 1.6rem;
  box-shadow: var(--shadow);
  color: #1b2a22;
}
.invoice-top {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #1f6b4a;
}
.invoice-brand {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}
.invoice-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #2f8f64, #1f6b4a);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
}
.invoice-brand h1 {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.2;
}
.invoice-brand p,
.invoice-meta p,
.invoice-parties p,
.invoice-notes p,
.invoice-foot p {
  margin: 0.15rem 0;
  color: #5f7267;
  font-size: 0.9rem;
}
.invoice-meta { text-align: right; }
.invoice-tag {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #e8f3ed;
  color: #1f6b4a;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.invoice-tag.purchase { background: #fff4e8; color: #a35d18; }
.invoice-meta h2 {
  margin: 0.45rem 0 0.55rem;
  font-family: var(--display);
  font-size: 1.45rem;
}
.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0 1.4rem;
}
.invoice-parties h3,
.invoice-notes h3 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8c82;
}
.invoice-parties strong { font-size: 1.02rem; }
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.invoice-table th {
  background: #173b2c;
  color: #f2f8f4;
  text-align: left;
  padding: 0.7rem 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.invoice-table td {
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid #e4ece7;
}
.invoice-table tbody tr:nth-child(even) { background: #f7faf8; }
.invoice-table .num,
.invoice-pay-table .num,
.invoice-summary strong { text-align: right; }
.invoice-bottom {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.invoice-summary {
  border: 1px solid #d7e4dc;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fbf9;
}
.invoice-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #e4ece7;
  font-size: 0.92rem;
}
.invoice-summary > div:last-child { border-bottom: 0; }
.invoice-summary .grand {
  background: #1f6b4a;
  color: #fff;
  font-size: 1.05rem;
}
.invoice-summary .grand span,
.invoice-summary .grand strong { color: #fff; }
.invoice-summary .due strong { color: #a35d18; }
.invoice-pay-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.4rem;
  font-size: 0.86rem;
}
.invoice-pay-table th,
.invoice-pay-table td {
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid #e4ece7;
  text-align: left;
}
.invoice-foot {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px dashed #c9d7ce;
  text-align: center;
}
.invoice-signs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.2rem;
}
.invoice-signs div {
  border-top: 1px solid #9fb3a6;
  padding-top: 0.45rem;
  font-size: 0.82rem;
  color: #5f7267;
}

@media print {
  @page { margin: 12mm; size: A4; }
  body {
    background: #fff !important;
  }
  .sidebar,
  .navbar,
  .app-footer,
  .no-print,
  .alert {
    display: none !important;
  }
  .app-shell,
  .app-main,
  .app-content {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  .invoice-sheet {
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
  .invoice-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .invoice-summary .grand { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print-actions,
  .report-filters { display: none !important; }
  .report-print-sheet {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}

/* Auth */
.auth-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(31,107,74,0.12), transparent 40%),
    linear-gradient(180deg, #f7faf6, #e9f0ea);
}
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
}
.auth-wrap.single { grid-template-columns: 1fr; place-items: center; padding: 2rem; }
.auth-panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: 2.5rem clamp(1.5rem, 4vw, 4rem);
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
}
.auth-brand h1 {
  font-family: var(--display);
  font-size: 1.55rem;
  margin: 0.85rem 0 0.35rem;
}
.auth-brand p, .auth-meta { color: var(--muted); }
.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.88);
  box-shadow: var(--shadow);
}
.auth-form label { gap: 0; }
.auth-form input {
  min-height: 50px;
  border-radius: 12px;
  font-size: 1rem;
}
.auth-form .btn-primary {
  margin-top: 0.35rem;
  min-height: 50px;
  border-radius: 12px;
  font-size: 1rem;
}
.auth-visual {
  background:
    linear-gradient(160deg, rgba(15, 42, 30, 0.78), rgba(31, 107, 74, 0.62)),
    url('../images/grocery-bg.jpg') center / cover no-repeat;
  color: #f4faf7;
  display: grid;
  place-items: end start;
  padding: 3rem;
  min-height: 100vh;
}
.auth-visual-inner { max-width: 420px; animation: rise 0.6s ease both; }
.auth-visual h2 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
}
.auth-visual p { margin: 0; color: rgba(244,250,247,0.84); font-size: 1.05rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Reports */
.report-group { margin-top: 1.4rem; }
.report-group h3 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.report-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #f7faf8 100%);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.report-card:hover {
  border-color: #9fbfab;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(28, 42, 34, 0.08);
}
.report-card strong { font-size: 0.98rem; }
.report-card span { color: var(--muted); font-size: 0.84rem; line-height: 1.35; }
.report-filters { margin-top: 0.85rem; }
.report-print-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.report-print-header h2 { margin: 0 0 0.25rem; font-size: 1.25rem; }
.report-print-meta { text-align: right; color: var(--muted); font-size: 0.88rem; }
.report-print-meta strong { display: block; color: var(--ink); margin-bottom: 0.2rem; }
.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.report-summary-item {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: var(--brand-soft);
  border: 1px solid var(--line);
}
.report-summary-item span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.report-summary-item strong { font-size: 1rem; }
.report-table .text-right,
.text-right { text-align: right; }
.table-wrap { overflow-x: auto; }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .filter-form input,
  .filter-form select,
  .filter-form input[type="search"] {
    width: 100%;
    min-width: 0;
  }
  .settings-tabs { border-radius: 14px; }
  .report-print-header { flex-direction: column; }
  .report-print-meta { text-align: left; }
}

@media (max-width: 980px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .dashboard-grid, .dashboard-grid.three { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { min-height: 220px; place-items: center; text-align: center; }
  .pos-layout { grid-template-columns: 1fr; }
  .pos-totals { grid-template-columns: 1fr 1fr; }
  .pos-suggestions { right: 0; }
}
