/* ═══════════════════════════════════════════════════════════════════════════════
   Karsita CLM — Global Styles v2.0
   Extracted from UI_Styles.html for Firebase static hosting
   ═══════════════════════════════════════════════════════════════════════════════ */

:root { --primary:#1e40af; --primary-light:#3b82f6; --success:#16a34a; --warning:#d97706; --danger:#dc2626; --critical:#7c2d12; --text:#1f2937; --text-muted:#6b7280; --bg:#f3f4f6; --card:#ffffff; --border:#e5e7eb; }
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Segoe UI',-apple-system,sans-serif; background:var(--bg); color:var(--text); line-height:1.5; }
.container { max-width:960px; margin:0 auto; padding:16px; }
.sync-bar { display:flex; align-items:center; gap:12px; padding:8px 16px; background:var(--card); border-radius:8px; margin-bottom:16px; box-shadow:0 1px 3px rgba(0,0,0,0.1); }
.sync-dot { width:10px; height:10px; border-radius:50%; }
.sync-dot.online { background:var(--success); }
.sync-dot.offline { background:var(--danger); animation:pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.5;} }
.pending-badge { background:var(--danger); color:white; padding:2px 8px; border-radius:12px; font-size:12px; font-weight:600; }
.header { margin-bottom:20px; }
.header h1 { font-size:22px; color:var(--text); margin-bottom:16px; }
.tabs { display:flex; border-bottom:2px solid var(--border); }
.tab { padding:12px 24px; cursor:pointer; background:var(--card); border:1px solid var(--border); border-bottom:none; color:var(--text-muted); font-weight:500; position:relative; }
.tab:first-child { border-radius:8px 0 0 0; }
.tab:last-child { border-radius:0 8px 0 0; }
.tab.active { background:var(--primary); color:white; border-color:var(--primary); }
.tab.active::after { content:''; position:absolute; bottom:-8px; left:50%; transform:translateX(-50%); border:8px solid transparent; border-top-color:var(--primary); }
.section { background:var(--card); border:1px solid var(--border); border-radius:8px; margin-bottom:16px; overflow:hidden; }
.section-header { padding:12px 16px; background:#f9fafb; border-bottom:1px solid var(--border); cursor:pointer; display:flex; justify-content:space-between; align-items:center; }
.section-title { display:flex; align-items:center; gap:8px; font-weight:600; }
.chevron { width:20px; height:20px; transition:transform 0.2s; }
.section.collapsed .chevron { transform:rotate(-90deg); }
.section.collapsed .section-content { display:none; }
.section-content { padding:16px; }
.action-link { color:var(--primary); font-size:14px; background:none; border:none; cursor:pointer; }
.form-row { display:flex; flex-wrap:wrap; gap:16px; margin-bottom:12px; align-items:center; }
.form-group { display:flex; flex-direction:column; gap:4px; }
.form-group label { color:var(--text-muted); font-size:13px; font-weight:500; }
input,select,textarea { padding:8px 12px; border:1px solid var(--border); border-radius:6px; font-size:14px; }
input:focus,select:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(30,64,175,0.1); }
.radio-group { display:flex; gap:16px; }
.radio-label { display:flex; align-items:center; gap:6px; cursor:pointer; }
.toggle-group { display:flex; gap:8px; margin-bottom:16px; }
.toggle-btn { padding:8px 16px; border:1px solid var(--border); border-radius:20px; background:white; cursor:pointer; font-size:14px; color:var(--text-muted); }
.toggle-btn.active { border-color:var(--primary); color:var(--primary); background:#eff6ff; }
.data-table { width:100%; border-collapse:collapse; }
.data-table th { text-align:left; padding:10px 12px; background:#f9fafb; color:var(--text-muted); font-weight:500; font-size:13px; border-bottom:1px solid var(--border); }
.data-table td { padding:10px 12px; border-bottom:1px solid #f3f4f6; }
.status-pending { color:var(--warning); }
.status-complete { color:var(--success); }
.partner-card { display:flex; align-items:center; gap:16px; padding:16px; background:#f9fafb; border-radius:8px; margin-top:12px; }
.partner-avatar { width:48px; height:48px; background:#dbeafe; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.partner-avatar svg { width:24px; height:24px; color:var(--primary); }
.partner-id { font-weight:600; }
.verified-dot { width:8px; height:8px; border-radius:50%; background:#d1d5db; display:inline-block; }
.verified-dot.verified { background:var(--success); }
.card { background:var(--card); border:1px solid var(--border); border-radius:8px; padding:16px; }
.card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin-bottom:16px; }
.stat-card { text-align:center; }
.stat-value { font-size:28px; font-weight:700; color:var(--primary); }
.stat-label { font-size:13px; color:var(--text-muted); }
.queue-item { padding:16px; border:1px solid var(--border); border-radius:8px; margin-bottom:12px; cursor:pointer; }
.queue-item:hover { box-shadow:0 4px 12px rgba(0,0,0,0.1); }
.queue-item.critical { border-left:4px solid var(--critical); }
.queue-item.high { border-left:4px solid var(--danger); }
.btn { padding:10px 20px; border:none; border-radius:6px; font-size:14px; font-weight:500; cursor:pointer; }
.btn-primary { background:var(--primary); color:white; }
.btn-primary:hover { background:#1e3a8a; }
.btn-success { background:var(--success); color:white; }
.btn-danger { background:var(--danger); color:white; }
.btn-secondary { background:#e5e7eb; color:var(--text); }
.action-buttons { display:flex; gap:12px; flex-wrap:wrap; }
.action-btn { padding:10px 16px; border:1px solid var(--border); border-radius:6px; background:white; cursor:pointer; font-size:14px; display:flex; align-items:center; gap:8px; }
.action-btn:hover { background:#f9fafb; }
.bottom-actions { display:flex; justify-content:center; gap:16px; margin-top:24px; padding:16px 0; }
.modal-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.5); display:none; align-items:center; justify-content:center; z-index:1000; }
.modal-overlay.active { display:flex; }
.modal { background:white; border-radius:12px; width:90%; max-width:500px; max-height:90vh; overflow:auto; }
.modal-header { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.modal-body { padding:20px; }
.modal-footer { padding:16px 20px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:12px; }
.summary-row { display:flex; gap:24px; padding:12px 16px; background:#f9fafb; border-radius:6px; margin-top:12px; font-size:14px; }
.line-item { padding:12px; border:1px solid var(--border); border-radius:6px; margin-bottom:8px; }
.line-item-grid { display:grid; grid-template-columns:2fr 1fr 80px 1fr 80px 1fr 40px; gap:8px; align-items:center; }
.line-item-grid input,.line-item-grid select { padding:6px 8px; font-size:13px; }
@media (max-width:768px) { .line-item-grid { grid-template-columns:1fr 1fr; } .tabs { flex-wrap:wrap; } .tab { flex:1; text-align:center; } }

/* ─────────────────────────────────────────────────────────────────────────────
   PWA-specific styles (app shell, loading, offline notice)
   ───────────────────────────────────────────────────────────────────────────── */

.app-shell-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  flex-direction: column;
  gap: 16px;
}

.app-shell-loading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.offline-notice {
  background: #fef3c7;
  color: #92400e;
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  display: none;
}

.offline-notice.active {
  display: block;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
}

.nav-bar a {
  color: white;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
}

.nav-bar a:hover {
  background: rgba(255,255,255,0.15);
}

.nav-bar .nav-brand {
  font-weight: 700;
  font-size: 16px;
}

.nav-bar .nav-user {
  font-size: 13px;
  opacity: 0.9;
}
