/* ==========================================================================
   BizSoft Desktop POS - Main Stylesheet
   Brand Palette derived from BizSoft Logo:
   - Primary Cyan Blue: #009FE3
   - Primary Navy Dark: #12284C
   ========================================================================== */

:root {
  --brand-cyan: #009fe3;
  --brand-cyan-hover: #0086c3;
  --brand-cyan-light: #e6f6fd;
  --brand-navy: #12284c;
  --brand-navy-light: #1d3b6b;
  --brand-navy-dark: #0b1930;

  --bg-main: #f3f6fa;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafd;

  --text-primary: #12284c;
  --text-secondary: #526582;
  --text-muted: #8394ab;

  --border-color: #dce4f0;
  --border-focus: #009fe3;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 3px rgba(18, 40, 76, 0.06);
  --shadow-md: 0 4px 14px rgba(18, 40, 76, 0.08);
  --shadow-lg: 0 12px 32px rgba(18, 40, 76, 0.14);

  --sidebar-width: 250px;
  --topbar-height: 64px;
  --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

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

html, body {
  height: 100%;
  width: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   AUTHENTICATION / MULTI-TENANT LOGIN SCREEN
   ========================================================================== */

.auth-wrapper {
  height: 100vh;
  width: 100vw;
  display: flex;
  background: linear-gradient(135deg, var(--brand-navy-dark) 0%, var(--brand-navy) 55%, #0c4d7a 100%);
  position: relative;
  overflow: auto;
}

.auth-split-left {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.auth-split-left::before {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 159, 227, 0.22) 0%, transparent 70%);
  top: -120px;
  left: -120px;
  pointer-events: none;
}

.auth-brand-hero {
  max-width: 480px;
  z-index: 1;
}

.auth-brand-logo-box {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-bottom: 32px;
}

.auth-brand-logo-box img {
  height: 68px;
  width: auto;
  object-fit: contain;
}

.auth-brand-hero h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.auth-brand-hero h1 span {
  color: var(--brand-cyan);
}

.auth-brand-hero p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 28px;
  line-height: 1.6;
}

.auth-feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
}

.auth-feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-cyan);
  flex-shrink: 0;
}

.auth-split-right {
  flex: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  padding: 36px;
  position: relative;
}

.auth-card-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-card-logo {
  height: 54px;
  margin-bottom: 12px;
  object-fit: contain;
}

.auth-card-header h2 {
  font-size: 21px;
  font-weight: 700;
  color: var(--brand-navy);
}

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

/* Step indicator pills */
.auth-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.step-pill.active {
  background: var(--brand-cyan-light);
  color: var(--brand-cyan);
  border-color: var(--brand-cyan);
}

.step-pill.completed {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

/* Tenant Banner inside Step 2 */
.tenant-active-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--brand-cyan-light);
  border: 1px solid rgba(0, 159, 227, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 18px;
}

.tenant-active-info {
  display: flex;
  flex-direction: column;
}

.tenant-active-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.tenant-active-code {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-navy);
}

.tenant-active-url {
  font-size: 11px;
  color: var(--brand-cyan-hover);
  font-family: monospace;
}

/* Quick preset chips for Company Code */
.company-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.preset-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: var(--brand-cyan-light);
  color: var(--brand-cyan);
  border-color: var(--brand-cyan);
}

.sandbox-toggle-bar {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==========================================================================
   FORMS & BUTTONS
   ========================================================================== */

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-label .req {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(0, 159, 227, 0.15);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-cyan-hover);
}

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

.btn-navy:hover:not(:disabled) {
  background-color: var(--brand-navy-light);
}

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

.btn-success:hover:not(:disabled) {
  background-color: #059669;
}

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

.btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
}

.btn-outline {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.link-btn {
  background: none;
  border: none;
  color: var(--brand-cyan);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

/* ==========================================================================
   MAIN APPLICATION SHELL (SIDEBAR + TOPBAR + WORKSPACE)
   ========================================================================== */

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--brand-navy);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: #ffffff;
  border-bottom: 2px solid var(--brand-cyan);
}

.sidebar-brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.sidebar-brand-badge {
  margin-left: auto;
  background: var(--brand-navy);
  color: var(--brand-cyan);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.6px;
}

.sidebar-tenant-box {
  margin: 14px 14px 6px;
  padding: 10px 12px;
  background: rgba(0, 159, 227, 0.14);
  border: 1px solid rgba(0, 159, 227, 0.3);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.sidebar-tenant-box .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.65);
}

.sidebar-tenant-box .val {
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item.active {
  background: var(--brand-cyan);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 159, 227, 0.35);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--brand-navy-dark);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-cyan);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.user-meta {
  overflow: hidden;
}

.user-meta-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

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

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-navy);
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.workspace-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.workspace-content.pos-mode {
  padding: 16px;
  overflow: hidden;
}

/* ==========================================================================
   DASHBOARD STATS CARDS & TABLES
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

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

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

.stat-card-info h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-card-info .stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-navy);
}

.stat-card-info .stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.cyan {
  background: var(--brand-cyan-light);
  color: var(--brand-cyan);
}

.stat-icon.navy {
  background: #e8eef7;
  color: var(--brand-navy);
}

.stat-icon.green {
  background: var(--success-bg);
  color: var(--success);
}

.stat-icon.amber {
  background: var(--warning-bg);
  color: var(--warning);
}

/* Cards & Tables */
.panel-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-navy);
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  min-width: 240px;
}

.search-input-wrap input {
  padding-left: 34px;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: var(--bg-subtle);
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13.5px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.12s ease;
  cursor: pointer;
}

.data-table tbody tr:hover {
  background-color: var(--brand-cyan-light);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

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

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-cyan {
  background: var(--brand-cyan-light);
  color: var(--brand-cyan-hover);
}

/* ==========================================================================
   POS TERMINAL SCREEN (SPLIT MULTI-MONITOR HARDWARE READY)
   ========================================================================== */

.pos-container {
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 16px;
  height: 100%;
  overflow: hidden;
}

.pos-catalog-pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.pos-catalog-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pos-search-row {
  display: flex;
  gap: 10px;
}

.pos-category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.cat-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cat-pill.active, .cat-pill:hover {
  background: var(--brand-navy);
  color: #ffffff;
  border-color: var(--brand-navy);
}

.pos-products-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 12px;
  align-content: start;
}

.pos-item-card {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.14s ease;
  position: relative;
}

.pos-item-card:hover {
  border-color: var(--brand-cyan);
  background: #ffffff;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pos-item-card:active {
  transform: scale(0.98);
}

.pos-item-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-cyan);
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.pos-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 4px;
  line-height: 1.3;
}

.pos-item-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.pos-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.pos-item-price {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--brand-navy);
}

/* POS Cart Pane */
.pos-cart-pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pos-cart-header {
  padding: 12px 16px;
  background: var(--brand-navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-cart-header h3 {
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pos-cart-selectors {
  padding: 12px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
}

.cart-empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.cart-row-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-row-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.cart-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--brand-navy);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background: var(--brand-cyan);
  color: #ffffff;
  border-color: var(--brand-cyan);
}

.qty-input {
  width: 42px;
  text-align: center;
  padding: 3px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-weight: 700;
  font-size: 12.5px;
}

.cart-row-total {
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-navy);
  min-width: 82px;
  text-align: right;
}

.cart-remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px;
  opacity: 0.75;
}

.cart-remove-btn:hover {
  opacity: 1;
}

.pos-cart-summary {
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.summary-line.grand-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-navy);
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1.5px solid var(--border-color);
}

.summary-line.grand-total span:last-child {
  color: var(--brand-cyan);
}

.pos-cart-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-top: 10px;
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 25, 48, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.16s ease-out;
}

.modal-dialog.modal-lg {
  max-width: 820px;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 16px 22px;
  background: var(--brand-navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 22px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Detail Key-Value Grid inside Modals */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.detail-item {
  background: var(--bg-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.detail-item .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  font-weight: 600;
}

.detail-item .val {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-navy);
  margin-top: 2px;
  word-break: break-word;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--brand-navy);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--brand-cyan);
  font-size: 13px;
  font-weight: 500;
  min-width: 280px;
  max-width: 400px;
  animation: modalPop 0.2s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

/* Printable Thermal Receipt */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-receipt, #printable-receipt * {
    visibility: visible;
  }
  #printable-receipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm;
    padding: 4mm;
    background: #fff;
    color: #000;
    font-family: monospace;
  }
}
