/* =====================================================
   PUNEWALA CRM+ERP — SAP FIORI STYLE (fast & flat)
   Same class names as before — every page uses this automatically.
   No heavy blur/gradients — built for speed.
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
  --primary: #0070F2;
  --primary-dark: #0040D0;
  --navy: #1D2D3E;
  --navy-light: #29394D;
  --bg: #F5F6F7;
  --card-bg: #ffffff;
  --text: #1A2733;
  --muted: #6A7787;
  --success: #107E3E;
  --success-bg: #E8F6EE;
  --danger: #B00;
  --danger-bg: #FDECEC;
  --warning: #E9730C;
  --warning-bg: #FEF3E6;
  --border: #D9DDE1;
  --sidebar-bg: #1D2D3E;
  --sidebar-text: #C9D3DC;
  --sidebar-active: #0070F2;
  --radius: 6px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "72", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
/* ============ LOGIN (fallback pages) ============ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--primary) 100%);
}
.login-card {
  background: var(--card-bg);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 380px;
}
.login-card h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; text-align: center; color: var(--navy); }
.login-card p.sub { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: 13px; }
label { font-size: 12.5px; font-weight: 600; display:block; margin-bottom: 6px; margin-top: 14px; color: var(--navy); }
input, select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
button, .btn {
  cursor: pointer;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-secondary { background: #fff; color: var(--navy); border: 1px solid var(--border); }
/* ============ TOP NAV ============ */
.top-nav {
  background: var(--card-bg);
  padding: 0 24px;
  height: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.top-nav .brand { font-weight: 700; color: var(--navy); font-size: 16px; }
.layout { display: flex; min-height: calc(100vh - 52px); }
/* ============ SIDEBAR — flat SAP Fiori navy ============ */
.sidebar {
  width: 224px;
  background: var(--sidebar-bg);
  padding: 12px 0;
  flex-shrink: 0;
}
.sidebar a {
  display: block;
  padding: 8px 22px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.sidebar a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar a.active {
  background: rgba(0,112,242,0.18);
  color: #fff;
  border-left-color: var(--sidebar-active);
  font-weight: 700;
}
.content { flex: 1; padding: 24px 28px; max-width: 1400px; }
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px 22px;
  margin-bottom: 18px;
}
h2 { font-size: 19px; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
h3 { font-size: 14.5px; font-weight: 700; color: var(--navy); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 11px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: #F0F3F6; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
tbody tr:hover { background: #F7F9FB; }
.badge { padding: 2px 10px; border-radius: 3px; font-size: 11.5px; font-weight: 700; }
.badge-open { background: #E6F2FD; color: var(--primary); }
.badge-converted { background: var(--success-bg); color: var(--success); }
.badge-lost { background: var(--danger-bg); color: var(--danger); }
.error-msg { background: var(--danger-bg); color: var(--danger); padding: 10px 13px; border-radius: 4px; margin-bottom: 12px; font-size: 13px; border-left: 3px solid var(--danger); }
.success-msg { background: var(--success-bg); color: var(--success); padding: 10px 13px; border-radius: 4px; margin-bottom: 12px; font-size: 13px; border-left: 3px solid var(--success); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 16px 18px;
  border-radius: var(--radius);
  border-top: 3px solid var(--primary);
}
.stat-box .num { font-size: 24px; font-weight: 700; color: var(--navy); }
.stat-box .label { font-size: 11px; color: var(--muted); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.02em; font-weight: 600; }
.tenant-tag { display:inline-block; background: rgba(0,112,242,0.1); color: var(--primary); padding: 2px 10px; border-radius: 3px; font-size: 11px; font-weight: 700; margin-left: 8px; }
.nav-section-label { padding: 16px 22px 5px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.35); }
.nav-toggle { cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding-right: 18px; }
.nav-toggle:hover { color: rgba(255,255,255,0.6); }
.nav-toggle span { display: flex; align-items: center; gap: 7px; }
.nav-chevron { transition: transform 0.2s ease; font-size: 13px; }
.nav-chevron.collapsed { transform: rotate(-90deg); }
.nav-group { overflow: hidden; max-height: 2000px; transition: max-height 0.25s ease; }
.nav-group.collapsed { max-height: 0; }
.sidebar a i { width: 16px; text-align: center; margin-right: 2px; }
.dashboard-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dashboard-panel { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px 22px; }
.dashboard-panel h3 { margin-top: 0; }
.panel-tag-crm { display: inline-block; background: #E6F2FD; color: var(--primary); padding: 2px 10px; border-radius: 3px; font-size: 10px; font-weight: 800; margin-bottom: 10px; text-transform: uppercase; }
.panel-tag-erp { display: inline-block; background: var(--warning-bg); color: var(--warning); padding: 2px 10px; border-radius: 3px; font-size: 10px; font-weight: 800; margin-bottom: 10px; text-transform: uppercase; }
@media (max-width: 800px) { .dashboard-split { grid-template-columns: 1fr; } }
/* App view ONLY (installed PWA/APK) — bigger text so app users don't need
   to zoom in. The regular website (browser, mobile or desktop) is
   completely UNCHANGED — this only fires when opened as the installed app. */
@media (display-mode: standalone) {
  body { font-size: 16px; }
  h2 { font-size: 22px; }
  h3 { font-size: 17px; }
  table { font-size: 15px; }
  th { font-size: 12.5px; }
  label { font-size: 14px; }
  input, select, textarea { font-size: 15px !important; }
  .btn, button { font-size: 15px !important; padding: 10px 16px !important; }
  .badge { font-size: 13px; }
  .sidebar a { font-size: 15px; }
  .nav-section-label { font-size: 12px; }
  .stat-box .num { font-size: 28px; }
  .stat-box .label { font-size: 12.5px; }
  .success-msg, .error-msg { font-size: 15px; }
}
.checkbox-row { display:flex; align-items:center; gap:8px; margin-top:12px; }
.checkbox-row input { width:auto; }
/* =====================================================
   MINIMAL, FAST TRANSITIONS ONLY — no heavy keyframes,
   no per-row stagger delays, no blur. Kept snappy like SAP.
   ===================================================== */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
button, .btn, .card, .stat-box, input, select, textarea, .badge, .sidebar a {
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
button:active, .btn:active { transform: translateY(1px); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0,112,242,0.15);
}
.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(0,112,242,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
.skeleton {
  background: linear-gradient(90deg, #eee 0px, #f5f5f5 40px, #eee 80px);
  background-size: 600px;
  animation: shimmer 1.4s infinite linear;
  border-radius: 4px;
}
.progress-track { background: #E9ECEF; border-radius: 10px; overflow: hidden; height: 7px; width: 100%; }
.progress-fill { height: 100%; border-radius: 10px; background: var(--primary); transition: width 0.4s ease; width: 0%; }
