/* IronBill Mobile Modern Industrial Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #ea580c;
  --primary-dark: #c2410c;
  --primary-light: #ffedd5;
  --secondary: #0f172a;
  --secondary-light: #1e293b;
  --accent: #2563eb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  user-select: none;
  touch-action: manipulation;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#app-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  background: #ffffff;
  box-shadow: 0 0 25px rgba(0,0,0,0.08);
}

/* App Header */
.app-header {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 2px solid var(--primary);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  background: var(--primary);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-info h1 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-info span {
  font-size: 0.72rem;
  color: #94a3b8;
}

.header-role-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-admin {
  background: rgba(234, 88, 12, 0.2);
  color: #fb923c;
  border: 1px solid #ea580c;
}

.role-salesman {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border: 1px solid #2563eb;
}

/* Main Content Container */
.main-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  padding-bottom: 95px; /* Space for bottom nav & banner ad */
  background: #f8fafc;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
  z-index: 50;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.03);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

.nav-item.active {
  color: var(--primary);
  transform: translateY(-2px);
}

/* Ad Banner Container */
.ad-banner-slot {
  background: #f1f5f9;
  border-top: 1px dashed #cbd5e1;
  padding: 4px 8px;
  text-align: center;
  font-size: 0.65rem;
  color: #64748b;
  position: absolute;
  bottom: 56px;
  left: 0;
  right: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
}

.ad-pill {
  background: #cbd5e1;
  color: #334155;
  font-size: 0.58rem;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
}

/* Cards & Components */
.card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  outline: none;
}

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

.btn-primary:active {
  background: var(--primary-dark);
}

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

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

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--secondary);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: 6px;
}

.btn-block {
  width: 100%;
}

/* Quick POS Cart Bar */
.cart-checkout-bar {
  position: absolute;
  bottom: 96px;
  left: 12px;
  right: 12px;
  background: var(--secondary);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  z-index: 48;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  width: 100%;
  max-width: 540px;
  border-radius: 20px 20px 0 0;
  padding: 18px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

/* Forms */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  background: #ffffff;
  transition: border-color 0.15s;
}

.form-control:focus {
  border-color: var(--primary);
}

/* Badges & Tags */
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
}

.badge-low-stock {
  background: #fee2e2;
  color: #dc2626;
}

.badge-stock {
  background: #dcfce7;
  color: #15803d;
}

/* Thermal Printable Bill formatting */
.receipt-paper {
  background: #ffffff;
  padding: 18px;
  border: 1px solid #cbd5e1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: #000000;
  line-height: 1.4;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed #000;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.receipt-title {
  font-size: 1.1rem;
  font-weight: bold;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
}

.receipt-table th, .receipt-table td {
  padding: 4px 0;
  text-align: left;
}

.receipt-table .text-right {
  text-align: right;
}

.receipt-divider {
  border-top: 1px dashed #000;
  margin: 6px 0;
}

.receipt-footer {
  text-align: center;
  margin-top: 12px;
  font-size: 0.75rem;
}
