:root {
  --bg: #f3eee9;
  --surface: #ffffff;
  --surface-soft: #faf7f4;
  --surface-muted: #f4eee9;
  --ink: #2d211a;
  --ink-soft: #66584e;
  --muted: #8c7f75;
  --brown: #3b271c;
  --brown-2: #6c4a37;
  --accent: #9a6b4d;
  --blue: #4f7f8a;
  --green: #2f8a61;
  --amber: #bd7c2d;
  --red: #b84b4f;
  --line: #e5dcd5;
  --line-strong: #d5c8be;
  --white: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 8px 24px rgba(51, 35, 25, 0.06);
  --shadow-md: 0 16px 42px rgba(51, 35, 25, 0.08);
}

/* =====================================================
   RESET
===================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color-scheme: light;
}

body {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  margin: 0;
}

body.admin-page {
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(
      135deg,
      #faf8f6 0%,
      #f3eee9 48%,
      #eaded4 100%
    );
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a,
button,
input,
select {
  font: inherit;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
}

/* =====================================================
   HEADER
===================================================== */

.admin-header {
  width: 100%;
  height: 68px;
  padding: 0 clamp(20px, 3vw, 48px);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: center;
  gap: 24px;
  color: var(--white);
  background: #352319;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 8px 22px rgba(44, 29, 20, 0.14);
}

.admin-logo,
.platform-admin-logo {
  width: fit-content;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.admin-logo img,
.platform-admin-logo img {
  width: 146px;
  height: 44px;
  object-fit: contain;
  object-position: left center;
  filter:
    brightness(0)
    invert(1);
}

.admin-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.admin-nav a,
.admin-logout-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  margin: 0;
  padding: 0;
  position: relative;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.66);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  outline: none;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.admin-nav a::before,
.admin-nav a::after,
.admin-logout-button::before,
.admin-logout-button::after {
  content: none !important;
}

.admin-nav a:hover,
.admin-nav a.active,
.admin-logout-button:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.10);
}

.admin-nav .nav-dashboard.active {
  color: #9bd3de;
}

.admin-nav .nav-transactions.active {
  color: #efbf7e;
}

.admin-nav .nav-qr.active {
  color: #89d9ae;
}

.admin-logout-form {
  width: auto;
  margin: 0;
  padding: 0;
  display: flex;
}

.admin-logout-button:hover {
  color: #ffb2b5;
}

.admin-header .header-icon,
.admin-header .back-icon {
  display: none !important;
}

/* =====================================================
   BACK LINK
===================================================== */

.admin-back-row {
  width: min(1320px, calc(100% - 40px));
  margin: 14px auto 0;
}

.admin-back-link {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
}

.admin-back-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-back-link:hover {
  color: var(--brown);
}

/* =====================================================
   MAIN AND HEADINGS
===================================================== */

.admin-main {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.page-heading {
  width: 100%;
  margin-bottom: 24px;
  display: block;
}

.page-heading-content {
  min-width: 0;
}

.page-eyebrow,
.panel-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.page-heading p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.compact-heading {
  margin-bottom: 22px;
}

/* Remove decorative page icons completely. */
.heading-icon,
.page-title-icon,
.panel-header-icon {
  display: none !important;
}

/* =====================================================
   PANELS
===================================================== */

.admin-panel {
  min-width: 0;
  padding: 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  width: 100%;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-header > div {
  min-width: 0;
}

.panel-header h2,
.report-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
}

.panel-header p,
.report-panel p {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

/* =====================================================
   PAYMENT MODE BANNER
===================================================== */

.payment-mode-panel {
  margin-bottom: 16px;
  padding: 17px 20px;
  display: block;
  border-left: 3px solid var(--blue);
  box-shadow: none;
}

.mode-icon,
.mode-badge {
  display: none !important;
}

.mode-content h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}

.mode-content p {
  max-width: 900px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

/* =====================================================
   STATISTICS
===================================================== */

.stats-grid {
  width: 100%;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  min-width: 0;
  min-height: 142px;
  padding: 19px;
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.stat-card::before {
  content: "";
  width: 4px;
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--blue);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.stat-card:nth-child(2)::before {
  background: var(--amber);
}

.stat-card:nth-child(3)::before {
  background: var(--green);
}

.stat-card:nth-child(4)::before {
  background: var(--accent);
}

.stat-card-top {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #eef5f6;
  border: 1px solid #d8e7ea;
  border-radius: 8px;
}

.stat-icon svg {
  width: 17px;
  height: 17px;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-card:nth-child(2) .stat-icon {
  color: var(--amber);
  background: #fbf3e7;
  border-color: #f0ddc2;
}

.stat-card:nth-child(3) .stat-icon {
  color: var(--green);
  background: #edf7f1;
  border-color: #d4eadc;
}

.stat-card:nth-child(4) .stat-icon {
  color: var(--accent);
  background: #f5efeb;
  border-color: #e7d9cf;
}

.stat-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  color: var(--ink);
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.stat-count {
  margin-top: auto;
  padding-top: 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.stat-card.low-stock {
  border-color: #e5bfc1;
}

.stat-card.low-stock::before {
  background: var(--red);
}

.stat-card.low-stock .stat-icon {
  color: var(--red);
  background: #fbefef;
  border-color: #efd2d3;
}

/* =====================================================
   DASHBOARD OPERATIONS
===================================================== */

.operations-grid {
  width: 100%;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  align-items: start;
  gap: 16px;
}

.sales-entry-panel,
.stock-panel {
  width: 100%;
}

.stock-panel .large-stock-number {
  display: none;
}

/* =====================================================
   FORMS
===================================================== */

.sales-entry-form,
.stock-form,
.stack-form {
  width: 100%;
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field,
.stock-form label,
.filter-form label,
.stack-form label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.form-field > span,
.stock-form label,
.filter-form label,
.stack-form label {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-page input:not([type="checkbox"]),
.admin-page select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  box-shadow: none;
  font-size: 12px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.admin-page input[readonly] {
  color: var(--ink-soft);
  background: var(--surface-muted);
}

.admin-page input::placeholder {
  color: #b0a69e;
}

.admin-page input:not([type="checkbox"]):focus,
.admin-page select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(154, 107, 77, 0.10);
}

.admin-page input[type="date"] {
  color-scheme: light;
}

/* =====================================================
   DRINK ENTRY
===================================================== */

.drink-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.drink-entry-card {
  min-width: 0;
  min-height: 76px;
  padding: 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.drink-entry-icon {
  display: none !important;
}

.drink-entry-content {
  min-width: 0;
}

.drink-entry-content strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.drink-entry-content small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.drink-entry-card input {
  min-height: 42px !important;
  padding: 0 8px !important;
  text-align: center;
  font-size: 15px !important;
  font-weight: 700;
}

/* =====================================================
   SALES TOTAL
===================================================== */

.sales-total-box {
  padding: 13px 15px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  color: var(--white);
  background: var(--brown);
  border-radius: var(--radius-sm);
}

.sales-total-box > div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sales-total-box > div + div {
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.sales-total-box span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sales-total-box strong {
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

/* =====================================================
   STOCK
===================================================== */

.large-stock-number {
  color: var(--accent);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

.stock-information {
  margin-top: 16px;
  padding-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.stock-information span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stock-information strong {
  color: var(--accent);
  font-size: 12px;
}

/* =====================================================
   BUTTONS
===================================================== */

.primary-button,
.secondary-button {
  min-width: 0;
  min-height: 44px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.primary-button svg,
.secondary-button svg {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 auto;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button {
  color: var(--white);
  background: var(--brown);
  border: 1px solid var(--brown);
}

.primary-button:hover {
  color: var(--white);
  background: #4a3123;
  border-color: #4a3123;
}

.secondary-button {
  color: var(--brown);
  background: var(--white);
  border: 1px solid var(--line-strong);
}

.secondary-button:hover {
  color: var(--brown);
  background: var(--surface-muted);
  border-color: var(--accent);
}

.full-width-button,
.full-button {
  width: 100%;
}

/* =====================================================
   REPORT PANEL
===================================================== */

.report-panel {
  width: 100%;
}

.report-panel .panel-header {
  margin-bottom: 0;
  align-items: center;
}

.report-buttons {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

/* =====================================================
   RECENT AND TABLES
===================================================== */

.recent-panel {
  margin-bottom: 16px;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--brown-2);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover {
  color: var(--brown);
  border-color: var(--line-strong);
}

.table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cdbfb5 transparent;
}

.table-wrapper::-webkit-scrollbar {
  height: 7px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: #cdbfb5;
  border-radius: 999px;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: auto;
}

.admin-table th,
.admin-table td {
  padding: 13px 11px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-table td {
  color: var(--ink-soft);
  font-size: 11px;
}

.admin-table tbody tr:hover {
  background: #fcfaf8;
}

.amount-column {
  color: var(--ink) !important;
  font-weight: 700;
}

.reference-column {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: Consolas, monospace;
  font-size: 10px !important;
}

.empty-row {
  height: 110px;
  color: var(--muted) !important;
  text-align: center !important;
}

/* =====================================================
   STATUS BADGES
===================================================== */

.status-badge {
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 7px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-badge.manual-recorded,
.status-badge.customer-confirmed,
.status-badge.captured {
  color: var(--green);
  background: #edf7f1;
  border-color: #cfe7d8;
}

.status-badge.pending,
.status-badge.initiated {
  color: var(--amber);
  background: #fbf3e7;
  border-color: #efd8b7;
}

.status-badge.failed {
  color: var(--red);
  background: #fbefef;
  border-color: #edcfd1;
}

/* =====================================================
   TRANSACTIONS
===================================================== */

.transaction-panel {
  padding-top: 20px;
}

.filter-form {
  width: 100%;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns:
    repeat(3, minmax(150px, 1fr))
    44px;
  align-items: end;
  gap: 11px;
}

.filter-action {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--blue);
  background: #eef5f6;
  border: 1px solid #d5e5e8;
  border-radius: 8px;
}

.transaction-delete-form {
  width: 100%;
}

.transaction-toolbar {
  width: 100%;
  margin-bottom: 12px;
  padding: 4px 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.selection-summary {
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.selection-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.selected-counter {
  margin-left: 8px;
  color: var(--amber);
}

.toolbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-action,
.row-delete-button {
  margin: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.icon-action {
  width: 36px;
  height: 36px;
  color: var(--ink-soft);
}

.icon-action svg,
.row-delete-button svg,
.filter-action svg {
  width: 16px !important;
  height: 16px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.icon-action svg path,
.icon-action svg rect,
.row-delete-button svg path,
.row-delete-button svg rect,
.filter-action svg path,
.filter-action svg rect {
  fill: none !important;
  stroke: currentColor !important;
}

.icon-action:hover:not(:disabled),
.row-delete-button:hover,
.filter-action:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.icon-action:disabled {
  opacity: 0.32;
}

.delete-selected-action,
.pdf-action {
  color: var(--red);
}

.csv-action {
  color: var(--green);
}

.checkbox-column {
  width: 42px;
  text-align: center !important;
}

.row-action-column {
  width: 46px;
  text-align: right !important;
}

.transaction-checkbox {
  width: 15px;
  height: 15px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.row-delete-button {
  width: 32px;
  height: 32px;
  color: var(--red);
  background: transparent;
  border-color: transparent;
}

.row-delete-button:hover {
  background: #fbefef;
  border-color: #edcfd1;
}

/* =====================================================
   QR PAGE
===================================================== */

.qr-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(330px, 0.82fr) minmax(320px, 1fr);
  align-items: start;
  gap: 24px;
}

.qr-display {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 28px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.qr-logo {
  width: 140px;
  height: 44px;
  margin: 0 auto;
  object-fit: contain;
  filter: brightness(0) saturate(100%);
}

.generated-qr {
  width: min(280px, 100%);
  margin: 22px auto 18px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-price-label {
  margin-bottom: 5px;
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qr-display > strong {
  display: block;
  color: var(--ink);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.2;
}

.qr-price-summary {
  width: 100%;
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.qr-price-summary > span {
  padding: 10px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.qr-price-summary strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

.qr-payment-note {
  max-width: 320px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.qr-actions-panel {
  width: 100%;
  max-width: 520px;
  margin: 42px auto 0;
  display: grid;
  gap: 11px;
}

.qr-actions-panel .panel-header {
  margin-bottom: 4px;
}

.qr-url {
  width: 100%;
  min-height: 58px;
  margin-bottom: 3px;
  padding: 14px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 10px;
}

.qr-url > svg,
.qr-url > i {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  color: var(--accent);
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  font-size: 15px;
}

.qr-url svg path,
.qr-url svg rect {
  fill: none !important;
  stroke: currentColor !important;
}

.qr-url code {
  min-width: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 10px;
  line-height: 1.5;
}

/* =====================================================
   LOGIN
===================================================== */

body.admin-login-page {
  min-height: 100vh;
  min-height: 100svh;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(410px, 100%);
  padding: 0 34px 34px;
  overflow: hidden;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-brand {
  width: calc(100% + 68px);
  min-height: 108px;
  margin: 0 -34px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brown);
  text-decoration: none;
}

.login-brand img {
  width: 170px;
  height: 64px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.login-card h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  text-align: center;
}

.login-subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.alert {
  width: 100%;
  margin-bottom: 16px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  line-height: 1.5;
}

.alert.error {
  color: #963d40;
  background: #fbefef;
  border: 1px solid #edcfd1;
}

.stack-form .primary-button {
  width: 100%;
  margin-top: 3px;
}

/* =====================================================
   TABLET
===================================================== */

@media (max-width: 1080px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operations-grid {
    grid-template-columns: 1fr;
  }

  .qr-layout {
    grid-template-columns: 1fr;
  }

  .qr-actions-panel {
    max-width: 440px;
    margin-top: 0;
  }
}

@media (max-width: 820px) {
  .admin-header {
    height: 64px;
    padding: 0 16px;
  }

  .admin-logo img,
  .platform-admin-logo img {
    width: 126px;
    height: 40px;
  }

  .admin-nav {
    gap: 8px;
  }

  .admin-nav a,
  .admin-logout-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    font-size: 15px;
  }

  .admin-back-row,
  .admin-main {
    width: calc(100% - 28px);
  }

  .admin-main {
    padding-top: 20px;
  }

  .filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-form label:nth-child(3) {
    grid-column: 1 / -1;
  }

  .filter-action {
    width: 100%;
    grid-column: 1 / -1;
  }

  .report-panel .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .report-buttons {
    width: 100%;
  }

  .report-buttons a {
    flex: 1;
  }
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 600px) {
  .admin-header {
    height: 60px;
    padding: 0 10px;
    grid-template-columns: minmax(82px, 1fr) auto;
    gap: 7px;
  }

  .admin-logo img,
  .platform-admin-logo img {
    width: 98px;
    height: 34px;
  }

  .admin-nav {
    gap: 4px;
  }

  .admin-nav a,
  .admin-logout-button {
    width: 30px;
    height: 32px;
    min-width: 30px;
    min-height: 32px;
    font-size: 13px;
  }

  .admin-back-row,
  .admin-main {
    width: calc(100% - 18px);
  }

  .admin-back-row {
    margin-top: 9px;
  }

  .admin-back-link {
    font-size: 8px;
  }

  .admin-main {
    padding: 14px 0 42px;
  }

  .page-heading {
    margin-bottom: 18px;
  }

  .page-heading h1 {
    font-size: 32px;
  }

  .page-heading p {
    margin-top: 7px;
    font-size: 10px;
  }

  .admin-panel {
    padding: 16px;
    border-radius: 10px;
  }

  .payment-mode-panel {
    margin-bottom: 10px;
    padding: 14px 15px;
  }

  .mode-content h2 {
    font-size: 15px;
  }

  .mode-content p {
    font-size: 9px;
  }

  .stats-grid {
    margin-bottom: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .stat-card {
    min-height: 132px;
    padding: 15px;
    border-radius: 10px;
  }

  .stat-card-top {
    margin-bottom: 14px;
  }

  .stat-icon {
    width: 31px;
    height: 31px;
  }

  .stat-icon svg {
    width: 15px;
    height: 15px;
  }

  .stat-label {
    font-size: 7px;
  }

  .stat-value {
    font-size: 21px;
  }

  .stat-count {
    font-size: 8px;
  }

  .operations-grid {
    margin-bottom: 10px;
    gap: 10px;
  }

  .panel-header {
    margin-bottom: 15px;
  }

  .panel-header h2,
  .report-panel h2 {
    font-size: 17px;
  }

  .panel-header p,
  .report-panel p {
    font-size: 9px;
  }

  .form-row,
  .drink-entry-grid {
    grid-template-columns: 1fr;
  }

  .drink-entry-card {
    min-height: 70px;
    grid-template-columns: minmax(0, 1fr) 66px;
  }

  .sales-total-box {
    padding: 12px;
  }

  .sales-total-box strong {
    font-size: 14px;
  }

  .recent-panel {
    margin-bottom: 10px;
  }

  .filter-form {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .filter-form label:nth-child(3),
  .filter-action {
    grid-column: auto;
  }

  .transaction-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .selection-summary {
    width: 100%;
  }

  .report-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .qr-display {
    padding: 20px;
  }

  .qr-logo {
    width: 128px;
    height: 40px;
  }

  .generated-qr {
    width: min(250px, 100%);
    margin: 18px auto 15px;
  }

  .qr-display > strong {
    font-size: 20px;
  }

  body.admin-login-page {
    padding: 12px;
  }

  .login-card {
    padding: 0 22px 28px;
  }

  .login-brand {
    width: calc(100% + 44px);
    min-height: 94px;
    margin: 0 -22px 25px;
  }
}

@media (max-width: 420px) {
  .admin-logo img,
  .platform-admin-logo img {
    width: 88px;
  }

  .admin-nav a,
  .admin-logout-button {
    width: 27px;
    min-width: 27px;
  }

  .page-heading h1 {
    font-size: 29px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 124px;
  }

  .sales-total-box {
    grid-template-columns: 1fr;
  }

  .sales-total-box > div + div {
    padding: 10px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-left: 0;
  }

  .qr-price-summary,
  .report-buttons {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   PRINT
===================================================== */

@media print {
  .admin-header,
  .admin-back-row,
  .page-heading,
  .report-buttons,
  .qr-actions-panel {
    display: none !important;
  }

  body.admin-page {
    color: #000000;
    background: #ffffff;
  }

  .admin-main {
    width: 100%;
    padding: 0;
  }

  .admin-panel,
  .stat-card,
  .qr-display {
    background: #ffffff;
    border: 1px solid #dddddd;
    box-shadow: none;
  }
}

/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}