@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap");

:root {
  --sidebar-bg: #3b241c;
  --primary-color: #70452f;
  --secondary-color: #c99a32;
  --background-color: #fff4e8;
  --surface-color: #ffffff;
  --text-color: #4a2118;
  --muted-color: #75665b;
  --border-color: #e7d8c5;
  --success-color: #70452f;
  --warning-color: #70452f;
  --danger-color: #4a2118;

  --primary: var(--primary-color);
  --primary-hover: #4a2118;
  --primary-light: rgba(112, 69, 47, 0.08);
  --secondary: var(--secondary-color);
  --secondary-hover: #e2c16b;
  --secondary-light: rgba(201, 154, 50, 0.14);
  --text-on-gold: #3b241c;
  --bg: var(--background-color);
  --surface: var(--surface-color);
  --text: var(--text-color);
  --text-muted: var(--muted-color);
  --border: var(--border-color);
  --border-light: #f4e9dc;
  --success: var(--success-color);
  --success-bg: #f4e9dc;
  --danger: var(--danger-color);
  --danger-bg: #f4e9dc;
  --warning: var(--warning-color);
  --warning-bg: #fff4e8;
  --radius-lg: 8px;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 3px rgba(59, 36, 28, 0.06);
  --shadow-md: 0 4px 12px rgba(59, 36, 28, 0.08);
  --shadow-lg: 0 8px 24px rgba(59, 36, 28, 0.12);
  --font-body:
    "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-display:
    "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-color: var(--primary-color) var(--background-color);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--background-color);
  border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border: 2px solid var(--background-color);
  border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #4a2118;
}

*::-webkit-scrollbar-corner {
  background: var(--background-color);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
}

h1 {
  font-size: 26px;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 18px;
}
h4 {
  font-size: 15px;
}

/* ==========================================================================
   SIDEBAR & APP NAVIGATION
   ========================================================================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 250px;
  background: var(--sidebar-bg);
  color: #ffffff;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(59, 36, 28, 0.16);
  transition: transform 0.3s ease;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  text-decoration: none;
  color: #ffffff;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-info h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff4e8;
}

.brand-info small {
  display: block;
  font-family: var(--font-body);
  font-size: 9.5px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
}

.sidebar-nav {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  padding-right: 0;
  scrollbar-width: none; /* Hide default scrollbar / slider */
  -ms-overflow-style: none; /* IE and Edge */
}

.sidebar-nav::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
  width: 0;
  height: 0;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: rgba(226, 193, 107, 0.82);
  text-transform: uppercase;
  margin: 10px 0 3px 10px;
}

.nav-section-label:first-child {
  margin-top: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border-radius: var(--radius);
  color: #fff4e8;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(3px);
}

.nav-link.active {
  background: var(--secondary);
  color: var(--sidebar-bg);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke-width: 2px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.user-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.18);
  padding: 7px 11px;
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--text-on-gold);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

.user-role {
  font-size: 9.5px;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  color: #fff4e8;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-signout:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */

.main-content {
  margin-left: 250px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-bar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-title-copy {
  min-width: 0;
}

.nav-menu-toggle,
.sidebar-close,
.sidebar-backdrop {
  display: none;
}

.page-title .breadcrumb {
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--success-bg);
  color: var(--success);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status .dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(112, 69, 47, 0.16);
}

.page-body {
  padding: 28px 32px;
  flex: 1;
}

.app-footer {
  padding: 16px 32px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ==========================================================================
   BUTTONS, INPUTS & GENERAL UI COMPONENTS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-md);
  color: #ffffff;
}

.btn:active {
  transform: none;
}

.btn.btn-secondary {
  background: var(--primary);
  color: #ffffff;
}

.btn.btn-secondary:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.btn.btn-outline {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--primary);
  box-shadow: none;
}

.btn.btn-outline:hover {
  background: var(--bg);
  border-color: var(--border);
  color: var(--primary);
}

.btn.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.btn.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
}

.btn.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn:focus-visible,
.cat-chip:focus-visible,
.pkp-key:focus-visible,
.kp-btn:focus-visible,
.qty-btn:focus-visible,
.cart-item-del:focus-visible,
.cart-item-edit-btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--bg);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
}

.fields-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.panel-header h2,
.panel-header h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.notice {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(112, 69, 47, 0.2);
}

.notice.error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(74, 33, 24, 0.2);
}

/* ==========================================================================
   OVERVIEW & DASHBOARD STYLES
   ========================================================================== */

.hero-banner {
  background:
    linear-gradient(
      90deg,
      rgba(59, 36, 28, 0.94) 0%,
      rgba(74, 33, 24, 0.88) 38%,
      rgba(74, 33, 24, 0.48) 65%,
      rgba(30, 18, 14, 0.2) 100%
    ),
    url("images/dashboard-banner-bg.webp") center 42% / cover no-repeat;
  border-radius: var(--radius-lg);
  padding: 34px 40px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  box-shadow:
    0 14px 34px rgba(59, 36, 28, 0.18),
    0 2px 8px rgba(59, 36, 28, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  display: none;
}

.hero-text {
  position: relative;
  z-index: 2;
}

.hero-text small {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  margin-bottom: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.hero-text h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-text p {
  color: #fff4e8;
  font-size: 14.5px;
  max-width: 520px;
  line-height: 1.45;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-banner .btn-outline {
  background: #ffffff !important;
  color: var(--primary) !important;
  border: 1px solid var(--border) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-banner .btn-outline:hover {
  background: var(--bg) !important;
  border-color: var(--secondary) !important;
  color: var(--primary) !important;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-info small {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-info strong {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* ==========================================================================
   POS SCREEN & LAYOUT
   ========================================================================== */

.pos-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 24px;
  align-items: start;
  min-width: 0;
}

.pos-container > * {
  min-width: 0;
}

.pos-catalog {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pos-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box input {
  padding-left: 38px;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.cat-chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 30px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cat-chip:hover {
  border-color: var(--primary);
  background: var(--border-light);
}

.cat-chip.active {
  background: var(--secondary);
  color: var(--sidebar-bg);
  border-color: var(--secondary);
  box-shadow: 0 4px 12px rgba(59, 36, 28, 0.18);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  position: relative;
}

.product-empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 700;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.product-empty-state[hidden] {
  display: none;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.product-card-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-card-img {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.product-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.product-card-unit {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.product-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-card-price {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.btn-add-cart {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--sidebar-bg);
  border: none;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-cart:hover {
  background: var(--primary-hover);
  color: #ffffff;
  transform: scale(1.1);
}

.btn-add-cart:active {
  transform: scale(0.95);
}

/* ==========================================================================
   CART & ORDER SUMMARY
   ========================================================================== */

.pos-cart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cart-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.cart-header-count {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
}

.cart-items-list {
  min-height: 220px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.cart-item.targeted {
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px var(--primary);
  background: #ffffff;
}

.cart-item-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.cart-item-qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.15s ease;
}

.qty-btn:hover {
  background: var(--border-light);
  color: var(--primary);
}

.qty-value-pill {
  min-width: 28px;
  padding: 2px 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  border-radius: 4px;
}

.qty-value-pill:hover,
.qty-value-pill.active {
  background: var(--secondary);
  color: var(--text-on-gold);
}

.cart-item-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  min-width: 70px;
  text-align: right;
}

.cart-item-del {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.cart-item-del:hover {
  opacity: 1;
}

.cart-empty {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted);
}

.cart-empty-icon {
  font-size: 44px;
  margin-bottom: 10px;
  opacity: 0.7;
}

/* ==========================================================================
   QUICK PAD / NUMERIC KEYPAD COMPONENT
   ========================================================================== */

.quickpad-box {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quickpad-target-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

.quickpad-target-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.quickpad-display {
  background: var(--bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.quickpad-display-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.quickpad-display-val {
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
}

.quickpad-presets {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.quickpad-preset-chip {
  flex: 1;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quickpad-preset-chip:hover {
  background: var(--secondary);
  border-color: var(--secondary-hover);
  color: var(--text-on-gold);
}

.quickpad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.kp-btn {
  aspect-ratio: 1.4;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  user-select: none;
}

.kp-btn:hover {
  background: var(--border-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.kp-btn:active {
  transform: translateY(1px);
  background: var(--secondary);
  color: var(--text-on-gold);
}

.kp-btn.action-btn {
  background: var(--border-light);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.kp-btn.clear-btn {
  background: var(--warning-bg);
  color: var(--danger);
  border-color: var(--border);
}

.kp-btn.confirm-btn {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-size: 13px;
}

.kp-btn.confirm-btn:hover {
  background: var(--primary-hover);
}

.quickpad-help {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

/* ==========================================================================
   ORDER TOTALS & CHECKOUT CONTROLS
   ========================================================================== */

.order-calc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.calc-row.grand-total {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.calc-discount-input {
  width: 110px;
  padding: 6px 10px;
  text-align: right;
  font-weight: 700;
  font-size: 13px;
  border-radius: 6px;
}

.calc-discount-input.targeted,
input.targeted {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
  background: #fffdf9;
}

.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.pm-radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface);
  color: var(--text);
  text-align: center;
}

.pm-radio-label input {
  display: none;
}

.pm-radio-label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.cash-quick-chips {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.cash-chip {
  padding: 4px 8px;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
}

.cash-chip:hover {
  background: var(--secondary);
  color: var(--text-on-gold);
}

/* ==========================================================================
   TABLES & DATA LISTS
   ========================================================================== */

.data-table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: var(--surface);
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.data-table th {
  background: #fff4e8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.data-table tr:hover td {
  background: rgba(59, 36, 28, 0.025);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.badge-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pill.active {
  background: var(--success-bg);
  color: var(--success);
}

.badge-pill.hidden {
  background: var(--border-light);
  color: var(--text-muted);
}

.sales-pie-layout {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1.1fr);
  align-items: center;
  gap: 18px;
}

.sales-pie-chart {
  position: relative;
  width: min(100%, 220px);
  margin: 0 auto;
  aspect-ratio: 1;
}

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

.sales-pie-chart path {
  transition: opacity 0.15s ease;
}

.sales-pie-chart path:hover {
  opacity: 0.82;
}

.sales-pie-total {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.sales-pie-total small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.sales-pie-total strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.3;
}

.sales-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.sales-pie-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.sales-pie-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.sales-pie-legend-copy {
  min-width: 0;
}

.sales-pie-legend-copy b,
.sales-pie-legend-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-pie-legend-copy b {
  color: var(--text);
  font-size: 12px;
}

.sales-pie-legend-copy small {
  color: var(--text-muted);
  font-size: 10px;
}

.sales-pie-legend-item > strong {
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
}

/* ==========================================================================
   RECEIPT & PRINT STYLING
   ========================================================================== */

.receipt-wrap {
  max-width: 520px;
  margin: 0 auto 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.receipt-header {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 2px dashed var(--border);
  margin-bottom: 20px;
}

.receipt-brand-logo {
  font-size: 42px;
  margin-bottom: 8px;
}

.receipt-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.receipt-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.receipt-meta-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 12px;
  background: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.receipt-meta-item strong {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.receipt-table th,
.receipt-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.receipt-table th {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.receipt-totals {
  border-top: 2px dashed var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.receipt-totals .row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.receipt-totals .row.final {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.receipt-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.receipt-footer-heart {
  color: var(--secondary-hover);
  font-size: 16px;
  margin-bottom: 4px;
}

/* ==========================================================================
   LOGIN PAGE STYLING
   ========================================================================== */

.login-page {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image: url("images/bakery-login-background.webp");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  box-sizing: border-box;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.login-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  box-sizing: border-box;
}

.login-visual-zone {
  display: none;
}

.login-form-zone {
  width: 48%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 40px;
  margin-right: 2vw;
  box-sizing: border-box;
}

.login-card {
  width: 100%;
  max-width: 410px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(231, 216, 197, 0.95);
  border-radius: 20px;
  padding: 24px 26px;
  box-shadow:
    0 16px 40px rgba(59, 36, 28, 0.14),
    0 2px 8px rgba(59, 36, 28, 0.06);
}

.login-card-header {
  margin-bottom: 14px;
}

.login-card-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #4a2118;
  margin-bottom: 3px;
}

.login-card-header p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

/* Mode Switcher Tabs */
.login-mode-tabs {
  display: flex;
  background: var(--bg);
  padding: 3px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  gap: 4px;
}

.login-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.login-tab-btn:hover {
  color: var(--primary);
}

.login-tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(41, 35, 31, 0.08);
}

/* PIN Display Dots */
.pin-display-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.pin-dots {
  display: flex;
  gap: 12px;
  padding: 7px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pin-input-capture {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #ffffff;
  transition: all 0.15s ease;
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.15);
}

/* PIN Keypad Grid */
.pin-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.pkp-key {
  height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
  user-select: none;
}

.pkp-key:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

.pkp-key:active {
  background: var(--primary);
  color: #ffffff;
}

.pkp-key.pkp-clear {
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 700;
}

.pkp-key.pkp-backspace {
  color: var(--primary);
  font-size: 14px;
}

.input-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrap input {
  padding-right: 64px;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 9px;
  line-height: 1;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}

.btn-toggle-password:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-toggle-password:focus {
  outline: 2px solid var(--primary-light);
  outline-offset: 1px;
}

/* ==========================================================================
   RESPONSIVE DESIGN & PRINT
   ========================================================================== */

@media (max-width: 1200px) {
  .pos-container {
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    gap: 16px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: min(280px, calc(100vw - 48px));
    padding: 16px 14px;
    align-items: stretch;
    transform: translateX(-105%);
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close {
    position: absolute;
    top: 16px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    background: transparent;
    color: #fff4e8;
    cursor: pointer;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 95;
    border: 0;
    background: rgba(30, 18, 14, 0.52);
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .nav-menu-toggle {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--primary);
    cursor: pointer;
  }

  .nav-link {
    justify-content: flex-start;
    padding: 9px 11px;
  }

  .main-content {
    margin-left: 0;
  }

  .top-bar,
  .page-body {
    padding-left: 18px;
    padding-right: 18px;
  }
  .pos-container {
    grid-template-columns: 1fr;
  }
  .pos-cart-panel {
    position: static;
  }
  .login-page {
    background-position: center top;
    justify-content: center;
  }
  .login-container {
    width: 100%;
    min-height: 100vh;
    max-width: 100vw;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .login-visual-zone {
    display: none;
  }
  .login-form-zone {
    padding: 24px 16px;
    width: 100%;
    max-width: 100vw;
    margin-right: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .login-card {
    width: 100%;
    max-width: 410px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 32px rgba(59, 36, 28, 0.16);
  }
}

@media (max-width: 600px) {
  .hero-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 24px 20px;
  }

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

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-actions .btn {
    min-width: 0;
    padding: 10px 8px;
    text-align: center;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .top-bar {
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
  }

  .page-title {
    flex: 1 1 100%;
  }

  .page-title h1 {
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }
  .sales-pie-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   THERMAL RECEIPT PRINTER STYLES (58 mm & 80 mm POS ROLLS)
   ========================================================================== */

.thermal-receipt-wrapper {
  display: flex;
  justify-content: center;
  padding: 10px 0 30px;
}

.thermal-receipt {
  background: #ffffff;
  color: #111111;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, monospace;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  position: relative;
  box-sizing: border-box;
}

/* 58 mm Roll Layout (2 Inch) */
.thermal-receipt.thermal-58mm {
  width: 58mm;
  max-width: 58mm;
  padding: 8px 6px;
  font-size: 11px;
  line-height: 1.35;
}

/* 80 mm Roll Layout (3 Inch) */
.thermal-receipt.thermal-80mm {
  width: 80mm;
  max-width: 80mm;
  padding: 12px 10px;
  font-size: 12px;
  line-height: 1.4;
}

/* Font Size Scales */
.thermal-receipt.font-compact {
  font-size: 10px;
  line-height: 1.3;
}
.thermal-receipt.font-compact .thermal-shop-name {
  font-size: 14px;
}
.thermal-receipt.font-compact .thermal-grand-total {
  font-size: 13px;
}

.thermal-receipt.font-standard {
  font-size: 11px;
}
.thermal-receipt.font-standard .thermal-shop-name {
  font-size: 15px;
}
.thermal-receipt.font-standard .thermal-grand-total {
  font-size: 14px;
}

.thermal-receipt.font-large {
  font-size: 13px;
}
.thermal-receipt.font-large .thermal-shop-name {
  font-size: 17px;
}
.thermal-receipt.font-large .thermal-grand-total {
  font-size: 16px;
}

.thermal-header {
  text-align: center;
  margin-bottom: 6px;
}

.thermal-logo {
  font-size: 22px;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.thermal-shop-name {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.thermal-tagline {
  font-size: 10px;
  color: #555;
  font-style: italic;
  margin-bottom: 2px;
}

.thermal-address,
.thermal-phone,
.thermal-trn {
  font-size: 10px;
  color: #333;
  margin-top: 1px;
}

.thermal-divider-dashed {
  border-bottom: 1px dashed #666;
  margin: 6px 0;
}

.thermal-divider-solid {
  border-bottom: 1.5px solid #111;
  margin: 6px 0;
}

.thermal-meta {
  font-size: 10.5px;
  margin-bottom: 4px;
}

.thermal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
}

.thermal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0;
}

.thermal-table th,
.thermal-table td {
  padding: 3px 2px;
  vertical-align: top;
}

.thermal-table th {
  font-size: 10px;
  text-transform: uppercase;
  border-bottom: 1px solid #444;
}

.thermal-table .item-name {
  word-break: break-word;
  padding-right: 4px;
}

.thermal-table .item-unit {
  display: block;
  font-size: 9px;
  color: #666;
  font-weight: normal;
}

.thermal-totals {
  margin: 4px 0;
}

.thermal-grand-total {
  font-weight: 800;
  font-size: 14px;
}

.thermal-payment-info {
  font-size: 10.5px;
  margin-top: 4px;
}

.thermal-footer {
  text-align: center;
  font-size: 10.5px;
  margin-top: 6px;
  padding-top: 2px;
}

.thermal-barcode-mockup {
  font-family: monospace;
  font-weight: bold;
  letter-spacing: -1px;
  font-size: 14px;
  margin-top: 6px;
}

/* ==========================================================================
   PRINT SPECIFICATION & ZERO-MARGIN ESC/POS RECEIPT RULES
   ========================================================================== */

.reports-page .report-document-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border-bottom: 2px solid var(--border);
  background: var(--surface);
}

.reports-page .report-brand-details,
.reports-page .report-title-block {
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.reports-page .report-brand-details h1 {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 19px;
}

.reports-page .report-title-block h2 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 18px;
}

.reports-page .report-no-sales {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 700;
}

@media print {
  @page {
    margin: 0 !important;
  }

  @page bakery-report {
    size: A4 landscape;
    margin: 12mm 12mm 15mm !important;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    width: auto !important;
  }

  .sidebar,
  .top-bar,
  .app-footer,
  .noprint,
  nav,
  header,
  footer,
  button,
  .notice,
  form,
  .pos-container,
  .panel {
    display: none !important;
  }

  .main-content,
  .page-body,
  .app-wrapper,
  .thermal-receipt-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    display: block !important;
  }

  .thermal-receipt {
    box-shadow: none !important;
    border: none !important;
    margin: 0 auto !important;
    color: #000000 !important;
    background: #ffffff !important;
    page-break-inside: avoid !important;
  }

  .thermal-receipt.thermal-58mm {
    width: 58mm !important;
    max-width: 58mm !important;
    padding: 2mm 1mm !important;
  }

  .thermal-receipt.thermal-80mm {
    width: 80mm !important;
    max-width: 80mm !important;
    padding: 3mm 2mm !important;
  }

  .thermal-logo {
    color: #000000 !important;
  }

  .thermal-table th,
  .thermal-table td {
    color: #000000 !important;
  }

  .reports-page .report-print-content {
    page: bakery-report;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    color: #000000 !important;
    font-size: 9pt !important;
  }

  .reports-page .sidebar,
  .reports-page .top-bar,
  .reports-page .app-footer,
  .reports-page .noprint,
  .reports-page button,
  .reports-page form,
  .reports-page .notice {
    display: none !important;
  }

  .reports-page .main-content,
  .reports-page .page-body,
  .reports-page .app-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .reports-page .report-print-content .panel {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 0 4mm !important;
    padding: 3mm !important;
    overflow: visible !important;
    break-inside: auto;
    page-break-inside: auto;
    box-shadow: none !important;
    background: #ffffff !important;
    border: 1px solid #d6d6d6 !important;
  }

  .reports-page .report-print-content .pos-container {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 0 4mm !important;
    padding: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
    background: transparent !important;
    border: 0 !important;
  }

  .reports-page .report-print-content .report-breakdown-grid {
    display: block !important;
  }

  .reports-page .report-print-content .report-breakdown-grid > div {
    display: block !important;
    width: 100% !important;
  }

  .reports-page .report-print-content .report-breakdown-grid > .panel,
  .reports-page .report-print-content .report-breakdown-grid > div > .panel {
    width: 100% !important;
    margin: 0 0 4mm !important;
    padding: 3mm !important;
  }

  .reports-page .report-print-content .report-breakdown-grid > div > .panel {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .reports-page .report-print-content .data-table-container,
  .reports-page .report-print-content .table-wrap {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    contain: none !important;
    border: 0 !important;
  }

  .reports-page .report-print-content .data-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
    border-collapse: collapse !important;
    font-size: 7.5pt !important;
  }

  .reports-page .report-print-content .data-table thead {
    display: table-header-group;
  }

  .reports-page .report-print-content .data-table tfoot {
    display: table-row-group;
  }

  .reports-page .report-print-content .data-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .reports-page .report-print-content .data-table th,
  .reports-page .report-print-content .data-table td {
    position: static !important;
    padding: 1mm 0.8mm !important;
    color: #000000 !important;
    background: #ffffff !important;
    border: 1px solid #d6d6d6 !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .reports-page .report-document-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 4mm !important;
    margin: 0 0 4mm !important;
    padding: 0 0 3mm !important;
    border-bottom: 1px solid #b9b9b9 !important;
    background: #ffffff !important;
    break-after: avoid;
    page-break-after: avoid;
  }

  .reports-page .report-brand-details,
  .reports-page .report-title-block {
    color: #222222 !important;
    font-size: 8pt !important;
    line-height: 1.35 !important;
  }

  .reports-page .report-brand-details h1,
  .reports-page .report-title-block h2 {
    margin: 0 0 2mm !important;
    color: #000000 !important;
    font-size: 12pt !important;
  }

  .reports-page .report-document-header h2 {
    color: #000000 !important;
    font-size: 12pt !important;
  }

  .reports-page .report-document-header b {
    color: #222222 !important;
  }

  .reports-page .report-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 2mm !important;
    margin-bottom: 4mm !important;
  }

  .reports-page .report-kpi-grid .stat-card {
    break-inside: avoid;
    page-break-inside: avoid;
    min-height: 0 !important;
    padding: 2mm !important;
    border: 1px solid #d6d6d6 !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  .reports-page .report-kpi-grid .stat-card strong {
    font-size: 12pt !important;
  }

  .reports-page .report-kpi-grid .stat-card strong,
  .reports-page .report-kpi-grid .stat-card small,
  .reports-page .report-kpi-grid .stat-card span {
    color: #000000 !important;
  }

  .reports-page .report-kpi-grid .stat-icon {
    display: none !important;
  }

  .reports-page .sales-pie-layout {
    grid-template-columns: 35mm minmax(0, 1fr) !important;
    gap: 4mm !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .reports-page .sales-pie-chart {
    width: 34mm !important;
    margin: 0 !important;
  }

  .reports-page .sales-pie-legend-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .reports-page .report-no-sales {
    margin: 0 0 5mm;
    padding: 4mm;
    border: 1px solid #aaaaaa;
    color: #000000 !important;
    font-weight: 700;
    break-inside: avoid;
  }

  .reports-page .report-detail-panel {
    break-inside: auto;
    page-break-inside: auto;
  }

  .reports-page .report-detail-panel.report-compact-breakdown {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .reports-page .report-detail-panel .panel-header {
    break-after: avoid;
    page-break-after: avoid;
  }

  .reports-page .report-detail-panel h2,
  .reports-page .report-detail-panel h3 {
    color: #000000 !important;
    font-size: 11pt !important;
  }

  .reports-page .report-detail-panel small,
  .reports-page .report-detail-panel b {
    color: #222222 !important;
  }
}

.staff-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.staff-stats {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.staff-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.staff-section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.staff-section-nav a:hover {
  background: var(--bg);
}

.staff-section-nav a[aria-current="page"] {
  border-color: var(--secondary);
  background: var(--secondary);
  color: var(--primary);
}

.staff-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 14px;
  align-items: end;
}

.staff-form-grid .field {
  min-width: 0;
}

.staff-form-heading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 0 12px;
  color: var(--text);
}

.staff-form-heading small {
  color: var(--text-muted);
  font-size: 12px;
}

.staff-field-wide {
  grid-column: 1 / -1;
}

.staff-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0 0 16px;
  color: var(--text);
  font-size: 13px;
}

.staff-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.staff-directory {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.staff-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}

.staff-card summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.staff-card summary::-webkit-details-marker {
  display: none;
}

.staff-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--primary);
  font-size: 17px;
  font-weight: 700;
}

.staff-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.staff-card-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

.staff-card-main strong {
  color: var(--text);
}

.staff-card-main small {
  color: var(--text-muted);
  font-size: 12px;
}

.staff-status,
.staff-work-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.staff-status.is-active {
  border-color: var(--secondary);
  background: var(--secondary-light);
  color: var(--text);
}

.staff-card-caret {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.staff-edit-form {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.staff-inline-form {
  padding: 14px 0 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.staff-inline-form .field {
  margin-bottom: 10px;
}

.staff-filter-form,
.staff-actions,
.staff-status-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.staff-filter-form {
  margin: 10px 0 16px;
}

.staff-filter-form label {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.staff-filter-form input {
  width: auto;
  min-width: 150px;
}

.staff-attendance-self {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.staff-attendance-self .panel-header {
  margin-bottom: 0;
}

.staff-work-list {
  display: grid;
  gap: 12px;
}

.staff-work-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.staff-work-card.is-urgent {
  border-color: var(--secondary);
  box-shadow: inset 4px 0 0 var(--secondary);
}

.staff-work-card.is-overdue {
  border-color: var(--primary);
  box-shadow: inset 4px 0 0 var(--primary);
}

.staff-work-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.staff-work-head > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.staff-work-head strong {
  color: var(--text);
  font-size: 15px;
}

.staff-work-head small {
  color: var(--text-muted);
  font-size: 12px;
}

.staff-work-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 14px;
  color: var(--text);
  font-size: 13px;
}

.staff-work-details b {
  color: var(--primary);
}

.staff-work-details .staff-instructions,
.staff-work-details .staff-delivery-details {
  grid-column: 1 / -1;
}

.staff-alert {
  display: inline-flex;
  margin-top: 12px;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: var(--secondary-light);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.staff-work-card.is-overdue .staff-alert {
  background: var(--primary-light);
  color: var(--primary-hover);
}

.staff-work-card .staff-actions {
  margin-top: 12px;
}

.staff-empty {
  padding: 18px;
  color: var(--text-muted);
  text-align: center;
}

.staff-status-form select {
  width: auto;
  min-width: 92px;
  padding: 5px 8px;
}

@media (max-width: 760px) {
  .staff-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .staff-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .staff-field-wide,
  .staff-form-heading {
    grid-column: auto;
  }

  .staff-card summary {
    flex-wrap: wrap;
  }

  .staff-status {
    margin-left: 54px;
  }

  .staff-work-head {
    flex-direction: column;
  }
}

/* Keep long workspaces and data tables reachable without clipping page content. */
.sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-nav {
  min-height: 0;
  overscroll-behavior: contain;
}

.main-content,
.page-body {
  min-width: 0;
}

.page-body {
  min-height: 0;
}

.page-body > * {
  min-width: 0;
  max-width: 100%;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.stat-info {
  min-width: 0;
}

.stat-info,
.stat-info small,
.stat-info strong {
  overflow-wrap: anywhere;
}

.custom-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  min-width: 0;
}

.custom-grid > * {
  min-width: 0;
}

.options-table-wrap {
  max-width: 100%;
}

.options-table {
  min-width: 540px;
}

.paper-width-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.paper-width-options > * {
  min-width: 0;
}

.data-table-container,
.table-wrap {
  min-width: 0;
  max-width: 100%;
  max-height: min(72vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table td {
  overflow-wrap: anywhere;
}

.report-date-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.modal-overlay {
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* The cashier's catalog and order are separate scroll regions on desktop. */
.pos-page {
  height: 100vh;
  overflow: hidden;
}

.pos-app {
  height: 100%;
  min-height: 0;
}

.pos-app .main-content {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.pos-app .top-bar,
.pos-app .app-footer {
  flex: 0 0 auto;
}

.pos-app .page-body.pos-page-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 14px 20px;
}

.pos-page-body > .notice {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.pos-page-body > form#checkoutForm {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.pos-page .pos-container {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 430px);
  gap: 16px;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
}

.pos-catalog {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  gap: 10px;
}

.pos-toolbar,
.category-nav {
  flex: 0 0 auto;
}

.product-grid {
  min-height: 0;
  grid-auto-rows: minmax(240px, auto);
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  padding: 2px 6px 6px 2px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.product-card-title {
  overflow-wrap: anywhere;
}

.pos-cart-panel {
  position: static;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  gap: 8px;
  padding: 14px;
}

.pos-cart-panel .order-calc {
  gap: 4px;
  padding-top: 6px;
}

.pos-cart-panel .calc-row {
  font-size: 12px;
}

.pos-cart-panel .calc-row.grand-total {
  font-size: 17px;
  padding-top: 3px;
}

.cart-header,
.order-calc,
.pos-cart-panel > .field,
.pos-cart-panel > .fields-row,
.pos-cart-panel > #cashTenderedSection,
.pos-cart-panel > #submitOrderBtn {
  flex: 0 0 auto;
}

.cart-items-list {
  flex: 1 1 auto;
  height: auto;
  min-height: 64px;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.cart-item {
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.cart-item-info {
  min-width: 0;
  flex: 1 1 110px;
}

.cart-item-meta {
  overflow-wrap: anywhere;
}

.cart-item-total {
  white-space: nowrap;
}

.customer-fields-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.customer-fields-row .field {
  min-width: 0;
  gap: 2px;
  margin-bottom: 0;
}

.customer-fields-row label {
  font-size: 10px;
}

.customer-fields-row input {
  min-width: 0;
  padding: 7px;
  font-size: 12px;
}

.discount-percent-row {
  align-items: center;
}

.discount-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.discount-input-wrap input {
  width: 100px;
  min-width: 0;
  text-align: right;
}

.discount-validation {
  display: block;
  min-height: 0;
  color: var(--danger);
  font-size: 11px;
}

.discount-validation:empty {
  display: none;
}

.cake-weight-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.6fr);
  gap: 8px;
}

.cake-weight-entry > small {
  display: block;
  color: var(--text-muted);
  margin-top: 4px;
}

@media (max-height: 760px) and (min-width: 901px) {
  .pos-app .top-bar {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .pos-app .page-body.pos-page-body {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .pos-cart-panel {
    gap: 5px;
    padding: 10px;
  }

  .pos-cart-panel > .field,
  .pos-cart-panel > .fields-row {
    margin-bottom: 2px !important;
  }

  .pos-cart-panel .payment-methods-grid {
    gap: 4px;
  }

  .pos-cart-panel .pm-radio-label {
    padding: 5px;
  }

  .pos-cart-panel #cashTenderedSection {
    margin-bottom: 2px !important;
  }

  .pos-cart-panel .cash-quick-chips {
    margin-top: 2px;
  }

  .pos-cart-panel .cash-chip {
    padding: 2px 6px;
  }
}

@media (max-width: 900px) {
  .pos-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .pos-app {
    height: auto;
    min-height: 100vh;
  }

  .pos-app .main-content {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .pos-app .page-body.pos-page-body {
    display: block;
    min-height: auto;
    overflow: visible;
  }

  .pos-page-body > form#checkoutForm {
    display: block;
    min-height: auto;
  }

  .pos-page .pos-container {
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .pos-catalog {
    min-height: 0;
    overflow: visible;
  }

  .product-grid {
    max-height: 55vh;
    min-height: 240px;
  }

  .pos-cart-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .cart-items-list {
    flex: 0 1 auto;
    max-height: 42vh;
    min-height: 100px;
  }
}

@media (max-width: 600px) {
  .pos-app .page-body.pos-page-body {
    padding: 12px;
  }

  .panel-header,
  .pos-toolbar {
    flex-wrap: wrap;
  }

  .pos-toolbar > * {
    min-width: 0;
    max-width: 100%;
  }

  .report-date-filter input[type="date"] {
    min-width: 0;
    max-width: 100%;
  }

  .data-table-container,
  .table-wrap {
    contain: paint;
  }

  .pos-page .pos-container {
    gap: 12px;
  }

  .pos-cart-panel {
    padding: 12px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 48vh;
    min-height: 200px;
  }

  .cart-item {
    align-items: flex-start;
  }

  .cart-item-qty-control {
    flex: 0 0 auto;
  }

  .customer-fields-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .custom-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .paper-width-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .group-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .group-header > div:last-child {
    flex-wrap: wrap;
  }

  .group-title-wrap {
    flex-wrap: wrap;
    min-width: 0;
  }
}

.purchase-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.purchase-stats {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 0;
}

.purchase-admin-tools {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 14px;
}

.purchase-admin-tools > .panel {
  margin: 0;
  padding: 16px;
}

.purchase-admin-tools > .panel > summary,
.purchase-supplier-edit > summary {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.purchase-admin-form,
.purchase-category-form,
.purchase-payment-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 12px;
  align-items: end;
  margin-top: 14px;
}

.purchase-admin-form .field,
.purchase-category-form .field,
.purchase-payment-form .field {
  min-width: 0;
}

.purchase-wide-field {
  grid-column: 1 / -1;
}

.purchase-supplier-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.purchase-supplier-edit {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.purchase-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.purchase-category-list span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
}

.purchase-entry-panel {
  margin: 0;
}

.purchase-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.purchase-items-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.purchase-items-heading h3,
.purchase-report-block h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.purchase-items-table-wrap,
.purchase-print-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.purchase-items-table {
  min-width: 860px;
}

.purchase-items-table input,
.purchase-items-table select {
  min-width: 100px;
  padding: 8px;
}

.purchase-items-table td:nth-child(1) input {
  min-width: 160px;
}

.purchase-items-table td:nth-child(6) {
  white-space: nowrap;
}

.purchase-total-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 20px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.purchase-total-summary span {
  display: flex;
  gap: 7px;
  color: var(--text-muted);
}

.purchase-total-summary strong {
  color: var(--primary);
}

.purchase-total-summary span:last-child strong {
  color: var(--text);
  font-size: 17px;
}

.purchase-print-report {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.purchase-report-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
}

.purchase-report-heading p {
  margin: 5px 0 16px;
  color: var(--text-muted);
}

.purchase-report-controls {
  margin-bottom: 22px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg);
}

.purchase-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.purchase-filter-form .field {
  min-width: 135px;
  margin: 0;
}

.purchase-filter-form .purchase-search-field {
  min-width: 200px;
  flex: 1;
}

.purchase-print-report > h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 17px;
}

.purchase-print-report .data-table {
  width: 100%;
}

.purchase-print-report .data-table th,
.purchase-print-report .data-table td {
  vertical-align: top;
}

.purchase-print-report small {
  color: var(--text-muted);
}

.purchase-status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff4e8;
  color: #70452f;
  font-size: 11px;
  font-weight: 700;
}

.purchase-status.is-received {
  background: #e8f0e7;
  color: #345b37;
}

.purchase-action-row > td {
  padding-top: 0;
}

.purchase-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.purchase-payment-details {
  min-width: 180px;
  color: var(--text-muted);
  font-size: 12px;
}

.purchase-payment-details > summary {
  cursor: pointer;
}

.purchase-payment-form {
  min-width: min(680px, 90vw);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.purchase-empty {
  padding: 16px !important;
  color: var(--text-muted);
  text-align: center;
}

.purchase-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.purchase-report-block {
  min-width: 0;
  break-inside: avoid;
}

.purchase-report-block h2 {
  margin: 0 0 9px;
}

.purchase-print-footnote {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.purchase-inventory-panel {
  margin: 0;
}

.purchase-dashboard-summary {
  align-items: stretch;
}

.purchase-dashboard-link {
  align-self: stretch;
  justify-content: center;
  padding: 14px;
  background: var(--surface);
  text-decoration: none;
}

@media (max-width: 900px) {
  .purchase-admin-tools,
  .purchase-report-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .purchase-page {
    gap: 12px;
  }

  .purchase-admin-form,
  .purchase-category-form,
  .purchase-payment-form,
  .purchase-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .purchase-wide-field {
    grid-column: auto;
  }

  .purchase-print-report {
    padding: 12px;
  }

  .purchase-total-summary {
    justify-content: flex-start;
  }

  .purchase-filter-form .field,
  .purchase-filter-form .purchase-search-field {
    min-width: 100%;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 12mm;
  }

  .purchases-page .purchase-stats,
  .purchases-page .purchase-admin-tools,
  .purchases-page .purchase-entry-panel,
  .purchases-page .purchase-inventory-panel {
    display: none !important;
  }

  .purchases-page .purchase-page {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .purchases-page .purchase-print-report {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #000000 !important;
    overflow: visible !important;
  }

  .purchases-page .purchase-print-table-wrap {
    width: 100%;
    max-width: none;
    overflow: visible;
  }

  .purchases-page .purchase-report-heading h1,
  .purchases-page .purchase-report-heading p,
  .purchases-page .purchase-print-report h2,
  .purchases-page .purchase-print-report th,
  .purchases-page .purchase-print-report td,
  .purchases-page .purchase-print-footnote {
    color: #000000 !important;
  }

  .purchases-page .purchase-report-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .purchases-page .purchase-report-block,
  .purchases-page .purchase-print-report tr {
    break-inside: avoid;
  }

  .purchases-page .purchase-print-report thead {
    display: table-header-group;
  }

  .purchases-page .purchase-print-report table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  .purchases-page .purchase-print-report th,
  .purchases-page .purchase-print-report td {
    border: 1px solid #d7d0c8 !important;
    padding: 5px !important;
    font-size: 8pt !important;
  }

  .purchases-page .purchase-status {
    border: 1px solid #777777 !important;
    background: #ffffff !important;
    color: #000000 !important;
  }
}
