/* =========================================================
   SALES CRM — RESPONSIVE / MOBILE-FIRST UI
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
overflow: hidden;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;

  background: #f5f7fb;
  color: #202124;

  overflow-x: hidden;

  -webkit-font-smoothing: antialiased;
}


/* =========================================================
   HEADER
   ========================================================= */

.header {
  min-height: 64px;

  background: #1a73e8;
  color: white;

  padding:
    0 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;

  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  margin: 0;

  font-size: 21px;
  font-weight: 700;

  white-space: nowrap;
}

.user {
  margin-left: auto;

  font-size: 13px;

  opacity: .9;

  max-width: 260px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* =========================================================
   LOGOUT
   ========================================================= */

.logout-sbutton {
  min-height: 42px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  padding: 8px 13px;

  border: 1px solid rgba(255,255,255,.3);
  border-radius: 9px;

  background: rgba(255,255,255,.12);

  color: white;

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;

  transition: .2s ease;
}

.logout-sbutton:hover {
  background: rgba(255,255,255,.2);
}

.logout-icon {
  font-size: 18px;
}


/* =========================================================
   MAIN CONTAINER
   ========================================================= */

.container {
  width: 100%;
  max-width: 1400px;

  margin: 0 auto;

  padding: 24px;
}


/* =========================================================
   DASHBOARD CARDS
   ========================================================= */

.cards {
  display: grid;

  grid-template-columns:
    repeat(8, minmax(0, 1fr));

  gap: 14px;

  margin-bottom: 24px;
}

.card {
  min-width: 0;

  background: white;

  border-radius: 14px;

  padding: 17px;

  box-shadow:
    0 2px 8px rgba(0,0,0,.06);

  border: 1px solid #eef0f4;
}

.card-title {
  color: #6b7280;

  font-size: 12px;
  font-weight: 600;

  line-height: 1.35;
}

.card-number {
  margin-top: 7px;

  font-size: 27px;
  line-height: 1;

  font-weight: 750;

  color: #111827;
}


/* =========================================================
   FOLLOW UP CARDS
   ========================================================= */

.followup-card {
  cursor: pointer;

  transition:
    transform .15s ease,
    box-shadow .15s ease;
}

.followup-card:hover {
  transform: translateY(-2px);

  box-shadow:
    0 5px 18px rgba(0,0,0,.1);
}

.followup-card:active {
  transform: scale(.98);
}


/* =========================================================
   SECTION
   ========================================================= */

.section {
  width: 100%;

  background: white;

  border-radius: 14px;

  padding: 20px;

  box-shadow:
    0 2px 8px rgba(0,0,0,.06);

  border: 1px solid #eef0f4;

  overflow: hidden;
}

.section h2 {
  margin: 0;

  font-size: 20px;
}


/* =========================================================
   LEAD HEADER
   ========================================================= */

.lead-filters {
  display: flex;

  align-items: center;

  gap: 8px;

  margin-bottom: 14px;

  width: 100%;
}

.lead-filters input,
.lead-filters select {
  min-height: 42px;

  padding: 9px 11px;

  border:
    1px solid #d8dce3;

  border-radius: 9px;

  background: white;

  color: #202124;

  font-size: 14px;

  outline: none;
}

.lead-filters input {
  flex: 1;

  min-width: 180px;
}

.lead-filters input:focus,
.lead-filters select:focus {
  border-color: #1a73e8;

  box-shadow:
    0 0 0 3px rgba(26,115,232,.1);
}


/* =========================================================
   BUTTONS
   ========================================================= */

.button,
.assign-button,
.activity-button,
.history-button,
.cancel-button,
.activity-save-button {
  min-height: 40px;

  border: none;

  border-radius: 8px;

  padding: 8px 13px;

  font-size: 13px;

  font-weight: 600;

  cursor: pointer;

  white-space: nowrap;

  transition:
    background .15s ease,
    transform .1s ease;
}

.button,
.assign-button {
  background: #1a73e8;
  color: white;
}

.button:hover,
.assign-button:hover {
  background: #1557b0;
}

.activity-button {
  background: #34a853;
  color: white;
}

.activity-button:hover {
  background: #2d8e47;
}

.history-button {
  background: #fbbc04;
  color: #202124;
}

.history-button:hover {
  background: #e2a900;
}

.cancel-button {
  background: #eef0f3;
  color: #374151;
}

.cancel-button:hover {
  background: #e2e5e9;
}

.activity-save-button {
  background: #34a853;
  color: white;
}

.activity-save-button:hover {
  background: #2d8e47;
}

.button:active,
.assign-button:active,
.activity-button:active,
.history-button:active,
.cancel-button:active {
  transform: scale(.97);
}


/* =========================================================
   TABLE — DESKTOP
   ========================================================= */

table {
  width: 100%;

  border-collapse: collapse;
}

th {
  background: #f7f8fa;

  text-align: left;

  padding: 12px;

  font-size: 12px;

  font-weight: 700;

  color: #5f6368;

  white-space: nowrap;
}

td {
  padding: 12px;

  border-bottom:
    1px solid #edf0f3;

  font-size: 13px;

  vertical-align: middle;
}


/* =========================================================
   STAGE
   ========================================================= */

.stage {
  display: inline-flex;

  align-items: center;

  min-height: 27px;

  padding: 4px 9px;

  border-radius: 20px;

  background: #e8f0fe;

  color: #1967d2;

  font-size: 11px;

  font-weight: 650;

  white-space: nowrap;
}

.stage-select {
  min-height: 38px;

  padding: 7px 9px;

  border:
    1px solid #dadce0;

  border-radius: 8px;

  background: white;

  color: #202124;

  cursor: pointer;

  font-size: 13px;
}

.stage-select:focus {
  outline: none;

  border-color: #1a73e8;

  box-shadow:
    0 0 0 3px rgba(26,115,232,.1);
}


/* =========================================================
   LEAD NAME
   ========================================================= */

.lead-name-button {
  background: none;

  border: none;

  padding: 0;

  color: #1967d2;

  font-weight: 700;

  cursor: pointer;

  font-size: 13px;

  text-align: left;
}

.lead-name-button:hover {
  text-decoration: underline;
}


/* =========================================================
   EMPTY / ERROR
   ========================================================= */

.empty {
  text-align: center;

  padding: 40px 20px;

  color: #777;
}

.error {
  background: #fce8e6;

  color: #c5221f;

  padding: 15px;

  border-radius: 9px;

  font-size: 14px;
}


/* =========================================================
   MODALS — DESKTOP
   ========================================================= */

.modal {
  display: none;

  position: fixed;

  z-index: 1000;

  inset: 0;

  width: 100%;
  height: 100%;

  background:
    rgba(15,23,42,.48);

  padding: 20px;

  overflow-y: auto;

  overscroll-behavior: contain;
}

.modal-content {
  background: white;

  width: 400px;

  max-width: 100%;

  margin: 80px auto;

  padding: 24px;

  border-radius: 14px;

  box-shadow:
    0 20px 60px rgba(0,0,0,.2);

  position: relative;
}

.modal-content h2 {
  margin-top: 0;

  font-size: 20px;
}

.modal-content select,
.modal-content input,
.modal-content textarea {
  font-family: inherit;
}


/* =========================================================
   MODAL BUTTONS
   ========================================================= */

.modal-buttons {
  display: flex;

  justify-content: flex-end;

  align-items: center;

  gap: 8px;
}


/* =========================================================
   HISTORY
   ========================================================= */

.history-content {
  max-height: 55vh;

  overflow-y: auto;

  padding-right: 6px;
}


/* =========================================================
   LEAD DETAILS
   ========================================================= */

.lead-details-modal {
  width: 550px;

  max-width: 100%;

  max-height: 85vh;

  overflow-y: auto;

  position: relative;

  z-index: 1001;
}

.lead-detail-row {
  padding: 11px 0;

  border-bottom:
    1px solid #edf0f3;
}

.lead-detail-label {
  color: #777;

  font-size: 11px;

  font-weight: 600;

  margin-bottom: 4px;
}

.lead-detail-value {
  font-size: 14px;

  color: #202124;

  line-height: 1.45;

  word-break: break-word;
}


/* =========================================================
   EDIT FIELDS
   ========================================================= */

.lead-edit-field {
  margin-bottom: 14px;
}

.lead-edit-field label {
  display: block;

  font-size: 12px;

  font-weight: 600;

  color: #667085;

  margin-bottom: 6px;
}

.lead-edit-field input,
.lead-edit-field textarea {
  width: 100%;

  padding: 10px 11px;

  border:
    1px solid #d1d5db;

  border-radius: 8px;

  font-size: 14px;

  outline: none;
}

.lead-edit-field input:focus,
.lead-edit-field textarea:focus {
  border-color: #1a73e8;

  box-shadow:
    0 0 0 3px rgba(26,115,232,.1);
}


/* =========================================================
   LOGIN
   ========================================================= */

#loginScreen {
  height: 100vh;
    box-sizing: border-box;
    align-items: center;
    overflow: hidden;


  width: 100%;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 20px;

  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(59,130,246,.18),
      transparent 35%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(99,102,241,.15),
      transparent 35%
    ),
    linear-gradient(
      135deg,
      #f8fafc 0%,
      #eef2ff 100%
    );
}

.login-card {
  width: 100%;

  max-width: 430px;

  background:
    rgba(255,255,255,.97);

  border:
    1px solid rgba(226,232,240,.8);

  border-radius: 24px;

  padding: 42px 40px 34px;

  text-align: center;

  box-shadow:
    0 25px 60px rgba(15,23,42,.12),
    0 8px 24px rgba(15,23,42,.06);

  backdrop-filter: blur(12px);
}

.login-logo {
  display: flex;

  justify-content: center;

  margin-bottom: 22px;
}

.logo-icon {
  width: 64px;
  height: 64px;

  display: flex;

  align-items: center;
  justify-content: center;

  border-radius: 18px;

  color: white;

  font-size: 30px;

  font-weight: 800;

  background:
    linear-gradient(
      135deg,
      #2563eb,
      #4f46e5
    );

  box-shadow:
    0 10px 25px rgba(37,99,235,.28);
}

.login-header h1 {
  margin: 0;

  color: #0f172a;

  font-size: 30px;

  font-weight: 750;
}

.login-header p {
  margin: 9px 0 0;

  color: #64748b;

  font-size: 15px;

  line-height: 1.5;
}

.login-divider {
  height: 1px;

  margin: 28px 0 22px;

  background: #e2e8f0;
}

.login-message {
  margin: 0 0 20px;

  color: #475569;

  font-size: 14px;

  line-height: 1.5;
}

.google-login-button {
  width: 100%;

  min-height: 52px;

  display: flex;

  align-items: center;
  justify-content: center;

  gap: 12px;

  border:
    1px solid #d1d5db;

  border-radius: 12px;

  background: white;

  color: #1f2937;

  font-size: 15px;

  font-weight: 600;

  cursor: pointer;
}

.google-login-button:active {
  transform: scale(.98);
}

.google-icon {
  display: flex;

  align-items: center;
  justify-content: center;

  flex-shrink: 0;
}

.login-footer {
  margin-top: 24px;

  color: #94a3b8;

  font-size: 12px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

  html,
  body {
    width: 100%;

    overflow-x: hidden;
  }


  /* -------------------------------------------------------
     HEADER
     ------------------------------------------------------- */

  .header {
    min-height: 58px;

    padding:
      max(8px, env(safe-area-inset-top))
      12px
      8px;

    gap: 8px;
  }

  .header h1 {
    font-size: 17px;
  }

  .user {
    display: none;
  }

  .logout-sbutton {
    min-width: 42px;

    min-height: 42px;

    padding: 0 10px;

    border-radius: 9px;
  }

  .logout-sbutton span:last-child {
    display: none;
  }

  .logout-icon {
    font-size: 20px;
  }


  /* -------------------------------------------------------
     CONTAINER
     ------------------------------------------------------- */

  .container {
    padding:
      12px
      12px
      calc(80px + env(safe-area-inset-bottom));
  }


  /* -------------------------------------------------------
     DASHBOARD
     ------------------------------------------------------- */

  .cards {
    display: flex;

    overflow-x: auto;

    gap: 10px;

    margin:
      0 -12px
      16px;

    padding:
      2px 12px 8px;

    scroll-snap-type: x mandatory;

    scrollbar-width: none;

    -webkit-overflow-scrolling: touch;
  }

  .cards::-webkit-scrollbar {
    display: none;
  }

  .cards > .card {
    flex:
      0 0 145px;

    width: 145px;

    min-height: 92px;

    padding: 14px;

    border-radius: 13px;

    scroll-snap-align: start;
  }

  .card-title {
    font-size: 11px;
  }

  .card-number {
    font-size: 25px;

    margin-top: 8px;
  }


  /* -------------------------------------------------------
     SECTION
     ------------------------------------------------------- */

  .section {
    padding: 14px;

    border-radius: 13px;

    overflow: visible;
  }

  .section h2 {
    font-size: 18px;
  }


  /* -------------------------------------------------------
     LEAD HEADER
     ------------------------------------------------------- */

  .section > div:first-child {
    flex-wrap: wrap;
  }

  #managerActions {
    /* width: 100%; */

    display: flex;

    gap: 7px;
  }

  #managerActions .button {
    flex: 1;

    min-height: 42px;
  }


  /* -------------------------------------------------------
     FILTERS
     ------------------------------------------------------- */

  .lead-filters {
    display: grid;

    grid-template-columns:
      1fr auto;

    gap: 8px;

    margin-top: 12px;
  }

  .lead-filters input {
    grid-column: 1 / -1;

    width: 100%;

    min-width: 0;

    min-height: 44px;

    font-size: 15px;
  }

  .lead-filters select {
    /* width: 100% */

    min-height: 44px;
  }

  .lead-filters .cancel-button {
    min-height: 44px;
  }


  /* -------------------------------------------------------
     SHOW ALL
     ------------------------------------------------------- */

  .section > .cancel-button {
    width: 100%;

    min-height: 42px;

    margin-bottom: 12px;
  }


  /* -------------------------------------------------------
     TABLE -> MOBILE CARD CONTAINER
     ------------------------------------------------------- */

  .section table {
    display: block;

    width: 100%;
  }

  .section table thead {
    display: none;
  }

  .section table tbody {
    display: flex;

    flex-direction: column;

    gap: 10px;

    width: 100%;
  }

  .section table tr {
    display: grid;

    grid-template-columns:
      1fr 1fr;

    gap: 0;

    width: 100%;

    background: #fff;

    border:
      1px solid #e7eaf0;

    border-radius: 13px;

    overflow: hidden;

    box-shadow:
      0 2px 7px rgba(0,0,0,.04);
  }

  .section table td {
    display: block;

    width: 100%;

    padding: 10px 11px;

    min-width: 0;

    border-bottom:
      1px solid #f0f1f3;

    font-size: 13px;

    overflow-wrap: anywhere;
  }

  .section table td:last-child {
    border-bottom: none;
  }


  /* Lead ID */
  .section table td:nth-child(1) {
    grid-column: 1 / -1;

    background: #f8faff;

    font-size: 11px;

    color: #64748b;

    font-weight: 600;
  }


  /* Name */
  .section table td:nth-child(2) {
    grid-column: 1 / -1;

    padding-top: 13px;

    padding-bottom: 13px;

    border-bottom: none;

    font-size: 16px;
  }


  /* Phone */
  .section table td:nth-child(3)::before {
    content: "Phone";
  }

  /* Course */
  .section table td:nth-child(4)::before {
    content: "Course";
  }

  /* Source */
  .section table td:nth-child(5)::before {
    content: "Source";
  }

  /* Campaign */
  .section table td:nth-child(6)::before {
    content: "Campaign";
  }

  /* Assigned */
  .section table td:nth-child(7)::before {
    content: "Assigned";
  }

  /* Stage */
  .section table td:nth-child(8)::before {
    content: "Stage";
  }

  /* Followup */
  .section table td:nth-child(9)::before {
    content: "Follow-up";
  }

  /* Actions */
  .section table td:nth-child(10) {
    grid-column: 1 / -1;

    background: #fafbfc;

    padding: 10px;

    border-bottom: none;
  }

  .section table td:nth-child(3)::before,
  .section table td:nth-child(4)::before,
  .section table td:nth-child(5)::before,
  .section table td:nth-child(6)::before,
  .section table td:nth-child(7)::before,
  .section table td:nth-child(8)::before,
  .section table td:nth-child(9)::before {
    display: block;

    margin-bottom: 3px;

    color: #8a919c;

    font-size: 10px;

    font-weight: 600;

    text-transform: uppercase;
  }


  /* -------------------------------------------------------
     ACTION BUTTONS
     ------------------------------------------------------- */

  .section table td:nth-child(10) {
    display: flex;

    flex-wrap: wrap;

    gap: 6px;
  }

  .section table td:nth-child(10) button {
    flex: 1;

    min-width: 80px;

    min-height: 42px;

    margin: 0 !important;

    padding: 8px 9px;

    font-size: 12px;
  }

  .section table td:nth-child(10) select {
    flex: 1;

    min-height: 42px;
  }


  /* -------------------------------------------------------
     STAGE SELECT
     ------------------------------------------------------- */

  .stage-select {
    width: 100%;

    min-height: 42px;

    font-size: 13px;
  }


  /* -------------------------------------------------------
     MODALS = BOTTOM SHEETS
     ------------------------------------------------------- */

  .modal {
    padding: 0;

    align-items: flex-end;

    justify-content: center;
  }

  .modal-content {
    width: 100% !important;

    max-width: 100% !important;

    margin:
      auto
      0
      0;

    max-height:
      calc(
        100dvh - env(safe-area-inset-top)
      );

    padding:
      20px
      16px
      calc(
        20px +
        env(safe-area-inset-bottom)
      );

    border-radius:
      20px
      20px
      0
      0;

    box-shadow:
      0 -10px 40px rgba(0,0,0,.18);

    overflow-y: auto;

    animation:
      mobileSheetUp
      .22s
      ease-out;
  }


  /* Bottom sheet handle */

  .modal-content::before {
    content: "";

    display: block;

    width: 38px;

    height: 4px;

    margin:
      -7px
      auto
      17px;

    border-radius: 10px;

    background: #d5d8dd;
  }


  .modal-content h2 {
    font-size: 19px;
  }


  /* -------------------------------------------------------
     MODAL FORMS
     ------------------------------------------------------- */

  .modal-content select,
  .modal-content input,
  .modal-content textarea {
    width: 100%;

    min-height: 44px;

    font-size: 15px;
  }

  .modal-content textarea {
    min-height: 110px;
  }


  /* -------------------------------------------------------
     MODAL BUTTONS
     ------------------------------------------------------- */

  .modal-buttons {
    width: 100%;

    display: grid;

    grid-template-columns:
      1fr 1fr;

    gap: 8px;

    margin-top: 15px;
  }

  .modal-buttons button {
    width: 100%;

    min-height: 46px;
  }


  /* -------------------------------------------------------
     HISTORY
     ------------------------------------------------------- */

  .history-content {
    max-height:
      calc(100dvh - 220px);

    padding-right: 0;
  }


  /* -------------------------------------------------------
     LEAD DETAILS
     ------------------------------------------------------- */

  .lead-details-modal {
    max-height: 92dvh;
  }

  .lead-detail-row {
    padding: 12px 0;
  }

  .lead-detail-value {
    font-size: 14px;
  }


  /* -------------------------------------------------------
     PERFORMANCE / REPORTS
     ------------------------------------------------------- */

  #performanceContent,
  #reportsContent {
    overflow-x: hidden;
  }

  #performanceContent .cards {
    display: grid;

    grid-template-columns:
      repeat(3, minmax(120px, 1fr));

    margin:
      0
      0
      16px;

    padding: 0;

    overflow-x: auto;
  }

  #performanceContent .cards > .card {
    min-width: 120px;

    width: auto;
  }

  #performanceContent table,
  #reportsContent table {
    min-width: 650px;
  }

  #performanceContent > table,
  #reportsContent table {
    display: table;
  }

  #performanceContent > table thead,
  #reportsContent table thead {
    display: table-header-group;
  }

  #performanceContent > table tbody,
  #reportsContent table tbody {
    display: table-row-group;
  }

  #performanceContent > table tr,
  #reportsContent table tr {
    display: table-row;

    background: transparent;

    border: none;

    box-shadow: none;
  }

  #performanceContent > table td,
  #reportsContent table td {
    display: table-cell;

    width: auto;

    padding: 10px;

    border-bottom:
      1px solid #edf0f3;

    font-size: 12px;
  }

  #performanceContent > table td::before,
  #reportsContent table td::before {
    display: none;
  }


  /* -------------------------------------------------------
     LOGIN
     ------------------------------------------------------- */

  #loginScreen {
    padding:
      16px;
    box-sizing: border-box;

    min-height: 100vh;
        overflow: hidden;

  }

  .login-card {
    max-width: 430px;

    padding:
      32px
      20px
      26px;

    border-radius: 20px;
  }

  .login-header h1 {
    font-size: 26px;
  }

  .login-header p {
    font-size: 14px;
  }

  .logo-icon {
    width: 58px;
    height: 58px;

    border-radius: 16px;

    font-size: 27px;
  }

  .google-login-button {
    min-height: 52px;

    font-size: 14px;
  }
}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 390px) {

  .container {
    padding-left: 9px;
    padding-right: 9px;
  }

  .cards {
    margin-left: -9px;
    margin-right: -9px;

    padding-left: 9px;
    padding-right: 9px;
  }

  .cards > .card {
    flex-basis: 138px;

    width: 138px;
  }

  .section {
    padding: 11px;
  }

  .section table td {
    padding: 9px;
  }

  .section table td:nth-child(10) button {
    min-width: 72px;

    font-size: 11px;
  }

  .login-card {
    padding:
      28px
      17px
      23px;
  }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 340px) {

  .header h1 {
    font-size: 16px;
  }

  .cards > .card {
    flex-basis: 130px;

    width: 130px;
  }

  .section table td:nth-child(10) {
    display: grid;

    grid-template-columns:
      1fr 1fr;
  }

  .section table td:nth-child(10) button,
  .section table td:nth-child(10) select {
    width: 100%;

    min-width: 0;
  }
}


/* =========================================================
   MOBILE SHEET ANIMATION
   ========================================================= */

@keyframes mobileSheetUp {

  from {
    transform: translateY(100%);

    opacity: .7;
  }

  to {
    transform: translateY(0);

    opacity: 1;
  }
}


/* =========================================================
   REDUCE MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;

    animation-iteration-count: 1 !important;

    transition-duration: .01ms !important;
  }
}



/* =========================================================
   MOBILE CRM UI — CSS ONLY
   No HTML / JS changes required
   ========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   HEADER
   ========================================================= */

.header {
  min-height: 58px;
  padding: 12px 18px;
  gap: 10px;
}

.header h1 {
  font-size: 19px;
  white-space: nowrap;
}

.user {
  margin-left: auto;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.logout-sbutton {
  flex-shrink: 0;
}


/* =========================================================
   MAIN CONTAINER
   ========================================================= */

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}


/* =========================================================
   DASHBOARD CARDS
   ========================================================= */

.cards {
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.card {
  padding: 15px;
  border-radius: 12px;
}

.card-title {
  font-size: 12px;
  line-height: 1.3;
}

.card-number {
  font-size: 25px;
  margin-top: 5px;
}


/* =========================================================
   SECTION
   ========================================================= */

.section {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
}


/* =========================================================
   FILTERS
   ========================================================= */

.lead-filters {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: 100%;
}

.lead-filters input {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  height: 44px;
}

.lead-filters select {
  /* width: 100%; */
  height: 44px;
}

.lead-filters button {
  height: 44px;
  white-space: nowrap;
}


/* =========================================================
   DESKTOP TABLE
   ========================================================= */

@media (min-width: 701px) {

  #leadTable tr {
    transition: background .15s ease;
  }

  #leadTable tr:hover {
    background: #f8faff;
  }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

  /* -----------------------------------------
     BODY
     ----------------------------------------- */

  body {
    background: #f5f7fb;
    font-size: 14px;
  }


  /* -----------------------------------------
     HEADER
     ----------------------------------------- */

  .header {
    position: sticky;
    top: 0;
    z-index: 500;

    min-height: 56px;
    padding: 10px 14px;

    box-shadow:
      0 2px 10px rgba(0, 0, 0, .10);
  }

  .header h1 {
    font-size: 18px;
  }

  .user {
    display: none;
  }

  .logout-sbutton {
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 8px;
  }


  /* -----------------------------------------
     CONTAINER
     ----------------------------------------- */

  .container {
    padding: 12px;
  }


  /* -----------------------------------------
     DASHBOARD
     ----------------------------------------- */

  .cards {
    display: flex;
    overflow-x: auto;

    gap: 9px;

    margin:
      0 -12px
      14px;

    padding:
      2px 12px 8px;

    scroll-snap-type: x mandatory;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;
  }

  .cards::-webkit-scrollbar {
    display: none;
  }

  .cards > .card {
    flex: 0 0 145px;
    min-width: 145px;

    padding: 14px;

    border-radius: 13px;

    scroll-snap-align: start;

    box-shadow:
      0 2px 8px rgba(0,0,0,.07);
  }

  .card-number {
    font-size: 26px;
  }


  /* -----------------------------------------
     LEAD SECTION
     ----------------------------------------- */

  .section {
    padding: 12px;
    border-radius: 14px;
  }

  .section h2 {
    font-size: 20px;
  }


  /* -----------------------------------------
     LEAD HEADER
     ----------------------------------------- */

  .section > div:first-child {
    flex-wrap: wrap;
  }

  #managerActions {
    /* width: 100%; */
    display: flex;
    gap: 7px;
  }

  #managerActions .button {
    flex: 1;
    min-height: 40px;
  }


  /* -----------------------------------------
     FILTERS
     ----------------------------------------- */

  .lead-filters {
    display: grid;

    grid-template-columns:
      minmax(0, 1fr)
      auto;

    gap: 8px;

    margin-bottom: 9px;
  }

  .lead-filters input {
    grid-column: 1 / -1;

    width: 100%;
    min-width: 0;

    height: 44px;

    padding:
      0 13px;

    border-radius: 10px;

    font-size: 14px;
  }

  .lead-filters select {
    height: 44px;

    min-width: 0;

    padding:
      0 10px;

    border-radius: 10px;
  }

  .lead-filters button {
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
  }


  /* -----------------------------------------
     SHOW ALL
     ----------------------------------------- */

  .section > div > .cancel-button {
    min-height: 42px;
    border-radius: 9px;
  }


  /* =====================================================
     TURN LEAD TABLE INTO MOBILE CARDS
     ===================================================== */

  table {
    width: 100%;
    border: 0;
  }

  table thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
  }

  #leadTable {
    width: 100%;
  }


  /* -----------------------------------------
     LEAD CARD
     ----------------------------------------- */

  #leadTable tr {

    position: relative;

    width: 100%;

    margin:
      0 0 10px;

    padding:
      13px;

    background: #fff;

    border:
      1px solid #edf0f4;

    border-radius: 13px;

    box-shadow:
      0 2px 7px rgba(0,0,0,.055);
  }


  /* -----------------------------------------
     ALL CELLS
     ----------------------------------------- */

  #leadTable td {

    display: none;

    border: 0;

    padding: 0;

    font-size: 13px;
  }


  /* -----------------------------------------
     LEAD ID
     ----------------------------------------- */

  #leadTable td:nth-child(1) {

    display: block;

    position: absolute;

    top: 13px;
    right: 13px;

    color: #94a3b8;

    font-size: 10px;
  }


  /* -----------------------------------------
     CUSTOMER NAME
     ----------------------------------------- */

  #leadTable td:nth-child(2) {

    display: block;

    padding-right: 65px;

    margin-bottom: 5px;
  }

  .lead-name-button {

    max-width: 100%;

    color: #1967d2;

    font-size: 16px;

    font-weight: 700;

    text-align: left;

    line-height: 1.3;

    padding: 3px 0;
  }


  /* -----------------------------------------
     PHONE
     ----------------------------------------- */

  #leadTable td:nth-child(3) {

    display: block;

    color: #475569;

    margin-bottom: 7px;

    font-size: 13px;
  }


  /* -----------------------------------------
     COURSE
     ----------------------------------------- */

  #leadTable td:nth-child(4) {

    display: block;

    color: #334155;

    font-weight: 600;

    margin-bottom: 9px;
  }


  /* -----------------------------------------
     STAGE
     ----------------------------------------- */

  #leadTable td:nth-child(8) {

    display: inline-block;

    margin-right: 6px;
  }

  #leadTable td:nth-child(8) .stage-select {

    min-height: 34px;

    padding:
      6px 9px;

    border-radius: 8px;

    font-size: 12px;
  }


  /* -----------------------------------------
     FOLLOW-UP
     ----------------------------------------- */

  #leadTable td:nth-child(9) {

    display: inline-block;

    margin-top: 5px;

    color: #64748b;

    font-size: 11px;
  }


  /* -----------------------------------------
     ACTIONS
     ----------------------------------------- */

  #leadTable td:nth-child(10) {

    display: flex;

    flex-wrap: wrap;

    gap: 6px;

    margin-top: 11px;

    padding-top: 10px;

    border-top:
      1px solid #f0f2f5;
  }

  #leadTable td:nth-child(10) button {

    flex: 1;

    min-width: 75px;

    min-height: 40px;

    margin: 0;

    padding:
      7px 9px;

    border-radius: 8px;

    font-size: 12px;
  }


  /* -----------------------------------------
     HIDE EXTRA TABLE INFORMATION
     ----------------------------------------- */

  #leadTable td:nth-child(5),
  #leadTable td:nth-child(6),
  #leadTable td:nth-child(7) {

    display: none;
  }


  /* =====================================================
     MODALS — FULL MOBILE SCREEN
     ===================================================== */

  .modal {

    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;

    padding: 0;

    background:
      rgba(15,23,42,.48);
  }


  .modal-content {

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    width: 100% !important;

    max-width: 100% !important;

    max-height: 94vh;

    margin: 0;

    padding:
      20px 16px
      calc(20px + env(safe-area-inset-bottom));

    border-radius:
      20px 20px 0 0;

    overflow-y: auto;

    -webkit-overflow-scrolling: touch;

    box-shadow:
      0 -8px 30px rgba(0,0,0,.18);
  }


  /* -----------------------------------------
     MODAL HEADINGS
     ----------------------------------------- */

  .modal-content h2 {

    font-size: 20px;

    margin-top: 0;

    margin-bottom: 15px;
  }


  /* -----------------------------------------
     MODAL FORM ELEMENTS
     ----------------------------------------- */

  .modal-content select,
  .modal-content input,
  .modal-content textarea {

    width: 100%;

    min-height: 46px;

    padding:
      11px 12px;

    border-radius: 10px;

    font-size: 16px;

    border:
      1px solid #d9dee7;

    background: #fff;
  }

  .modal-content textarea {

    min-height: 110px;

    line-height: 1.5;
  }


  /* -----------------------------------------
     MODAL BUTTONS
     ----------------------------------------- */

  .modal-buttons {

    display: flex;

    gap: 8px;

    width: 100%;
  }

  .modal-buttons button {

    flex: 1;

    min-height: 46px;

    border-radius: 10px;

    font-size: 14px;

    font-weight: 600;
  }


  /* =====================================================
     CUSTOMER DETAILS
     ===================================================== */

  .lead-details-modal {

    width: 100% !important;

    max-width: 100% !important;

    max-height: 96vh;

    padding:
      18px 16px
      calc(18px + env(safe-area-inset-bottom));
  }

  #leadDetailsContent {

    font-size: 14px;
  }

  .lead-detail-row {

    padding:
      12px 0;

    display: block;
  }

  .lead-detail-label {

    font-size: 11px;

    color: #94a3b8;

    text-transform: uppercase;

    letter-spacing: .4px;

    margin-bottom: 4px;
  }

  .lead-detail-value {

    font-size: 15px;

    line-height: 1.4;

    word-break: break-word;
  }


  /* =====================================================
     ACTIVITY
     ===================================================== */

  #activityModal .modal-content {

    min-height: 65vh;
  }

  #activityModal label {

    display: block;

    margin-top: 4px;

    margin-bottom: 6px;

    color: #475569;

    font-size: 13px;

    font-weight: 600;
  }

  #activityModal .activity-save-button {

    min-height: 48px;

    border-radius: 10px;
  }


  /* =====================================================
     HISTORY
     ===================================================== */

  .history-content {

    max-height: 60vh;

    padding-right: 0;
  }


  /* =====================================================
     PERFORMANCE
     ===================================================== */

  #performanceModal .modal-content {

    max-height: 96vh;
  }

  #performanceContent .cards {

    display: grid;

    grid-template-columns:
      repeat(3, minmax(0, 1fr));

    overflow: visible;

    margin: 0 0 15px;

    padding: 0;
  }

  #performanceContent .cards > .card {

    min-width: 0;

    padding: 11px;

    border-radius: 10px;
  }

  #performanceContent .card-title {

    font-size: 10px;
  }

  #performanceContent .card-number {

    font-size: 21px;
  }

  #performanceContent table {

    display: table;

    min-width: 700px;
  }

  #performanceContent table thead {

    display: table-header-group;
  }

  #performanceContent table tbody {

    display: table-row-group;
  }

  #performanceContent table tr {

    display: table-row;

    margin: 0;

    padding: 0;

    box-shadow: none;

    border-radius: 0;
  }

  #performanceContent table th,
  #performanceContent table td {

    display: table-cell;

    padding: 9px;

    font-size: 11px;
  }

  #performanceContent {

    overflow-x: auto;
  }


  /* =====================================================
     REPORTS
     ===================================================== */

  #reportsModal .modal-content {

    max-height: 96vh;
  }

  #reportsModal table {

    display: table;

    min-width: 650px;
  }

  #reportsModal table thead {

    display: table-header-group;
  }

  #reportsModal table tbody {

    display: table-row-group;
  }

  #reportsModal table tr {

    display: table-row;

    margin: 0;

    padding: 0;

    box-shadow: none;

    border-radius: 0;
  }

  #reportsModal table th,
  #reportsModal table td {

    display: table-cell;

    padding: 9px;

    font-size: 11px;
  }


  /* =====================================================
     LOGIN
     ===================================================== */

  #loginScreen {

    min-height:
      100vh;
          overflow: hidden;
    box-sizing: border-box;


    padding:
      16px;

    align-items:
      center;
  }

  .login-card {

    width: 100%;

    max-width: 380px;

    padding:
      30px 20px 24px;

    border-radius: 20px;
  }

  .login-header h1 {

    font-size: 26px;
  }

  .login-header p {

    font-size: 14px;
  }

  .login-divider {

    margin:
      22px 0 18px;
  }

  .google-login-button {

    min-height: 52px;

    border-radius: 11px;

    font-size: 14px;
  }

  .logo-icon {

    width: 56px;
    height: 56px;

    border-radius: 15px;

    font-size: 26px;
  }

}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 380px) {

  .container {
    padding: 9px;
  }

  .section {
    padding: 10px;
  }

  .header {
    padding:
      9px 11px;
  }

  .header h1 {
    font-size: 16px;
  }

  .logout-sbutton span:last-child {
    display: none;
  }

  .logout-sbutton {
    width: 38px;
    height: 38px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cards {
    margin-left: -9px;
    margin-right: -9px;

    padding-left: 9px;
    padding-right: 9px;
  }

  .cards > .card {
    flex-basis: 135px;
    min-width: 135px;
  }

  #leadTable tr {
    padding: 12px;
  }

  #leadTable td:nth-child(10) button {
    min-width: 0;
    font-size: 11px;
  }

  .modal-content {
    padding-left: 13px;
    padding-right: 13px;
  }

}


/* =========================================================
   TOUCH IMPROVEMENTS
   ========================================================= */

@media (hover: none) and (pointer: coarse) {

  button,
  select,
  input,
  textarea,
  .lead-name-button,
  .followup-card {

    touch-action: manipulation;
  }

  button {
    min-height: 42px;
  }

  .lead-name-button {

    min-height: 42px;

    display: inline-flex;

    align-items: center;
  }

}
/* =========================================================
   BEAUTIFUL CRM HEADER
   ========================================================= */

.header {
  position: sticky;
  top: 0;
  z-index: 500;

  min-height: 64px;
  width: 100%;

  display: flex;
  align-items: center;
  gap: 14px;

  padding: 10px 22px;

  background:
    linear-gradient(
      135deg,
      #1d4ed8 0%,
      #2563eb 55%,
      #3b82f6 100%
    );

  color: #fff;

  border-bottom: 1px solid rgba(255,255,255,.12);

  box-shadow:
    0 4px 18px rgba(15, 23, 42, .16);
}


/* =========================================================
   CRM TITLE
   ========================================================= */

.header h1 {
  margin: 0;

  display: flex;
  align-items: center;
  gap: 10px;

  color: #fff;

  font-size: 21px;
  font-weight: 750;

  letter-spacing: -.4px;

  white-space: nowrap;
}


/* Small CRM logo before title */
.crm-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
}

.crm-brand-text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #ffff;
}

.crm-brand-text p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #dedede;
}
.header h1::before {
  /* content: "ES"; */

  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border-radius: 10px;

  background: rgba(255,255,255,.18);

  border: 1px solid rgba(255,255,255,.22);

  color: #fff;

  font-size: 17px;
  font-weight: 800;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.15);
}


/* =========================================================
   USER EMAIL
   ========================================================= */

#user {
  margin-left: auto;

  max-width: 300px;

  padding: 7px 12px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: rgba(255,255,255,.92);

  font-size: 13px;
  font-weight: 500;

  background: rgba(255,255,255,.11);

  border: 1px solid rgba(255,255,255,.14);

  border-radius: 20px;
}


/* =========================================================
   LOGOUT BUTTON
   ========================================================= */

.logout-sbutton {

  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  min-height: 40px;

  padding: 0 14px;

  flex-shrink: 0;

  border: 1px solid rgba(255,255,255,.25);

  border-radius: 10px;

  background: rgba(255,255,255,.12);

  color: #fff;

  font-family: inherit;

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background .18s ease,
    transform .15s ease,
    box-shadow .18s ease;
}


.logout-sbutton:hover {

  background: rgba(255,255,255,.2);

  box-shadow:
    0 4px 12px rgba(0,0,0,.12);

  transform: translateY(-1px);
}


.logout-sbutton:active {

  transform: scale(.97);

  box-shadow: none;
}


/* =========================================================
   LOGOUT ICON
   ========================================================= */

.logout-icon {

  width: 24px;
  height: 24px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 7px;

  background: rgba(255,255,255,.15);

  font-size: 17px;

  line-height: 1;
}


/* =========================================================
   MOBILE HEADER
   ========================================================= */

@media (max-width: 700px) {

  .header {

    min-height: 58px;

    padding:
      8px 12px;

    gap: 8px;

    box-shadow:
      0 3px 14px rgba(15,23,42,.16);
  }


  .header h1 {

    gap: 7px;

    font-size: 17px;

    letter-spacing: -.3px;
  }


  .header h1::before {

    width: 32px;
    height: 32px;

    border-radius: 9px;

    font-size: 16px;
  }


  #user {

    display: block;

    margin-left: auto;

    max-width: 125px;

    padding:
      6px 9px;

    font-size: 10px;

    border-radius: 15px;
  }


  .logout-sbutton {

    width: 38px;
    height: 38px;

    min-height: 38px;

    padding: 0;

    border-radius: 9px;

    gap: 0;
  }


  .logout-sbutton span:last-child {

    display: none;
  }


  .logout-icon {

    width: 28px;
    height: 28px;

    background: transparent;

    font-size: 18px;
  }

}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 380px) {

  .header {

    padding:
      8px 10px;
  }


  .header h1 {

    font-size: 16px;
  }


  .header h1::before {

    width: 29px;
    height: 29px;

    border-radius: 8px;

    font-size: 14px;
  }


  #user {

    max-width: 105px;

    font-size: 9px;

    padding:
      5px 7px;
  }


  .logout-sbutton {

    width: 35px;
    height: 35px;
  }

}
.lead-filters {
display: flex;
gap: 10px;
margin-bottom: 15px;
align-items: center;
}
.lead-filters input,
.lead-filters select {
padding: 9px 10px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 14px;
}
.lead-filters input {
flex: 1;
min-width: 250px;
}
@media(max-width: 700px) {

.lead-filters input {
min-width: 150px;
}
}
.button-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: buttonSpin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes buttonSpin {
  to {
    transform: rotate(360deg);
  }
}

.activity-save-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* =====================================
   LOGIN SCREEN
===================================== */

#loginScreen {
  position: fixed;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background:
    radial-gradient(
      circle at 50% 0%,
      #f3f1ff 0%,
      #f8f9fc 35%,
      #f5f6f8 100%
    );

  z-index: 9999;
}


/* =====================================
   LOGIN CARD
===================================== */

.login-card {
  width: 100%;
  max-width: 410px;

  background: #ffffff;

  border: 1px solid #e7e8ec;

  border-radius: 18px;

  padding: 42px 40px 30px;

  box-shadow:
    0 20px 50px rgba(20, 24, 40, 0.08),
    0 2px 8px rgba(20, 24, 40, 0.04);

  box-sizing: border-box;
}


/* =====================================
   BRAND
===================================== */

.login-brand {
  text-align: center;
  margin-bottom: 38px;
}

.brand-name {
  color: #171717;

  font-size: 21px;
  font-weight: 800;

  letter-spacing: -0.6px;
}

.brand-product {
  display: inline-block;

  margin-top: 6px;

  color: #635bdb;

  font-size: 10px;
  font-weight: 800;

  letter-spacing: 2.5px;

  text-transform: uppercase;
}


/* =====================================
   HEADER
===================================== */

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  margin: 0;

  color: #18181b;

  font-size: 27px;
  line-height: 1.2;

  font-weight: 750;

  letter-spacing: -0.8px;
}

.login-header p {
  margin: 9px 0 0;

  color: #71717a;

  font-size: 14px;
  line-height: 1.5;
}


/* =====================================
   GOOGLE BUTTON
===================================== */

.login-form {
  width: 100%;
}

.google-login-button {
  width: 100%;
  height: 50px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 11px;

  border: 1px solid #d9dbe1;

  border-radius: 9px;

  background: #ffffff;

  color: #27272a;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.google-login-button:hover {
  background: #fafafa;

  border-color: #c9cbd2;

  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.06);
}

.google-login-button:active {
  transform: translateY(1px);
}

.google-login-button:focus-visible {
  outline: 3px solid rgba(99, 91, 219, 0.18);
  outline-offset: 2px;
}

.google-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
}


/* =====================================
   ERROR
===================================== */

#loginError {
  margin-top: 16px;

  color: #dc2626;

  font-size: 13px;
  line-height: 1.45;

  text-align: center;
}


/* =====================================
   FOOTER
===================================== */

.login-footer {
  margin-top: 28px;

  padding-top: 20px;

  border-top: 1px solid #eeeeef;

  text-align: center;
}

.login-footer span {
  color: #a1a1aa;

  font-size: 11px;
  font-weight: 500;

  letter-spacing: 0.2px;
}


/* =====================================
   MOBILE
===================================== */

@media (max-width: 480px) {

  #loginScreen {
    padding: 16px;
  }

  .login-card {
    padding: 34px 24px 25px;

    border-radius: 16px;
  }

  .login-brand {
    margin-bottom: 32px;
  }

  .login-header h1 {
    font-size: 25px;
  }

}