/*
 * Vertex Quote — Main CSS Design System
 * FILE: WWW/css/main.css
 * [FROM VERTEX QUOTE] Style_CSS.html.txt — ported 1:1, extended with new views
 * =============================================================
 * Rubik font | RTL Hebrew | Mobile-First | Glassmorphism
 * =============================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800;900&display=swap');

/* ── 1. ROOT VARIABLES ──────────────────────────────────────── */
:root {
  --primary:       #222222;
  --secondary:     #555555;
  --accent:        #222222;
  --accent-text:   #ffffff;
  --bg-body:       #eef1f5;
  --bg-card:       #ffffff;
  --bg-light:      #f8f9fa;
  --color-alert:   #d9534f;
  --color-success: #25D366;
  --color-border:  #dee2e6;

  --primary-gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --glass-bg:         color-mix(in srgb, var(--bg-card) 90%, transparent);
  --glass-input-bg:   color-mix(in srgb, var(--bg-light) 70%, transparent);
  --primary-dim:      color-mix(in srgb, var(--primary)  8%,  transparent);
  --primary-soft:     color-mix(in srgb, var(--primary)  12%, transparent);
  --primary-glow:     color-mix(in srgb, var(--primary)  25%, transparent);
  --accent-hover:     color-mix(in srgb, var(--accent)   85%, black);
  --accent-shadow:    color-mix(in srgb, var(--accent)   30%, transparent);
  --shadow-primary:   color-mix(in srgb, var(--primary)  18%, transparent);

  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --shadow-sm:    0 2px 8px rgba(0,0,0,0.04);
  --shadow-card:  0 10px 40px -10px rgba(0,0,0,0.08), inset 0 1px 1px rgba(255,255,255,0.6);
  --shadow-btn:   0 10px 25px -5px var(--accent-shadow);
  --shadow-float: 0 20px 60px -15px var(--shadow-primary);

  --safe-area-bottom: env(safe-area-inset-bottom, 16px);
}

/* ── 2. ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 16px;
  border: 1px solid rgba(0,0,0,0.04); box-shadow: var(--shadow-sm); overflow: hidden;
}
.skeleton-line {
  height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, #ececec 25%, #f8f8f8 50%, #ececec 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear; margin-bottom: 12px;
}
.skeleton-line.wide  { width: 70%; }
.skeleton-line.mid   { width: 50%; }
.skeleton-line.short { width: 35%; height: 10px; }
.skeleton-line.tall  { height: 36px; border-radius: var(--radius-sm); margin-top: 16px; }

@keyframes pulse-animation {
  0%   { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(2.5); opacity: 0; }
}
@keyframes fadeText {
  from { opacity: 0.3; } to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(40px) scale(0.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 3. RESET / BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
  direction: rtl; text-align: right;
  background-color: var(--bg-body); color: #1E293B;
  user-select: none; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none; margin: 0; padding: 0; padding-bottom: 240px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── 4. LOADER ──────────────────────────────────────────────── */
#loading {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-body);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
.loader-logo-container {
  position: relative; width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 24px;
}
.loader-logo { width: 70px; height: auto; z-index: 2; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.12)); }
.pulse-ring {
  position: absolute; width: 100%; height: 100%;
  border-radius: 50%; border: 2px solid var(--primary); opacity: 0;
  animation: pulse-animation 2s infinite;
}
.pulse-ring:nth-child(2) { animation-delay: 0.6s; }
.loading-text {
  font-size: 11px; letter-spacing: 3px; font-weight: 900;
  color: var(--primary); text-transform: uppercase;
  animation: fadeText 1.5s infinite alternate;
}

/* ── 5. VIEWS ───────────────────────────────────────────────── */
.view { min-height: 100vh; }
.view.hidden { display: none !important; }
#app { min-height: 100vh; }

/* ── 6. LOGIN ───────────────────────────────────────────────── */
#login-view {
  display: flex; flex-direction: column;
  min-height: 100dvh;
}
.login-container {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 20px 20px 0;
  background: linear-gradient(135deg, var(--bg-body) 0%, var(--bg-light) 100%);
}
.login-card {
  width: 100%; max-width: min(400px, calc(100vw - 40px));
  padding: 40px 32px;
}
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-xl);
}
.login-logo {
  display: flex; justify-content: center; margin-bottom: 20px;
}
.login-logo img {
  width: 160px; height: 160px;
  object-fit: contain; border-radius: 28px;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,0.18));
}
#register-panel .login-logo img {
  width: 100px; height: 100px;
  border-radius: 20px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.15));
}
.login-title {
  font-size: 1.7rem; font-weight: 900; text-align: center;
  margin: 0 0 4px; color: var(--primary); letter-spacing: -0.5px;
}
.login-sub {
  text-align: center; color: var(--secondary); font-size: 0.95rem;
  margin: 0 0 28px; font-weight: 500;
}
.login-error {
  color: var(--color-alert); font-size: 0.9rem; font-weight: 600;
  text-align: center; margin-top: 14px;
}
.login-links {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 20px;
}
.login-link-btn {
  background: none; border: none; padding: 0;
  color: var(--secondary); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: color 0.2s;
}
.login-link-btn:hover { color: var(--primary); }
.login-link-sep { color: var(--color-border); font-size: 0.85rem; }

/* ── 7. CONTAINER ───────────────────────────────────────────── */
.container { width: 100%; min-height: 100vh; display: flex; flex-direction: column; }

/* ── 8. HEADER ──────────────────────────────────────────────── */
.header {
  text-align: center; padding: 36px 20px 28px;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-body) 100%);
  border-radius: 0 0 28px 28px; box-shadow: var(--shadow-card);
  margin-bottom: 8px; position: relative;
}
.logo-img {
  max-height: 80px; width: auto; max-width: 100%;
  margin: 0 auto 14px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.08));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); display: block;
}
.logo-img:hover { transform: scale(1.06); }
.biz-title  { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; }
.biz-phone  {
  font-size: 1.05rem; font-weight: 600; color: var(--primary);
  direction: ltr; opacity: 0.9; text-decoration: none; display: block; cursor: pointer;
}
.biz-slogan {
  font-size: 0.82rem; color: var(--secondary); margin-top: 10px;
  background: var(--primary-dim); padding: 5px 14px;
  border-radius: 20px; display: inline-block; font-weight: 500;
}
.logout-btn {
  position: absolute; top: 16px; left: 16px;
  background: none; border: none; color: var(--secondary);
  font-size: 0.82rem; cursor: pointer; font-weight: 600; padding: 6px 12px;
  border-radius: 20px; transition: background 0.2s;
}
.logout-btn:hover { background: var(--bg-light); }
.tier-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 900;
  padding: 3px 10px; border-radius: 20px; letter-spacing: 1.5px;
  margin-right: 8px; text-transform: uppercase;
}
.tier-basic   { background: var(--primary-dim); color: var(--primary); }
.tier-premium { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }

/* ── 9. CARD SECTIONS ───────────────────────────────────────── */
.card-section {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  margin: 16px 12px; padding: 28px 22px;
  border-radius: var(--radius-xl); box-shadow: var(--shadow-card);
  border: 1px solid rgba(255,255,255,0.7); position: relative; overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s;
}
.card-section:hover { transform: translateY(-4px); box-shadow: var(--shadow-float); }
.card-section::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--primary-gradient);
}
.section-title {
  font-size: 0.88rem; font-weight: 800; color: var(--secondary);
  text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }

/* ── 10. INPUTS ─────────────────────────────────────────────── */
.input-group { position: relative; margin-bottom: 22px; }

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="email"],
input[type="password"],
select, textarea {
  direction: rtl; text-align: right; width: 100%;
  padding: 18px 16px; height: 60px;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  font-size: 16px; background-color: var(--glass-input-bg); color: #334155;
  font-weight: 500; outline: none; font-family: inherit;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  appearance: none; -webkit-appearance: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
input[type="password"] { direction: ltr; text-align: right; }

input:focus, select:focus, textarea:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  transform: translateY(-1px);
}
textarea { height: auto; min-height: 100px; resize: vertical; }

select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748B' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: left 16px center; background-size: 16px 12px;
  padding-left: 40px; cursor: pointer;
}
.input-label {
  position: absolute; top: 20px; right: 16px;
  font-size: 14px; color: #94A3B8; font-weight: 600;
  pointer-events: none;
  transition: top 0.2s, font-size 0.2s, color 0.2s, font-weight 0.2s;
}
input:focus ~ .input-label,
input:not(:placeholder-shown) ~ .input-label,
select:focus ~ .input-label,
select:valid ~ .input-label,
textarea:focus ~ .input-label,
textarea:not(:placeholder-shown) ~ .input-label {
  top: -8px; right: 12px; font-size: 11px;
  color: var(--primary); font-weight: 800;
  background-color: var(--bg-body); padding: 0 6px; border-radius: 4px;
}
::placeholder { color: transparent; }

/* ── 11. BUTTONS ────────────────────────────────────────────── */
.btn {
  background: var(--primary-gradient); color: var(--accent-text);
  border: none; padding: 18px 24px; border-radius: var(--radius-xl);
  width: 100%; font-size: 1.15rem; font-weight: 800; letter-spacing: 0.5px;
  cursor: pointer; position: relative; overflow: hidden;
  box-shadow: var(--shadow-btn);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  text-decoration: none;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(rgba(255,255,255,0.25), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 15px 30px -5px var(--accent-shadow); }
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.96); }

.btn-secondary {
  background: var(--bg-light); color: var(--primary);
  border: 1.5px solid var(--color-border);
  padding: 14px 24px; border-radius: var(--radius-xl);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: all 0.25s; display: flex; align-items: center;
  justify-content: center; gap: 10px; text-decoration: none;
}
.btn-secondary:hover { background: var(--bg-card); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-clear { background: transparent; color: var(--secondary); box-shadow: none; font-size: 0.88rem; padding: 8px; border: none; cursor: pointer; width: 100%; }
.btn-danger { background: var(--color-alert); color: #fff; border: none; padding: 11px 20px; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; }
.btn-outline-danger { background: transparent; border: 1.5px solid var(--color-alert); color: var(--color-alert); padding: 11px 15px; border-radius: var(--radius-md); font-weight: 700; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.9rem; width: 100%; }
.btn-outline-danger:hover { background: var(--color-alert); color: #fff; }
.btn-sm { padding: 10px 18px; font-size: 0.9rem; border-radius: var(--radius-md); }
.btn-icon { width: auto; padding: 12px 18px; font-size: 0.95rem; }

/* ── 12. STICKY ACTION BAR ──────────────────────────────────── */
.action-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--glass-bg); backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  padding: 18px 20px calc(18px + var(--safe-area-bottom)) 20px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.08), 0 -1px 0 rgba(255,255,255,0.4);
  z-index: 1000; display: flex; flex-direction: column; gap: 12px;
  border-top: 1px solid rgba(255,255,255,0.5);
}

/* ── 13. SUMMARY GRID ───────────────────────────────────────── */
.summary-grid {
  background: var(--glass-input-bg); border-radius: var(--radius-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--color-border); box-shadow: inset 0 2px 5px rgba(0,0,0,0.02);
}
.summary-row   { display: flex; justify-content: space-between; align-items: center; }
.summary-label { font-size: 1.05rem; color: var(--secondary); font-weight: 600; }
.summary-value { font-weight: 800; font-size: 1.15rem; color: #1E293B; }
.total-row { margin-top: 12px; padding-top: 16px; border-top: 2px dashed rgba(0,0,0,0.1); }
.total-row .summary-label { font-size: 1.15rem; color: var(--primary); font-weight: 900; }
.total-row .summary-value { font-size: 1.35rem; color: var(--primary); }

/* ── 14. ITEMS TABLE ────────────────────────────────────────── */
.items-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-top: -8px; }
.items-table th { font-size: 12px; color: #bbb; font-weight: 500; padding: 0 10px; text-align: right; }
.items-table tr.item-row { background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.03); }
.items-table td { padding: 14px 10px; border-bottom: 1px solid #f5f5f5; }
.items-table tr td:first-child { border-radius: 0 10px 10px 0; border-right: 3px solid var(--primary); }
.items-table tr td:last-child   { border-radius: 10px 0 0 10px; }
.item-desc  { font-weight: 700; font-size: 0.95rem; }
.item-price { font-family: monospace; font-weight: 700; color: var(--primary); font-size: 1rem; }
.item-remove { background: none; border: none; color: #ccc; cursor: pointer; font-size: 1.2rem; padding: 4px 8px; transition: color 0.2s; }
.item-remove:hover { color: var(--color-alert); }

/* ── 15. FILTERS & SEARCH ───────────────────────────────────── */
.search-bar { position: relative; margin-bottom: 14px; }
.search-input {
  width: 100%; padding: 18px 44px 18px 18px;
  border: 1px solid var(--color-border); background: var(--glass-input-bg);
  border-radius: var(--radius-lg); font-size: 1.05rem; font-family: inherit;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  transition: all 0.3s; outline: none; color: #1E293B; font-weight: 500;
}
.search-input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #bbb; pointer-events: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.filter-scroll {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 4px 16px 14px; margin: 0 -12px 14px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip {
  white-space: nowrap; padding: 10px 20px; border-radius: 30px;
  background: rgba(255,255,255,0.7); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.8); color: #64748B;
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
  transition: all 0.3s; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.filter-chip:hover { transform: translateY(-3px); background: #fff; color: var(--primary); }
.filter-chip.active { background: var(--primary-gradient); color: #fff; border-color: transparent; box-shadow: var(--shadow-btn); transform: scale(1.05); }

/* ── 16. ORDER CARDS ────────────────────────────────────────── */
.order-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: var(--radius-xl); padding: 24px 22px; margin-bottom: 16px;
  box-shadow: var(--shadow-card); border: 1px solid rgba(255,255,255,0.8);
  position: relative; overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.35s;
  display: flex; flex-direction: column; gap: 12px; cursor: pointer;
}
.order-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-float); }
.order-card::before {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 4px;
  background: var(--color-border);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.status-sent::before,
.status-Sent::before     { background: var(--primary); }
.status-signed::before,
.status-Signed::before   { background: var(--color-success); }
.status-handled::before,
.status-Handled::before  { background: #95a5a6; }
.status-rejected::before,
.status-Rejected::before { background: var(--color-alert); }

.card-header { display: flex; justify-content: space-between; align-items: center; }
.card-id     { font-size: 0.78rem; color: #bbb; font-family: monospace; letter-spacing: 1px; }
.card-status { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; padding: 6px 14px; border-radius: 20px; background: var(--glass-input-bg); color: var(--secondary); border: 1px solid rgba(255,255,255,0.6); letter-spacing: 0.5px; }
.status-sent .card-status, .status-Sent .card-status     { background: var(--primary-dim); color: var(--primary); }
.status-signed .card-status, .status-Signed .card-status   { background: rgba(37,211,102,0.12); color: var(--color-success); }
.status-rejected .card-status, .status-Rejected .card-status { background: rgba(217,83,79,0.12); color: var(--color-alert); }
.card-body h3 { margin: 0 0 4px; font-size: 1.08rem; }
.card-details { font-size: 0.88rem; color: #888; display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.card-price   { font-size: 1.2rem; font-weight: 800; color: var(--primary); margin-top: 6px; }
.card-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(1px, 1fr)); gap: 10px; margin-top: 12px; padding-top: 14px; border-top: 1px solid rgba(0,0,0,0.05); }
.action-btn {
  padding: 12px 10px; border-radius: var(--radius-md); border: none;
  font-size: 0.9rem; font-weight: 700; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.25s; background: var(--glass-input-bg); color: #64748B;
  text-decoration: none; text-align: center;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.5), 0 2px 5px rgba(0,0,0,0.02);
}
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.05); color: var(--primary); background: #fff; }
.action-btn:active { transform: scale(0.96); }
.action-btn.primary  { background: var(--primary-gradient); color: #fff; box-shadow: var(--shadow-btn); }
.action-btn.primary:hover { color: #fff; }
.action-btn.whatsapp { background: linear-gradient(135deg, #25D366, #128C7E); color: #fff; box-shadow: 0 6px 15px -4px rgba(37,211,102,0.4); }
.action-btn.whatsapp:hover { color: #fff; }
.action-btn.danger   { background: #fff0f0; color: var(--color-alert); border: 1px solid rgba(217,83,79,0.2); }
.action-btn.danger:hover { color: var(--color-alert); background: #ffe6e6; }

/* ── 17. ADMIN CONTROLS ─────────────────────────────────────── */
.admin-controls {
  display: flex; gap: 8px; background: var(--bg-light);
  padding: 5px; border-radius: 50px; margin-bottom: 18px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.04);
}
.mode-btn {
  flex: 1; padding: 11px; border: none; background: transparent;
  font-weight: 700; color: #888; border-radius: 40px; cursor: pointer; font-family: inherit;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s; font-size: 0.92rem;
}
.mode-btn.active { background: var(--bg-card); color: var(--primary); box-shadow: 0 3px 10px rgba(0,0,0,0.1); }

/* ── 18. SIGNATURE PAD ──────────────────────────────────────── */
.canvas-wrapper {
  border: 2px dashed var(--color-border); border-radius: var(--radius-md);
  background: #fafafa;
  background-image: radial-gradient(var(--color-border) 1px, transparent 1px);
  background-size: 20px 20px; position: relative; overflow: hidden;
  margin-bottom: 10px; transition: border-color 0.25s;
}
.canvas-wrapper:focus-within { border-color: var(--primary); }
canvas { width: 100%; height: 200px; display: block; cursor: crosshair; }

/* ── 19. MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: center;
  z-index: 9999; transition: opacity 0.25s;
}
.modal-overlay.hidden { display: none !important; }
.modal-box {
  background: var(--bg-card); padding: 24px 22px;
  border-radius: var(--radius-xl); width: 92%; max-width: 420px;
  box-shadow: var(--shadow-float); animation: slideUp 0.35s cubic-bezier(0.16,1,0.3,1);
  border: 1px solid rgba(255,255,255,0.6);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; border-bottom: 1px solid var(--color-border); padding-bottom: 10px; }
.modal-header h3 { margin: 0; font-size: 1.1rem; color: var(--primary); font-weight: 800; }
.close-btn { background: none; border: none; font-size: 26px; cursor: pointer; color: #aaa; line-height: 1; }
.modal-footer { margin-top: 22px; display: flex; justify-content: flex-end; gap: 12px; }

/* ── 20. ADMIN PANEL (NEW) ──────────────────────────────────── */
.admin-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: 260px;
  background: var(--bg-card); border-left: 1px solid var(--color-border);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: -4px 0 20px rgba(0,0,0,0.06); z-index: 200;
}
.admin-main { margin-right: 260px; padding: 24px; min-height: 100vh; }
.admin-nav-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border-radius: var(--radius-md); cursor: pointer; font-weight: 600;
  color: var(--secondary); transition: all 0.2s; border: none; background: none;
  width: 100%; text-align: right; font-family: inherit; font-size: 0.95rem;
}
.admin-nav-item:hover   { background: var(--primary-dim); color: var(--primary); }
.admin-nav-item.active  { background: var(--primary-gradient); color: #fff; box-shadow: var(--shadow-btn); }

.biz-list-card {
  background: var(--glass-bg); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-lg); padding: 20px 22px;
  margin-bottom: 14px; cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 16px;
}
.biz-list-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.biz-avatar {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--primary-gradient); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 900; color: #fff;
}
.biz-info h3 { margin: 0 0 3px; font-size: 1rem; font-weight: 800; }
.biz-info p  { margin: 0; font-size: 0.82rem; color: var(--secondary); }
.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
}
.status-active   { background: rgba(37,211,102,0.15); color: #16a34a; }
.status-inactive { background: rgba(217,83,79,0.12); color: var(--color-alert); }
.status-trial    { background: rgba(245,158,11,0.15); color: #d97706; }

/* ── 21. PRICE EDITOR ───────────────────────────────────────── */
.price-editor-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.price-editor-desc { flex: 1; font-size: 0.9rem; font-weight: 600; }
.price-editor-input {
  width: 110px; height: 44px; padding: 8px 12px;
  border: 1.5px solid var(--color-border); border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 700; text-align: center; direction: ltr;
  transition: border-color 0.2s; font-family: inherit; background: #fff;
  outline: none;
}
.price-editor-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.price-save-btn {
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--primary-gradient); color: #fff;
  border: none; font-weight: 700; cursor: pointer; font-size: 0.85rem;
  transition: all 0.2s; white-space: nowrap;
}
.price-save-btn:hover { transform: translateY(-1px); }
.price-save-btn.saved { background: linear-gradient(135deg, #25D366, #128C7E); }

/* ── 22. FOOTER ─────────────────────────────────────────────── */
.vertex-footer {
  text-align: center;
  padding: 30px 20px 20px;
  margin-top: auto;
  border-top: 1px solid rgba(0,0,0,0.05);
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.6));
  position: relative; z-index: 10;
}
/* Pushes content above the bottom nav / action-bar */
.vertex-footer::after {
  content: '';
  display: block;
  height: calc(80px + env(safe-area-inset-bottom, 0px));
}
.vertex-label {
  font-size: 10px; font-weight: 900; letter-spacing: 2.5px;
  color: #c0c0c0; margin-bottom: 12px; text-transform: uppercase;
}
.vertex-logo-container {
  display: block;
  cursor: pointer;
  text-decoration: none;
}
.vertex-logo-container img {
  height: 64px; width: auto;
  display: block; margin: 0 auto;
  filter: grayscale(100%) opacity(0.65);
  transition: filter 0.35s cubic-bezier(0.175,0.885,0.32,1.275),
              transform 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
}
.vertex-logo-container:hover img {
  filter: grayscale(0%) opacity(1);
  transform: scale(1.06);
}
.vertex-slogan {
  font-size: 12px; color: #aaa;
  margin-top: 12px; font-weight: 500;
  letter-spacing: 0.3px;
}

/* ── 23. UTILITIES ──────────────────────────────────────────── */
.hidden { display: none !important; }
.text-alert   { color: var(--color-alert); }
.text-success { color: var(--color-success); }
.text-muted   { color: var(--secondary); }
.fw-bold { font-weight: 800; }
.icon { width: 20px; height: 20px; stroke-width: 2; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; vertical-align: sub; flex-shrink: 0; }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin 0.7s linear infinite; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--secondary); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; margin: 0 0 8px; color: #94A3B8; }
.empty-state p  { font-size: 0.9rem; }

/* ── 24. SWEETALERT OVERRIDES ───────────────────────────────── */
div:where(.swal2-container) h2 { font-family: 'Rubik', sans-serif !important; color: var(--primary) !important; font-weight: 800 !important; }
div:where(.swal2-popup) { border-radius: 20px !important; padding: 28px !important; text-align: center !important; font-family: 'Rubik', sans-serif !important; }
div:where(.swal2-html-container) { text-align: center !important; font-size: 15px !important; color: var(--secondary) !important; }
div:where(.swal2-actions) { justify-content: center !important; }
div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm { background-color: var(--accent) !important; color: var(--accent-text) !important; border-radius: var(--radius-sm) !important; font-weight: 800 !important; font-family: 'Rubik', sans-serif !important; }
div:where(.swal2-popup).swal2-toast { background: #fff !important; box-shadow: 0 8px 28px rgba(0,0,0,0.1) !important; border-right: 4px solid var(--primary) !important; }
div:where(.swal2-timer-progress-bar) { background: var(--primary) !important; }
div:where(.swal2-icon).swal2-error   { border-color: var(--color-alert) !important; color: var(--color-alert) !important; }
div:where(.swal2-icon).swal2-success { border-color: var(--color-success) !important; }

/* ── 24b. SWEETALERT CENTERING FIX (ported from RentManager) ── */
.swal2-container.swal2-center > .swal2-popup:not(.swal2-toast) {
  margin: auto !important;
  max-width: min(420px, calc(100vw - 32px)) !important;
}
.swal2-container.swal2-center:not(.swal2-noanimation) {
  padding: 16px !important;
  align-items: center !important;
}
@media (max-width: 480px) {
  div:where(.swal2-popup):not(.swal2-toast) {
    width: calc(100vw - 24px) !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }
}

/* ── 25. RESPONSIVE ─────────────────────────────────────────── */
@media (min-width: 768px) {
  body { padding-bottom: 100px; }
  .container { max-width: 800px; margin: 0 auto; box-shadow: 0 0 60px rgba(0,0,0,0.06); background: var(--bg-body); border-radius: 0 0 var(--radius-xl) var(--radius-xl); min-height: 100vh; }
  #orders-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; padding-bottom: 20px; }
  .order-card { margin-bottom: 0; }
  .order-card:hover { transform: translateY(-4px) scale(1.015); box-shadow: 0 20px 45px -10px rgba(0,0,0,0.14); }
  .action-bar { max-width: 800px; left: 50%; right: auto; transform: translateX(-50%); width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 16px 32px calc(16px + var(--safe-area-bottom)) 32px; }
  .card-section { margin: 14px 0; padding: 32px 28px; }
  .header { padding: 44px 32px 32px; }
}

@media (min-width: 1024px) {
  .container { max-width: 860px; }
}

/* ── Mobile: hide admin sidebar, use bottom nav instead ─────── */
@media (max-width: 767px) {
  .admin-sidebar { display: none; }
  .admin-main    { margin-right: 0; padding: 16px; }

  /* ── iOS Safari: prevent auto-zoom on input focus (font-size < 16px) ── */
  input, select, textarea { font-size: max(16px, 1rem) !important; }

  /* ── Momentum scroll on login card ─────────────────────────────── */
  .login-card { -webkit-overflow-scrolling: touch; }
}

/* ── Landscape on short screens: compact login logo ─────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .login-logo img { width: 72px !important; height: 72px !important; }
  .login-card { padding: 20px 24px; }
  .login-sub  { margin-bottom: 12px; }
}

/* ── Extra-narrow phones (≤ 360px) ──────────────────────────── */
@media (max-width: 360px) {
  .login-card { padding: 28px 20px; }
  .login-logo img { width: 120px; height: 120px; }
}

/* ── Login-screen footer: compact, no extra bottom space ─────── */
#login-view .vertex-footer {
  background: none !important;
  border: none !important;
  padding: 14px 20px 10px;
}
#login-view .vertex-footer::after { display: none; }
#login-view .vertex-logo-container img { height: 52px; }
#login-view .vertex-label { margin-bottom: 8px; }
#login-view .vertex-slogan { margin-top: 8px; font-size: 11px; }

/* ── 26. CATALOG EDITOR (Admin Panel — Phase 6) ─────────────── */
.catalog-tab-bar {
  display: flex; gap: 4px; background: var(--bg-light);
  padding: 4px; border-radius: 14px; margin-bottom: 20px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
}
.catalog-tab-btn {
  flex: 1; padding: 10px 8px; border: none; background: transparent;
  font-weight: 700; font-size: 0.85rem; color: var(--secondary);
  border-radius: 10px; cursor: pointer; font-family: inherit;
  transition: all 0.2s; white-space: nowrap;
}
.catalog-tab-btn.active {
  background: var(--bg-card); color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.catalog-toolbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 14px; flex-wrap: wrap;
}
.catalog-search {
  flex: 1; min-width: 130px; height: 40px; padding: 8px 14px;
  border: 1.5px solid var(--color-border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.9rem; outline: none;
  background: #fff; transition: border-color 0.2s; direction: rtl;
}
.catalog-search:focus { border-color: var(--primary); }
.catalog-table-wrap {
  overflow-x: auto; border-radius: var(--radius-md);
  margin-bottom: 12px; border: 1px solid var(--color-border);
}
.catalog-table {
  width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 480px;
}
.catalog-table th {
  background: var(--primary); color: #fff; padding: 10px 8px;
  font-weight: 700; font-size: 0.78rem; text-align: right;
  white-space: nowrap; position: sticky; top: 0;
}
.catalog-table td {
  padding: 3px 3px; border-bottom: 1px solid rgba(0,0,0,0.04);
  vertical-align: middle;
}
.catalog-table tr:hover td { background: var(--primary-dim); }
.catalog-td-num {
  color: var(--secondary); font-size: 0.72rem; width: 34px;
  text-align: center; padding: 0 4px;
}
.catalog-cell {
  width: 100%; padding: 7px 8px; border: 1.5px solid transparent;
  border-radius: 7px; font-family: inherit; font-size: 0.85rem;
  background: transparent; outline: none; min-width: 60px;
  transition: border-color 0.15s, background 0.15s;
}
.catalog-cell:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.catalog-cell.price {
  width: 88px; direction: ltr; text-align: left; font-weight: 700; min-width: 70px;
}
.catalog-row-del {
  background: none; border: none; cursor: pointer; color: #ccc;
  font-size: 1rem; padding: 6px 8px; border-radius: 6px;
  transition: color 0.2s, background 0.2s; line-height: 1;
}
.catalog-row-del:hover { color: var(--color-alert); background: rgba(217,83,79,0.08); }
.catalog-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 10px 0; font-size: 0.88rem; color: var(--secondary);
}
.catalog-page-btn {
  padding: 7px 16px; border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm); background: #fff; cursor: pointer;
  font-weight: 700; font-family: inherit; font-size: 0.85rem;
  transition: all 0.2s;
}
.catalog-page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.catalog-page-btn:disabled { opacity: 0.35; cursor: default; }
.addon-editor-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.addon-editor-table th {
  background: var(--bg-light); padding: 8px 10px; font-size: 0.78rem;
  font-weight: 700; color: var(--secondary); text-align: right; border-bottom: 2px solid var(--color-border);
}
.addon-editor-table td { padding: 4px 4px; border-bottom: 1px solid rgba(0,0,0,0.04); vertical-align: middle; }
.level-label-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.level-label-num {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 900;
}
.undo-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1a2332; color: #fff; padding: 14px 20px;
  border-radius: var(--radius-md); display: flex; align-items: center; gap: 14px;
  z-index: 9000; box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  animation: slideUp 0.35s cubic-bezier(0.16,1,0.3,1);
  font-size: 0.9rem; font-weight: 600; white-space: nowrap;
}
.undo-toast button {
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3);
  color: #fff; padding: 6px 14px; border-radius: 8px; cursor: pointer;
  font-weight: 700; font-family: inherit; font-size: 0.85rem; transition: background 0.2s;
}
.undo-toast button:hover { background: rgba(255,255,255,0.28); }

/* ═══════════════════════════════════════════════════════════════
   27. MOBILE EXCELLENCE — Full-spectrum phone optimization
   Covers: all iPhone models (SE/14/15/Pro Max/notch/Dynamic Island),
   Android (Samsung, Pixel, mid-range), small screens ≤ 360px,
   landscape mode, keyboard-visible states, and reduced-motion.
   ═══════════════════════════════════════════════════════════════ */

/* ── 27a. Touch targets — minimum 44×44 px ─────────────────── */
.item-remove {
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.btn-clear {
  min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.close-btn {
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.login-link-btn { min-height: 44px; padding: 8px 12px; }
.logout-btn     { min-height: 36px; }

/* ── 27b. Undo toast — safe-area-inset-bottom aware ────────── */
.undo-toast {
  bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 80px));
}

/* ── 27c. Offline banner — push content down when visible ───── */
#offline-banner.show ~ * { margin-top: 42px; }
body.offline-visible { padding-top: 42px; }

/* ── 27d. Modal overlay — notch / home-bar safe areas ────────── */
.modal-overlay {
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.modal-box {
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── 27e. Admin panel — bottom-tab navigation on mobile ─────── */
@media (max-width: 767px) {
  .admin-sidebar { display: none !important; }
  .admin-main { margin-right: 0 !important; padding: 12px !important; }

  /* Compact catalog toolbar on narrow screens */
  .catalog-toolbar { flex-direction: column; align-items: stretch; }
  .catalog-search  { min-width: 0; width: 100%; }
  .catalog-table-wrap { font-size: 0.78rem; }
}

/* ── 27f. Reduced motion — respect user system preference ────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-in-up { animation: none; opacity: 1; transform: none; }
  .pulse-ring  { animation: none; display: none; }
  .skeleton-line { animation: none; }
  .spinner { animation: none; border-top-color: currentColor; }
}

/* ── 27g. Ultra-narrow phones (≤ 360px) ─────────────────────── */
@media (max-width: 360px) {
  .card-section { margin: 10px 6px; padding: 20px 14px; }
  .btn          { padding: 16px 16px; font-size: 1rem; }
  .btn-secondary { padding: 12px 14px; font-size: 0.9rem; }
  .action-bar   { padding: 12px 12px calc(12px + var(--safe-area-bottom)) 12px; gap: 8px; }
  .summary-label { font-size: 0.9rem; }
  .summary-value { font-size: 1rem; }
  .total-row .summary-value { font-size: 1.1rem; }
  .biz-title    { font-size: 1.2rem; }

  /* SweetAlert on tiny screens */
  div:where(.swal2-popup):not(.swal2-toast) {
    width: calc(100vw - 16px) !important;
    padding: 20px 16px !important;
  }
}

/* ── 27h. Landscape on short screens ────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .action-bar { flex-direction: row; flex-wrap: wrap; }
  .action-bar .btn { flex: 1; min-width: 140px; }
  .card-section { margin: 6px 8px; padding: 16px 18px; }
}

/* ── 27i. Dynamic Island / notch top-bar clearance ─────────── */
@media (max-width: 430px) {
  .header, .quote-header {
    padding-top: max(36px, calc(env(safe-area-inset-top, 0px) + 20px));
  }
}

/* ── 27j. Action bar: ensure it's never covered by SW keyboard ── */
/* On Android Chrome, 100dvh adapts to visible viewport (excludes keyboard).
   We anchor the action-bar so it scrolls into view instead of being covered. */
@supports (height: 100dvh) {
  .action-bar {
    /* Stays pinned above the virtual keyboard on modern Android */
    bottom: env(keyboard-inset-height, 0px);
    padding-bottom: calc(18px + max(env(safe-area-inset-bottom, 0px), env(keyboard-inset-height, 0px)));
  }
}

/* ── 27k. Font-size guard — iOS auto-zoom prevention ─────────── */
/* Already 16px in base, this ensures it in ALL states incl. JS-injected */
@media (max-width: 767px) {
  input[type="text"],
  input[type="number"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  select, textarea {
    font-size: max(16px, 1rem) !important;
    /* Tap highlight removal on mobile inputs */
    -webkit-tap-highlight-color: transparent;
  }
}

/* ── 27l. Hover states — disable on touch devices ───────────── */
@media (hover: none) and (pointer: coarse) {
  .btn:hover         { transform: none; box-shadow: var(--shadow-btn); }
  .btn-secondary:hover { transform: none; box-shadow: none; }
  .order-card:hover  { transform: none; box-shadow: var(--shadow-card); }
  .card-section:hover { transform: none; box-shadow: var(--shadow-card); }
  .action-btn:hover  { transform: none; color: #64748B; background: var(--glass-input-bg); }
  .logo-img:hover    { transform: none; }
  .filter-chip:hover { transform: none; background: rgba(255,255,255,0.7); color: #64748B; }
}

/* ── 27m. Signature image display after signing ─────────────── */
#q-sig-img {
  height: clamp(120px, 35vw, 180px);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
