

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* Prevents iOS font size inflation when rotating to landscape */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #F5F5F5;
  /* Accounts for notched iPhones (X and later) */
  padding-left:  env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ── HEADER ─────────────────────────────────────────────────── */
header {
    background: #FFD503;
    color: #28332C;
    padding: 16px 20px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .header-title { flex: 1; text-align: center; }

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: normal;
  background: rgba(255,255,255,0.12);
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
}

#user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pill .avatar {
  width: 28px; height: 28px;
  background: #FFC20E;
  color: #003B6F;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 0.7rem;
  flex-shrink: 0;
}

.sign-out-btn {
    background: none;
    border: 1px solid #28332C;
    color: #28332C;
    padding: 6px 12px;
    /* Minimum 44px touch target height */
    min-height: 44px;
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: 4px;
    font-family: Arial, Helvetica, sans-serif;
    transition: background 0.15s;
    white-space: nowrap;
}
.sign-out-btn:hover  { background: rgba(255,255,255,0.15); }
.sign-out-btn:active { background: rgba(255,255,255,0.25); }

/* ── DEV BANNER ─────────────────────────────────────────────── */
#dev-banner {
  display: none;
  background: #FFC20E;
  color: #003B6F;
  text-align: center;
  font-size: 0.78rem;
  font-weight: bold;
  padding: 6px;
  letter-spacing: 0.03em;
}

/* ── LOGIN SCREEN ────────────────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  /* dvh (dynamic viewport height) accounts for mobile browser chrome.
     Falls back to -webkit-fill-available then 100vh for older browsers */
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  min-height: calc(100vh - 80px);
  padding: 20px;
}

.login-card {
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  padding: 40px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.login-card h2 { color: #003B6F; margin-bottom: 10px; font-size: 1.4rem; }
.login-card p  { color: #666; font-size: 0.9rem; margin-bottom: 28px; line-height: 1.5; }

.sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  min-height: 44px;
  background: #003B6F;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.sso-btn:hover  { background: #002B4F; }
.sso-btn:active { background: #001F3A; }
.sso-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── APP SCREEN ──────────────────────────────────────────────── */
#app-screen { display: none; }

.container {
  max-width: 800px;
  margin: 30px auto;
  background: #FFFFFF;
  padding: 28px 32px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

    .container h2 {
        color: #28332C;
        margin-top: 0;
        margin-bottom: 4px;
        font-size: 1.3rem;
    }
.container .subtitle { color: #666; font-size: 0.85rem; margin-bottom: 8px; }

/* ── FORM FIELDS ─────────────────────────────────────────────── */
label {
    display: block;
    margin-top: 20px;
    font-weight: bold;
    color: #28332C;
    font-size: 0.95rem;
}
label .req { color: #c0392b; margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #C9C9C9;
  border-radius: 6px;
  margin-top: 6px;
  /* 16px minimum prevents iOS Safari auto-zoom when field is tapped */
  font-size: 16px;
  font-family: Arial, Helvetica, sans-serif;
  transition: border-color 0.15s;
  background: #fff;
  /* Removes inner shadow on iOS inputs */
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  outline: none;
  border-color: #003B6F;
}

input.error, textarea.error { border-color: #c0392b; }

.field-error {
  font-size: 0.78rem;
  color: #c0392b;
  display: none;
  margin-top: 4px;
}
.field-error.show { display: block; }

textarea { height: 120px; resize: vertical; }

/* ── VOICE BUTTONS ───────────────────────────────────────────── */
.voice-btn {
    background: #28332C;
    border: 2px solid #C9C9C9;
    /* 44px min height for touch targets */
    padding: 12px 16px;
    min-height: 44px;
    margin-top: 8px;
    cursor: pointer;
    border-radius: 5px;
    color: #FFD503;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.voice-btn:hover  { opacity: 0.85; }
.voice-btn:active { opacity: 0.7;  }
.voice-btn.recording {
  background: #e63946;
  color: #fff;
  animation: pulseBorder 1.2s ease-in-out infinite;
}

@keyframes pulseBorder {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230,57,70,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(230,57,70,0); }
}

.voice-status {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #e63946;
  font-weight: bold;
  margin-top: 4px;
}
.voice-status.show { display: flex; }

.voice-dot {
  width: 8px; height: 8px;
  background: #e63946;
  border-radius: 50%;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

.voice-note { font-size: 0.75rem; color: #888; margin-top: 3px; }

/* ── PHOTO UPLOAD ────────────────────────────────────────────── */
.image-box { margin-top: 18px; }

input[type="file"] {
  margin-top: 6px;
  font-size: 0.9rem;
  font-family: Arial, Helvetica, sans-serif;
}

.drop-zone {
  border: 2px dashed #C9C9C9;
  border-radius: 6px;
  padding: 20px 16px;
  text-align: center;
  margin-top: 6px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  background: #fafafa;
  /* Comfortable tap area on mobile */
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: #003B6F;
  background: #f0f5ff;
}
.drop-zone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%; margin: 0;
}
.drop-zone-text {
    color: #28332C;
    font-size: 0.88rem;
    pointer-events: none;
}
    .drop-zone-text strong {
        color: #28332C;
    }

.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.photo-thumb {
  position: relative;
  width: 90px; height: 90px;
  border: 1px solid #DDD;
  border-radius: 6px;
  overflow: hidden;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border: none; padding: 0; }

.photo-remove {
  position: absolute; top: 3px; right: 3px;
  /* 28px to be tappable on mobile */
  width: 28px; height: 28px;
  background: rgba(0,0,0,0.65);
  color: #fff; border: none; border-radius: 50%;
  cursor: pointer; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.photo-thumb:hover .photo-remove { opacity: 1; }
/* Always visible on touch devices — no hover state */
@media (hover: none) { .photo-remove { opacity: 1; } }

.attach-count { font-size: 0.8rem; color: #666; margin-top: 6px; }

/* ── SUBMIT BUTTON ───────────────────────────────────────────── */
.submit-btn {
    background: #FFD503;
    color: #28332C;
    border: none;
    padding: 16px 22px;
    min-height: 52px;
    font-size: 1.1rem;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    margin-top: 28px;
    cursor: pointer;
    width: 100%;
    border-radius: 6px;
    border: 2px solid #C9C9C9;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
}
.submit-btn:hover:not(:disabled)  { background: #002B4F; }
.submit-btn:active:not(:disabled) { background: #001F3A; }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.submit-btn .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.submit-btn.loading .spinner { display: block; }
.submit-btn.loading .btn-text { display: none; }

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

/* ── TOAST NOTIFICATION ──────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  right: 24px;
  left: 24px;
  background: #003B6F; color: #fff;
  padding: 14px 18px; border-radius: 6px;
  font-size: 0.9rem;
  opacity: 0; transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none; z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
#toast.show    { opacity: 1; transform: translateY(0); pointer-events: auto; }
#toast.success { background: #1a7a4a; }
#toast.error   { background: #c0392b; }
#toast svg     { width: 18px; height: 18px; flex-shrink: 0; }


/* ── SELECT / DROPDOWN ───────────────────────────────────────── */
.select-wrapper {
  position: relative;
  margin-top: 6px;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #003B6F;
  pointer-events: none;
}

select {
  width: 100%;
  padding: 12px 36px 12px 12px;
  border: 2px solid #C9C9C9;
  border-radius: 6px;
  /* 16px prevents iOS auto-zoom */
  font-size: 16px;
  font-family: Arial, Helvetica, sans-serif;
  background: #fff;
  color: #0a0a0f;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
  /* Minimum tap target */
  min-height: 44px;
}

select:focus {
  outline: none;
  border-color: #003B6F;
}

select:disabled {
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

select.error  { border-color: #c0392b; }
select option[value=""] { color: #999; }

/* ── TABLET (641px – 1024px) ─────────────────────────────────── */
@media (min-width: 641px) and (max-width: 1024px) {
  .container {
    margin: 24px;
    padding: 28px 28px;
  }
  header { font-size: 1.3rem; }
}

/* ── MOBILE (max 640px) ──────────────────────────────────────── */
@media (max-width: 640px) {
  header {
    font-size: 1rem;
    padding: 12px 16px;
    padding-left:  max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    gap: 6px;
  }

  /* On small phones collapse user name, show initials only */
  #user-name    { display: none; }
  .user-pill    { padding: 4px 8px; }
  .sign-out-btn { padding: 6px 10px; font-size: 0.78rem; }

  .container {
    margin: 12px;
    padding: 20px 16px;
    /* Bottom padding accounts for notch / home indicator */
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    border-radius: 6px;
  }

  /* Slightly larger photo thumbs so they're easier to tap */
  .photo-thumb { width: 80px; height: 80px; }

  /* Toast spans full width on mobile */
  #toast {
    left:  max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    font-size: 0.85rem;
  }

  .submit-btn { font-size: 1rem; }
}

/* ── LANDSCAPE MOBILE ────────────────────────────────────────── */
@media (max-width: 640px) and (orientation: landscape) {
  header { padding-top: 8px; padding-bottom: 8px; }
  .container { margin: 8px 12px; }
}

/* ── REFERENCE NUMBER LOOKUP ─────────────────────────────────── */

.lookup-wrapper-placeholder { display: none; } /* replaced by lookup button section below */

/* Inline spinner shown while the account lookup is in flight */
.lookup-spinner {
  display: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  border: 2px solid #C9C9C9;
  border-top-color: #003B6F;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  pointer-events: none;
}
.lookup-spinner.show { display: block; }

/* Status line below the Reference Number field */
.lookup-status {
  font-size: 0.78rem;
  margin-top: 4px;
  min-height: 18px;
  font-weight: bold;
}
.lookup-status.found    { color: #1a7a4a; }
.lookup-status.not-found { color: #c0392b; }
.lookup-status:empty {display:none;}



/* ── LOADING SCREEN ──────────────────────────────────────────── */
#loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
}

.loading-spinner {
  width: 48px; height: 48px;
  border: 4px solid #e0e0e0;
  border-top-color: #003B6F;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── MOBILE UPLOAD BUTTONS ───────────────────────────────────── */

/* Desktop — hide mobile buttons, show drop zone */
.mobile-upload-btns { display: none; }

/* Mobile — hide drop zone, show buttons */
@media (max-width: 640px),(pointer: coarse) {
  .drop-zone          { display: none; }
  .mobile-upload-btns {
    display: flex;
    gap: 10px;
    margin-top: 8px;
  }
}

.upload-btn {
  flex: 1;
  padding: 14px 10px;
  min-height: 52px;
  border: none;
  border-radius: 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}

.upload-btn-camera {
    background: #28332C;
    color: #FFD503;
    border: 2px solid #C9C9C9;
}
    .upload-btn-camera:active {
        background: #28332C;
    }

.teams-upload .upload-btn-camera {
    flex: 0 0 auto;
    display: inline-flex;
    padding: 12px 16px;
    width: auto;

}

.upload-btn-gallery {
    background: #28332C;
    color: #FFD503;
    border: 2px solid #C9C9C9;
}
    .upload-btn-gallery:active {
        background: #28332C;
    }

/* ── REFERENCE NUMBER LOOKUP BUTTON ─────────────────────────── */

/* Flexbox row — input stretches, button is fixed width, attached right */
.lookup-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-top: 6px;
}

.lookup-wrapper input {
  flex: 1;
  margin-top: 0;
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding-right: 36px; /* room for spinner inside input */
}

.lookup-wrapper input:focus {
  border-color: #003B6F;
  /* also colour the button border on focus */
}

.lookup-btn {
    flex-shrink: 0;
    width: 48px;
    min-height: 44px;
    background: #28332C;
    color: #fff;
    border: 2px solid #28332C;
    border-left: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.lookup-btn:hover  { background: #002B4F; border-color: #002B4F; }
.lookup-btn:active { background: #001F3A; border-color: #001F3A; }

/* Spinner stays inside the input on the right */
.lookup-wrapper .lookup-spinner {
  right: 56px; /* clear of the button */
}
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 20px;
}

.confirm-box {
    background: #fff;
    border-radius: 8px;
    padding: 28px 28px 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

    .confirm-box p {
        color: #003B6F;
        font-size: 1rem;
        line-height: 1.5;
        margin: 0 0 24px;
        font-weight: bold;
    }

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 10px 22px;
    min-height: 44px;
    border-radius: 6px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

.confirm-btn-primary {
    background: #003B6F;
    color: #fff;
}

    .confirm-btn-primary:hover {
        background: #002B4F;
    }

.confirm-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.confirm-btn-secondary:hover {
        background: #e0e0e0; 

}

/* ── COMPANY SEARCH DROPDOWN ─────────────────────────────── */

.company-search-wrapper {
    position: relative;
    margin-top: 4px;
}

.company-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #003B6F;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
}

.company-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
    min-height: 44px;
}

.company-dropdown-item:last-child {
        border-bottom: none;
}

.company-dropdown-item:hover {
        background: #f0f5ff;
}

.company-dropdown-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.company-name {
    font-size: 0.95rem;
    font-weight: bold;
    color: #28332C;
}

.company-addr {
    font-size: 0.78rem;
    color: #888;
}

.company-badge {
    font-size: 0.68rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.company-badge-salesforce {
    background: #e8f0fe;
    color: #003B6F;
}

.customer-request-wrapper {
    margin-top: 16px;
    margin-bottom: 4px;
}

.customer-request-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #28332C;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 0;
}

.customer-request-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: #003B6F;
        flex-shrink: 0;
}

/* ── VIEW LEADS PANEL ────────────────────────────────────── */

.view-leads-btn {
    background: none;
    border: 1px solid #28332C;
    color: #28332C;
    padding: 6px 12px;
    min-height: 44px;
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: 4px;
    font-family: Arial, Helvetica, sans-serif;
    transition: background 0.15s;
    white-space: nowrap;
}

    .view-leads-btn:hover {
        background: rgba(255,255,255,0.15);
    }

    .view-leads-btn:active {
        background: rgba(255,255,255,0.25);
    }

.leads-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
}

.leads-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 640px;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

    .leads-panel.open {
        transform: translateX(0);
    }

        .leads-panel.open ~ .leads-overlay {
            display: block;
        }

.leads-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #FFD503;
    color: #28332C;
    flex-shrink: 0;
}

    .leads-panel-header h2 {
        font-size: 1.1rem;
        margin: 0;
        color: #28332C;
    }

.leads-close-btn {
    background: none;
    border: none;
    color: #28332C;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

    .leads-close-btn:hover {
        background: rgba(255,255,255,0.15);
    }

.leads-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #666;
    font-size: 0.9rem;
}

.spinner-ring {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #003B6F;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.leads-table-wrapper {
    flex: 1;
    overflow-y: auto;
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

    .leads-table th {
        background: #f5f5f5;
        color: #28332C;
        font-weight: bold;
        padding: 12px 16px;
        text-align: left;
        border-bottom: 2px solid #e0e0e0;
        position: sticky;
        top: 0;
    }

    .leads-table td {
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
        color: #333;
        vertical-align: middle;
    }

    .leads-table tr:last-child td {
        border-bottom: none;
    }

    .leads-table tr:hover td {
        background: #f9f9f9;
    }

.lead-status-badge {
    background: #e8f0fe;
    color: #003B6F;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
    display: inline-block;
}

.lead-status-won {
    background: #d4edda;
    color: #1a7a4a;
}

.lead-status-lost {
    background: #f8d7da;
    color: #c0392b;
}

.lead-status-opportunity {
    background: #fff3cd;
    color: #856404;
}

.opp-progress-track {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.opp-progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.opp-progress-label {
    font-size: 0.65rem;
    color: #888;
    margin-top: 2px;
}

.leads-empty {
    text-align: center;
    color: #888;
    padding: 40px 16px;
    font-size: 0.9rem;
}

/* ── LEADS SUMMARY ───────────────────────────────────────── */

.leads-summary {
    flex-shrink: 0;
    padding: 16px 24px 24px;
    border-top: 2px solid #f0f0f0;
    background: #fff;
}

.leads-summary-header {
    font-size: 0.78rem;
    color: #888;
    text-align: center;
    margin-bottom: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leads-summary-cards {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.summary-card {
    flex: 1;
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.summary-card-won {
    background: linear-gradient(135deg, #d4edda, #a8d5b5);
    border: 1px solid #82c99a;
}

.summary-card-progress {
    background: linear-gradient(135deg, #e8f0fe, #c5d8fb);
    border: 1px solid #93b8f7;
}

.summary-card-lost {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #ced4da;
}

.summary-card-emoji {
    font-size: 1.6rem;
    line-height: 1;
}

.summary-card-count {
    font-size: 1.8rem;
    font-weight: bold;
    color: #003B6F;
    line-height: 1;
}

.summary-card-label {
    font-size: 0.75rem;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-card-pct {
    font-size: 0.7rem;
    color: #1a7a4a;
    font-weight: bold;
    margin-top: 2px;
}

.leads-achievement {
    margin-top: 12px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: bold;
    color: #1a7a4a;
    background: #d4edda;
    border-radius: 6px;
    padding: 8px 12px;
}

.leads-achievement-neutral {
    color: #003B6F;
    background: #e8f0fe;
}

@media (max-width: 640px) {
    .leads-panel {
        max-width: 100%;
    }
}

@media (max-width: 360px) {
    .leads-summary {
        padding: 10px 12px 16px;
    }

    .leads-summary-cards {
        gap: 6px;
    }

    .summary-card {
        padding: 10px 6px;
        border-radius: 8px;
    }

    .summary-card-emoji {
        font-size: 1.2rem;
    }

    .summary-card-count {
        font-size: 1.4rem;
    }

    .summary-card-label {
        font-size: 0.65rem;
    }

    .summary-card-pct {
        font-size: 0.6rem;
    }

    .leads-summary-header {
        font-size: 0.68rem;
        margin-bottom: 8px;
    }

    .leads-achievement {
        font-size: 0.72rem;
        padding: 6px 10px;
        margin-top: 8px;
    }

    .leads-table {
        font-size: 0.78rem;
    }

        .leads-table th,
        .leads-table td {
            padding: 8px 8px;
        }
}