/* Typography */

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

body {
    font-family: 'Segoe UI', sans-serif;
    background: #f7f9fb;
    margin: 0;
    padding: 0;
    color: #333;
  }
  
  h1, h2, h3 {
    margin: 0 0 1em;
    font-weight: 600;
  }
  
  .container {
    max-width: 800px;
    margin: 2em auto;
    padding: 1em;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  }
  
  header {
    background-color: #2a3f7a;
    padding: 1em;
    color: white;
    text-align: center;
  }
  
  .flash-messages {
    max-width: 800px;
    margin: 1em auto;
    padding: 0 1em;
  }
  
  .flash {
    padding: 1em;
    margin-bottom: 1em;
    border-radius: 5px;
  }
  
  .flash.success { background: #d4edda; color: #155724; }
  .flash.error { background: #f8d7da; color: #721c24; }
  
  /* Forms */
  form {
    margin-top: 1em;
  }
  
  label {
    display: block;
    margin-top: 1em;
    font-weight: 500;
  }
  
  input, textarea {
    width: 100%;
    padding: 0.5em;
    margin-top: 0.3em;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
  }
  
  input:focus, textarea:focus {
    outline: none;
    border-color: #2a3f7a;
  }
  
  /* Buttons */
  .btn {
    display: inline-block;
    margin: 1em 0.5em 0 0;
    padding: 0.5em 1em;
    font-size: 1em;
    font-weight: 500;
    text-decoration: none;
    background-color: #2a3f7a;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }
  
  .btn:hover {
    background-color: #1c2e5a;
  }
  
  .btn.btn-danger {
    background-color: #c82333;
  }
  
  .btn.btn-danger:hover {
    background-color: #a71d2a;
  }
  
  .btn.btn-secondary {
    background-color: #6c757d;
  }
  
  .btn.btn-secondary:hover {
    background-color: #5a6268;
  }
  
  /* Tables */
  table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
  }
  
  th, td {
    text-align: left;
    padding: 0.75em;
    border-bottom: 1px solid #ddd;
  }
  
  th {
    background-color: #f2f2f2;
  }
  
  @media screen and (max-width: 600px) {
    .container {
      margin: 1em;
      padding: 1em;
    }
  
    table, thead, tbody, th, td, tr {
      display: block;
    }
  
    td {
      padding-left: 50%;
      position: relative;
    }
  
    td::before {
      position: absolute;
      left: 1em;
      top: 0.75em;
      white-space: nowrap;
      font-weight: bold;
    }
  }
  
  .lead-card {
    background: #fff;
    border: 1px solid #ccc;
    margin: 0.5em 0;
    padding: 1em;
    border-radius: 8px;
  }
  .lead-header {
    display: flex;
    justify-content: space-between;
    font-size: 1.1em;
    font-weight: bold;
  }
  .lead-contact {
    margin-top: 0.5em;
    font-size: 0.95em;
  }
  .lead-title {
    font-weight: normal;
    margin-left: 0.5em;
    font-style: italic;
  }
  
  .toggle-form {
    display: flex;
    align-items: center;
    gap: 0.6em;
    background: #f3f3f3;
    padding: 0.5em 0.8em;
    border-radius: 6px;
  }
  
  .switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
  }
  
  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
  }
  
  .slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
  }
  
  .switch input:checked + .slider {
    background-color: #2a3f7a;
  }
  
  .switch input:checked + .slider:before {
    transform: translateX(22px);
  }
  
  .toggle-label {
    font-size: 0.95em;
  }

  .checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.8em;
  }

  .checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    appearance: checkbox; /* standardize cross-browser */
    accent-color: #2a3f7a; /* ensures visible tick (modern browsers) */
    cursor: pointer;
    flex-shrink: 0;
  }
  
  .checkbox-row label {
    cursor: pointer;
    font-size: 0.95em;
    user-select: none;
  }

  .checkbox-wrapper {
    margin: 0.5em 0;
}

.checkbox-label {
    position: relative;
    padding-left: 1.6em;
    cursor: pointer;
    display: inline-block;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-label .custom-box {
    position: absolute;
    left: 0;
    top: 0.1em;
    height: 1em;
    width: 1em;
    background-color: #ccc;
    border-radius: 2px;
    border: 1px solid #666;
}

.checkbox-label input[type="checkbox"]:checked ~ .custom-box {
    background-color: #0077cc;
    border-color: #005a9c;
}

.checkbox-label .custom-box::after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-label input[type="checkbox"]:checked ~ .custom-box::after {
    display: block;
}

.checkbox-label .custom-box::after {
    left: 0.3em;
    top: 0.05em;
    width: 0.25em;
    height: 0.6em;
    border: solid white;
    border-width: 0 0.15em 0.15em 0;
    transform: rotate(45deg);
}

.channel-card {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1em;
  margin-bottom: 1em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.channel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.assigned-tag {
  background-color: #e0f7fa;
  color: #00796b;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-size: 0.8em;
}

.pool-tag {
  background-color: #ffe0b2;
  color: #e65100;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-size: 0.8em;
}

.channel-body p {
  margin: 0.3em 0;
}

.channel-actions {
  margin-top: 0.5em;
  display: flex;
  gap: 0.5em;
}
