
/* ============================================================
   UTSERVIO BILL STUDIO — Design System
   ============================================================ */

:root {
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-display: 'Outfit', -apple-system, sans-serif;

  --bg-app:        #09090b;
  --bg-panel:      #111114;
  --bg-panel-solid:#111114;
  --bg-card:       #18181c;
  --bg-card-hover: #1e1e23;
  --bg-input:      #18181c;

  --text-1: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #52525b;

  --border:       rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);

  --gold:      #F5A623;
  --gold-dim:  rgba(245, 166, 35, 0.12);
  --gold-glow: rgba(245, 166, 35, 0.20);
  --gold-hover:#F7B74A;
  --danger: #ef4444;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
}

[data-theme="light"] {
  --bg-app:        #f1f1f3;
  --bg-panel:      #ffffff;
  --bg-panel-solid:#ffffff;
  --bg-card:       #f7f7f9;
  --bg-card-hover: #eeeef2;
  --bg-input:      #ffffff;
  --text-1: #18181b;
  --text-2: #52525b;
  --text-3: #a1a1aa;
  --border:       rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.16);
  --gold-glow: rgba(245, 166, 35, 0.12);
  --gold-dim:  rgba(245, 166, 35, 0.08);
}

body.special-theme {
  --gold:      #8B5CF6;
  --gold-glow: rgba(139, 92, 246, 0.18);
  --gold-dim:  rgba(139, 92, 246, 0.10);
  --gold-hover:#A78BFA;
}

/* BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%; overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-2); font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* APP SHELL */
#app {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; overflow: hidden; z-index: 1;
}
#app::before {
  content: ""; position: absolute; top: -20%; right: -10%; width: 60vw; height: 60vw;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 60%);
  pointer-events: none; z-index: -1; filter: blur(60px);
}
#app::after {
  content: ""; position: absolute; bottom: -20%; left: -10%; width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 60%);
  pointer-events: none; z-index: -1; filter: blur(60px);
}

/* TYPOGRAPHY */
h1, h2, h3, .panel-title {
  font-family: var(--font-display); color: var(--text-1); font-weight: 700; letter-spacing: -0.02em;
}

/* ============================================================
   BUTTON SYSTEM
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer; border: none; outline: none;
  font-family: var(--font-sans); white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.12s;
  user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Ghost */
.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-1); border-color: var(--border-hover); }

/* Icon only */
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* Gold CTA */
.btn-gold {
  background: var(--gold); color: #000; font-weight: 700;
  box-shadow: 0 2px 10px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-gold:hover { background: var(--gold-hover); box-shadow: 0 4px 18px var(--gold-glow); transform: translateY(-1px); }
.btn-gold:active { transform: scale(0.97); }

/* Danger */
.btn-danger {
  background: rgba(239,68,68,0.1); color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.4); color: #fca5a5; }

/* ---- Add button on service card ---- */
.btn-add-initial {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card-hover);
  color: var(--text-2);
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-add-initial:hover { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
.btn-add-initial:active { transform: scale(0.97); }

/* ---- Qty +/- buttons ---- */
.qty-btn {
  width: 30px; height: 30px; border-radius: var(--radius-xs);
  background: var(--bg-card-hover); border: 1px solid var(--border);
  color: var(--text-1); font-size: 18px; font-weight: 400; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.qty-btn:hover { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
.qty-btn:active { transform: scale(0.9); }

.qty-display-input {
  font-size: 14px; font-weight: 700; color: var(--text-1);
  min-width: 22px; text-align: center;
}

/* Price editable input on card */
.price-input {
  padding: 4px 8px; font-size: 13px; font-family: var(--font-sans);
  font-weight: 600; text-align: center;
  border-radius: var(--radius-xs); border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-1);
  outline: none; width: 66px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.price-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); }

/* ============================================================
   FORM INPUTS
   ============================================================ */
.bill-input {
  width: 100%; padding: 11px 14px; font-size: 14px;
  background: var(--bg-input); color: var(--text-1);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bill-input::placeholder { color: var(--text-3); }
.bill-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel); z-index: 100; flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { filter: drop-shadow(0 2px 8px var(--gold-glow)); }
.logo-product { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--text-1); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.launcher-wrap { position: relative; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-layout {
  display: flex; flex: 1; flex-direction: row; min-height: 0;
  width: 100%; padding: 20px; gap: 20px;
  max-width: 1600px; margin: 0 auto;
}

/* ============================================================
   PANELS
   ============================================================ */
.services-panel, .cart-panel {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.services-panel { flex: 1.6; }
.cart-panel { flex: 1; min-width: 360px; max-width: 460px; }

.panel-header, .cart-header {
  padding: 18px 22px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.panel-title { font-size: 17px; }

.toolbar-box {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-card); flex-shrink: 0;
}
.custom-item-row { display: flex; gap: 10px; margin-top: 10px; }

/* ============================================================
   SERVICE CARDS GRID
   ============================================================ */
.services-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
  padding: 18px; display: grid; gap: 14px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.services-scroll::-webkit-scrollbar { width: 5px; }
.services-scroll::-webkit-scrollbar-track { background: transparent; }
.services-scroll::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 10px; }
.services-scroll::-webkit-scrollbar-thumb:hover { background: var(--gold); }

.service-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: default; position: relative;
}
.service-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3); transform: translateY(-2px);
}
.service-card.active-service {
  border-color: var(--gold); background: var(--gold-dim);
  box-shadow: 0 0 0 1px var(--gold), 0 4px 20px var(--gold-glow);
}

.service-card-header { display: flex; align-items: center; gap: 12px; }
.service-img { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.service-emoji-fallback {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--bg-card-hover); font-size: 22px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.service-main { flex: 1; min-width: 0; }
.service-main h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 3px; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.price-display { font-size: 13px; color: var(--gold); font-weight: 700; }

.action-area { margin-top: auto; }
.service-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.qty-row { display: flex; align-items: center; gap: 6px; }
.price-row { display: flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 12px; }

/* ============================================================
   CART PANEL INNER
   ============================================================ */
.cart-inner {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  padding: 18px; gap: 14px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.cart-inner::-webkit-scrollbar { width: 4px; }
.cart-inner::-webkit-scrollbar-track { background: transparent; }
.cart-inner::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 10px; }

.cart-client-fields { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }

.cart-items {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
}
.cart-items::-webkit-scrollbar { display: none; }

/* Empty cart placeholder */
.cart-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; color: var(--text-3);
  font-size: 14px; text-align: center; padding: 30px;
  line-height: 1.6;
}

.cart-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) backwards; flex-shrink: 0;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 12px; color: var(--gold); font-weight: 600; }
.cart-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.total-card {
  background: var(--gold-dim); border: 1px solid var(--gold);
  border-radius: var(--radius); padding: 18px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: 0 4px 20px var(--gold-glow); flex-shrink: 0;
}
body.special-theme .total-card {
  background: rgba(139,92,246,0.08); border-color: var(--gold); box-shadow: 0 4px 20px var(--gold-glow);
}
.total-card-label { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 1.5px; }
.total-card-amount { font-family: var(--font-display); font-size: 38px; font-weight: 800; color: var(--text-1); line-height: 1; }
.total-discount-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }

.cart-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; flex-shrink: 0; }
.cart-secondary-btns { display: flex; gap: 8px; }
.cart-secondary-btns .btn { flex: 1; justify-content: center; }

/* ============================================================
   AVATAR / USER MENU
   ============================================================ */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold-dim); border: 1.5px solid var(--gold);
  color: var(--gold); font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: box-shadow 0.2s;
}
.avatar:hover { box-shadow: 0 0 0 3px var(--gold-glow); }
.user-menu-wrap { position: relative; }

.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-panel-solid); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 200; min-width: 200px; padding: 6px;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown-header { padding: 10px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-dropdown-name { font-size: 13px; font-weight: 700; color: var(--text-1); }
.user-dropdown-email { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: var(--radius-xs); font-size: 13px; font-weight: 500; color: var(--text-2);
  text-decoration: none; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.user-dropdown-item:hover { background: var(--bg-card-hover); color: var(--text-1); }
.user-dropdown-item.danger:hover { background: rgba(239,68,68,0.08); color: var(--danger); }

.waffle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.waffle-item {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  text-decoration: none; padding: 10px 4px; border-radius: var(--radius-xs);
  transition: background 0.15s; cursor: pointer;
}
.waffle-item:hover { background: var(--bg-card-hover); }
.waffle-sq {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  margin-bottom: 6px; transition: border-color 0.15s, transform 0.15s;
}
.waffle-item:hover .waffle-sq { border-color: var(--gold); transform: scale(1.05); }
.waffle-sq svg { width: 20px; height: 20px; color: var(--text-1); }
.waffle-item span { font-size: 10px; font-weight: 600; color: var(--text-2); }
.waffle-item:hover span { color: var(--gold); }

/* ============================================================
   TOGGLE
   ============================================================ */
.toggle-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle-checkbox { display: none; }
.toggle-slider {
  width: 40px; height: 22px; background: var(--bg-card-hover);
  border-radius: 20px; position: relative; border: 1px solid var(--border); transition: 0.25s;
}
.toggle-slider::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: var(--text-3); border-radius: 50%; transition: 0.25s;
}
.toggle-checkbox:checked + .toggle-slider { background: var(--gold); border-color: var(--gold); }
.toggle-checkbox:checked + .toggle-slider::after { left: 20px; background: #fff; }
.toggle-label { font-size: 12px; font-weight: 600; color: var(--text-2); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; transition: opacity 0.25s;
}
.modal-backdrop.show,
.modal-backdrop.open { display: flex; opacity: 1; }

.modal-content {
  background: var(--bg-panel-solid); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 90%; max-width: 500px; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  transform: scale(0.96); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-backdrop.show .modal-content,
.modal-backdrop.open .modal-content { transform: scale(1); }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 17px; font-weight: 700; color: var(--text-1); }
.modal-close {
  background: transparent; border: none; color: var(--text-3);
  font-size: 20px; cursor: pointer; padding: 4px; transition: color 0.15s; border-radius: var(--radius-xs);
}
.modal-close:hover { color: var(--text-1); background: var(--bg-card-hover); }
.modal-body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px);
  background: #1c1c1f; color: #fff; padding: 11px 22px;
  border-radius: var(--radius-xl); font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); z-index: 9999;
  opacity: 0; visibility: hidden; border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* MISC */
.msg-area {
  width: 100%; height: 200px; padding: 14px;
  background: var(--bg-input); color: var(--text-1);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; outline: none; resize: none; line-height: 1.6;
}
.msg-area:focus { border-color: var(--gold); }
.export-option-card:hover { border-color: var(--gold) !important; background: var(--bg-card-hover) !important; }

/* ============================================================
   MOBILE TAB BAR
   ============================================================ */
.mobile-tab-bar { display: none; }

/* ============================================================
   RESPONSIVE 900px — Tab layout
   ============================================================ */
@media (max-width: 900px) {
  html, body { position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100%; overflow: hidden; }
  #app { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; overflow: hidden; }

  .topbar { height: 52px; padding: 0 14px; flex-shrink: 0; }
  .logo-product { font-size: 15px; }
  .topbar .btn-ghost span { display: none; }
  .topbar .btn-ghost { padding: 8px; border-color: transparent; }

  .mobile-tab-bar {
    display: flex; flex-shrink: 0;
    background: var(--bg-panel); border-bottom: 1px solid var(--border);
    padding: 6px 14px; gap: 8px;
  }
  .mobile-tab {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 12px; border-radius: 9px; border: none;
    background: transparent; color: var(--text-2);
    font-family: var(--font-sans); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background 0.18s, color 0.18s; position: relative;
  }
  .mobile-tab.active { background: var(--gold); color: #000; }
  .mobile-tab-badge {
    position: absolute; top: 3px; right: 5px;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 5px; line-height: 1.4;
  }

  .main-layout { padding: 0; flex: 1; min-height: 0; overflow: hidden; border-radius: 0; max-width: 100%; position: relative; display: block; }

  .services-panel, .cart-panel {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 0; border: none; box-shadow: none;
    overflow: hidden; width: 100%; height: 100%;
    display: flex; flex-direction: column;
  }
  .services-panel[data-mobile-hidden="true"],
  .cart-panel[data-mobile-hidden="true"] { display: none; }

  .services-scroll {
    flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 12px; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  }
  .cart-inner {
    flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 14px; gap: 12px; display: flex; flex-direction: column;
  }
  .cart-items { overflow: visible; flex: none; }
  .cart-actions { margin-top: 0; }

  .service-card { padding: 11px; gap: 10px; }
  .service-img, .service-emoji-fallback { width: 38px; height: 38px; font-size: 19px; }
  .service-main h3 { font-size: 13px; }
  .price-display { font-size: 12px; }
}

/* ============================================================
   RESPONSIVE 480px — Phone
   ============================================================ */
@media (max-width: 480px) {
  .services-scroll { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 10px; gap: 8px; }
  .topbar { padding: 0 12px; }
}

/* ============================================================
   INVOICE / EXPORT — A4 Canvas
   ============================================================ */
.invoice-a4-canvas {
  width: 794px; height: 1122px; background: #ffffff; color: #333333;
  font-family: 'Inter', sans-serif; position: relative; padding: 0 40px 30px 40px;
  box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; isolation: isolate;
}
.invoice-watermark {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 130px; font-weight: 900; color: rgba(0,0,0,0.02);
  pointer-events: none; z-index: 1; white-space: nowrap; letter-spacing: 2px;
}
.invoice-a4-canvas > * { position: relative; z-index: 2; }
.invoice-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 40px; border-bottom: 2px solid #111111; padding-bottom: 24px; padding-top: 0;
}
.invoice-logo-col { display: flex; flex-direction: column; gap: 16px; }
.invoice-logo { display: flex; align-items: center; gap: 12px; }
.invoice-brand { font-size: 26px; font-weight: 900; color: #111; letter-spacing: -0.5px; }
.invoice-company-details { font-size: 12px; color: #555; line-height: 1.6; }
.invoice-meta-col { text-align: right; }
.invoice-title { font-size: 42px; font-weight: 900; color: #111; margin: 0 0 16px 0; letter-spacing: 2px; }
.invoice-meta-grid {
  display: grid; grid-template-columns: auto auto; gap: 6px 16px; text-align: left;
  background: #F8F9FA; padding: 12px 16px; border-radius: 4px; border: 1px solid #EEEEEE;
}
.meta-label { font-size: 11px; font-weight: 700; color: #777; text-transform: uppercase; }
.meta-value { font-size: 13px; font-weight: 600; color: #111; text-align: right; }
.invoice-bill-to-box { margin-bottom: 30px; background: #FFFFFF; border-left: 4px solid #F5A623; padding: 8px 16px; }
.bill-to-label { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; margin-bottom: 4px; letter-spacing: 1px; }
.bill-to-name { font-size: 18px; font-weight: 800; color: #111; }
.bill-to-address { font-size: 12px; color: #555; }
.invoice-table { width: 100%; border-collapse: collapse; margin-bottom: 40px; }
.invoice-table th { background: #111111; padding: 12px 16px; font-size: 11px; font-weight: 700; color: #FFFFFF; text-transform: uppercase; text-align: left; letter-spacing: 0.5px; }
.invoice-table td { padding: 14px 16px; border-bottom: 1px solid #EEEEEE; font-size: 13px; color: #333; }
.invoice-table tbody tr:nth-child(even) { background: #FAFAFA; }
.invoice-bottom-grid { display: grid; grid-template-columns: 1fr 320px; gap: 40px; margin-bottom: 50px; }
.invoice-payment-info { font-size: 12px; color: #555; line-height: 1.6; }
.payment-title { font-size: 11px; font-weight: 700; color: #111; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #DDD; padding-bottom: 6px; margin-bottom: 10px; }
.invoice-summary { background: #F8F9FA; border: 1px solid #EEE; padding: 20px; border-radius: 4px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; color: #555; }
.summary-row.summary-total { border-top: 1px solid #CCC; padding-top: 12px; margin-top: 4px; font-size: 22px; font-weight: 900; color: #111; }
.invoice-footer { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; border-top: 1px solid #EEEEEE; padding-top: 20px; }
.terms-title { font-size: 11px; font-weight: 700; color: #111; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.invoice-terms { font-size: 10px; color: #777; line-height: 1.6; max-width: 60%; }
.invoice-signature { text-align: center; font-size: 11px; color: #555; }
.signature-line { width: 180px; height: 1px; background: #333; margin-bottom: 10px; }
.signature-brand { font-weight: 800; color: #111; font-size: 13px; margin-top: 2px; }

/* ============================================================
   SHARE ACTION SHEET BUTTONS
   ============================================================ */
.share-action-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 12px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.share-action-btn:hover {
  background: var(--bg-card-hover); border-color: var(--border-hover);
  transform: translateX(2px);
}
.share-action-btn:active { transform: scale(0.98); }

.share-action-icon {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.share-action-text { flex: 1; min-width: 0; }
.share-action-label { font-size: 14px; font-weight: 600; color: var(--text-1); }
.share-action-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.share-action-arrow { color: var(--text-3); flex-shrink: 0; }

/* ============================================================
   UTSERVIO BRAND INVOICE — matches provided design
   ============================================================ */
.utv-invoice {
  width: 794px;
  min-height: 1122px;
  background: #fff;
  font-family: 'Inter', -apple-system, sans-serif;
  color: #333;
  display: flex; flex-direction: column;
  position: relative;
}

/* Top accent stripe */
.utv-invoice-topbar {
  background: linear-gradient(90deg, #E8750A 0%, #F5A623 100%);
  height: 6px; width: 100%;
}

.utv-invoice-body {
  padding: 36px 48px 40px;
  display: flex; flex-direction: column; flex: 1;
}

/* Header: logo left, BILL badge right */
.utv-inv-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px;
}
.utv-inv-logo { display: flex; align-items: center; gap: 12px; }
.utv-inv-logo img { height: 52px; object-fit: contain; }
.utv-inv-bill-badge {
  background: #E8750A;
  color: #fff; font-size: 26px; font-weight: 900;
  padding: 6px 22px; border-radius: 8px; letter-spacing: 3px;
}

/* Tagline */
.utv-inv-tagline {
  text-align: center; font-size: 13px; color: #888; margin: 10px 0 6px;
  display: flex; align-items: center; gap: 10px; justify-content: center;
}
.utv-inv-tagline::before, .utv-inv-tagline::after {
  content: ""; flex: 1; max-width: 80px; height: 1.5px; background: #E8750A;
}

/* Booking info row */
.utv-inv-meta {
  display: flex; justify-content: flex-end; gap: 0;
  margin-bottom: 28px;
}
.utv-inv-meta-table { font-size: 13px; color: #444; border-collapse: collapse; }
.utv-inv-meta-table td { padding: 2px 6px; }
.utv-inv-meta-table td:first-child { color: #888; padding-right: 10px; }
.utv-inv-meta-table td:last-child { font-weight: 600; color: #111; }

/* TO / FROM section */
.utv-inv-parties {
  display: grid; grid-template-columns: 1fr 1px 1fr;
  gap: 0; margin-bottom: 30px; padding-bottom: 8px;
}
.utv-inv-party { padding: 0 20px; }
.utv-inv-party:first-child { padding-left: 0; }
.utv-inv-party-divider { background: #ddd; }
.utv-inv-party-label { font-size: 13px; font-weight: 800; color: #E8750A; margin-bottom: 8px; letter-spacing: 0.5px; }
.utv-inv-party-name { font-size: 16px; font-weight: 800; color: #111; margin-bottom: 4px; }
.utv-inv-party-addr { font-size: 12px; color: #666; line-height: 1.6; }

/* Services table */
.utv-inv-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.utv-inv-table thead tr th {
  background: #E8750A; color: #fff;
  padding: 12px 14px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; text-align: left;
}
.utv-inv-table thead tr th:first-child { border-radius: 0; width: 40px; text-align: center; }
.utv-inv-table thead tr th:nth-child(3),
.utv-inv-table thead tr th:nth-child(4),
.utv-inv-table thead tr th:nth-child(5) { text-align: center; }
.utv-inv-table tbody tr td {
  padding: 14px 14px; font-size: 13px; color: #333;
  border-bottom: 1px solid #EBEBEB; vertical-align: middle;
}
.utv-inv-table tbody tr td:first-child { text-align: center; color: #777; font-weight: 600; }
.utv-inv-table tbody tr td:nth-child(3),
.utv-inv-table tbody tr td:nth-child(4),
.utv-inv-table tbody tr td:nth-child(5) { text-align: center; }
.utv-inv-table tbody tr:nth-child(even) td { background: #FFFAF4; }
.utv-inv-item-name { font-weight: 700; color: #111; }
.utv-inv-orig-price { text-decoration: line-through; color: #aaa; font-size: 12px; }
.utv-inv-disc-price { color: #2e9e4f; font-weight: 700; }

/* Totals */
.utv-inv-totals {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0;
  margin-bottom: 30px;
}
.utv-inv-total-row {
  display: flex; justify-content: flex-end; gap: 32px; align-items: center;
  padding: 8px 0; font-size: 13px; width: 360px;
}
.utv-inv-total-row .lbl { color: #666; }
.utv-inv-total-row .val { color: #333; font-weight: 600; min-width: 90px; text-align: right; }
.utv-inv-total-row.discount .lbl { color: #2e9e4f; }
.utv-inv-total-row.discount .val { color: #2e9e4f; }
.utv-inv-total-sep { width: 360px; height: 1px; background: repeating-linear-gradient(90deg, #ccc 0, #ccc 6px, transparent 6px, transparent 12px); margin: 4px 0; }
.utv-inv-grand-total {
  display: flex; justify-content: space-between; gap: 32px;
  padding: 10px 0; font-size: 18px; font-weight: 900; color: #111;
  width: 360px;
}

/* Footer */
.utv-inv-footer {
  margin-top: auto; padding-top: 24px;
  border-top: 2px solid #E8750A;
  display: flex; justify-content: center; align-items: center; gap: 40px;
}
.utv-inv-footer-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #555; }
.utv-inv-footer-item svg { color: #E8750A; }
