/* LIT CRM - Base styles (Phase 1 Foundation)
   Lightweight, framework-free CSS.
*/

:root{
  --primary: #2bb59b;
  --primary-dark: #1f9d86;
  --primary-soft: rgba(43,181,155,.12);
  --accent: #6f63ff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: rgba(17,24,39,.10);
  --shadow: 0 10px 30px rgba(17,24,39,.08);
  --shadow-soft: 0 8px 18px rgba(17,24,39,.06);
  --radius: 14px;
  --bg: #f5f7fb;
  --white: #ffffff;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background: #fff;
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

/* Short ID link (sale/employee IDs) */
.id-link{
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}

img{ max-width: 100%; height: auto; }

button, input, select{
  font: inherit;
}

.btn{
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: transform .05s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 28px rgba(43,181,155,.25);
}
.btn-primary:hover{ background: var(--primary-dark); }

/* Destructive button (used in modals / admin actions) */
.btn-danger{
  background: rgba(239, 68, 68, 1);
  color: #fff;
  box-shadow: 0 14px 28px rgba(239, 68, 68, .18);
}
.btn-danger:hover{ background: rgba(220, 38, 38, 1); }

.btn-ghost{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

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

/* Small button variant (used for table row actions) */
.btn-sm{
  padding: .38rem .65rem;
  font-size: .78rem;
  border-radius: 10px;
}

/* Simple tab buttons (pipeline bucket tabs) */
.tabbar{
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-tab{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-tab.active{
  background: rgba(43,181,155,.12);
  border-color: rgba(43,181,155,.35);
  color: var(--primary-dark);
}


.badge{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .22rem .55rem;
  font-size: .75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255,255,255,.8);
}

/* Warning badge (used for Agent Mismatch indicators) */
.badge-warn{
  border-color: rgba(234, 179, 8, .55);
  color: rgba(146, 64, 14, 1);
  background: rgba(254, 243, 199, .92);
}

/* Success badge */
.badge-success{
  border-color: rgba(34, 197, 94, .45);
  color: rgba(21, 128, 61, 1);
  background: rgba(220, 252, 231, .92);
}

/* Danger badge */
.badge-danger{
  border-color: rgba(239, 68, 68, .45);
  color: rgba(153, 27, 27, 1);
  background: rgba(254, 226, 226, .92);
}

.card{
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.input{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .9rem 1rem;
  background: rgba(249, 250, 251, 1);
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.input:focus{
  border-color: rgba(43,181,155,.6);
  box-shadow: 0 0 0 5px rgba(43,181,155,.12);
}

.small{ font-size: .9rem; }
.muted{ color: var(--muted); }

.hr{
  height: 1px;
  background: var(--border);
  border: none;
  margin: 0;
}

.toast{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  background: rgba(17,24,39,.92);
  color: #fff;
  padding: .8rem 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
  max-width: min(420px, calc(100vw - 36px));
}
.toast.show{ display: block; }

/* Simple alerts (shared across pages) */
.alert{
  padding: .85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(239,68,68,.28);
  background: rgba(239,68,68,.10);
  color: rgba(239,68,68,1);
}
.alert-success{
  border-color: rgba(16,185,129,.25);
  background: rgba(16,185,129,.10);
  color: rgba(16,185,129,1);
}
.alert-warning{
  border-color: rgba(245,158,11,.28);
  background: rgba(245,158,11,.10);
  color: rgba(180,83,9,1);
}

/* Back-compat alias used by a few pages */
.login-error{
  padding: .85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(239,68,68,.28);
  background: rgba(239,68,68,.10);
  color: rgba(239,68,68,1);
}

/* Reusable modal component */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.modal.show{ display: flex; }
.modal-overlay{
  position: absolute;
  inset: 0;
  background: rgba(17,24,39,.55);
  backdrop-filter: blur(3px);
}
.modal-dialog{
  position: relative;
  z-index: 1;
  width: min(720px, calc(100vw - 40px));
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(17,24,39,.22);
  border: 1px solid rgba(17,24,39,.10);
  padding: 18px;
}

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; scroll-behavior: auto !important; }
}
