/* ========== Reset & Base ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #2d3748;
  line-height: 1.5;
}

/* ========== Layout ========== */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.hidden {
  display: none !important;
}

.flex-1 {
  flex: 1;
}

/* ========== Header ========== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

header h1 {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

#user-email {
  color: #f7fafc;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-weight: 500;
}

/* ========== Card ========== */
.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.highlight-card {
  border-left: 5px solid #ecc94b;
  background: #fffdf5;
}

.upcoming-card {
  border-left: 5px solid #4299e1;
  background: #f7fafc;
}

.missed-card {
  border-left: 5px solid #e53e3e;
  background: #fffaf0;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card h2 {
  font-size: 1.3rem;
  color: #2d3748;
  margin-bottom: 0.75rem;
}

.card-header-row h2 {
  margin-bottom: 0;
}

.card-description {
  color: #718096;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: #a0aec0;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.5rem;
}

.btn-close:hover {
  color: #4a5568;
}

/* ========== Auth Section ========== */
#auth-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
}

#auth-section h1 {
  color: #fff;
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
  text-align: center;
}

.subtitle {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.75rem;
  text-align: center;
  font-size: 1.05rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

.auth-notice {
  background: #edf2f7;
  color: #4a5568;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  border-left: 3px solid #667eea;
}

.auth-notice code {
  background: #e2e8f0;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #2b6cb0;
}

/* ========== Forms & Inputs ========== */
form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 240px;
}

label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #4a5568;
}

input,
select,
textarea {
  padding: 0.7rem 0.85rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #2d3748;
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.helper-text {
  font-size: 0.75rem;
  color: #718096;
  margin-top: 0.2rem;
}

/* ========== Buttons ========== */
button,
.btn-secondary {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

button[type="submit"],
#auth-btn,
#save-btn,
#update-password-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

button[type="submit"]:hover,
#auth-btn:hover,
#save-btn:hover,
#update-password-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.btn-secondary {
  background: #edf2f7;
  color: #4a5568;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #2d3748;
}

.btn-danger {
  background: #fed7d7;
  color: #c53030;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.btn-danger:hover {
  background: #feb2b2;
}

.btn-send {
  background: #3182ce;
  color: #fff;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  text-decoration: none;
}

.btn-send:hover {
  background: #2b6cb0;
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  text-decoration: none;
}

.btn-whatsapp:hover {
  background: #1ebc59;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* ========== Feedback & Errors ========== */
.error {
  color: #e53e3e;
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.feedback-msg {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.feedback-msg.success {
  color: #38a169;
}

.feedback-msg.error {
  color: #e53e3e;
}

/* ========== Contact Items & Badges ========== */
.badge {
  background: #edf2f7;
  color: #4a5568;
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
}

.badge-staff {
  background: #e6fffa;
  color: #234e52;
  border: 1px solid #b2f5ea;
}

.badge-student {
  background: #ebf8ff;
  color: #2a4365;
  border: 1px solid #bee3f8;
}

.badge-today {
  background: #fefcbf;
  color: #744210;
  border: 1px solid #ecc94b;
}

.badge-upcoming {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
}

.badge-missed {
  background: #fed7d7;
  color: #9b2c2c;
  border: 1px solid #feb2b2;
}

/* ========== Search Bar ========== */
.search-bar-container {
  position: relative;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
}

.search-bar-container input {
  width: 100%;
  padding-left: 2.4rem;
  padding-right: 2.2rem;
  border-radius: 20px;
  background: #f7fafc;
}

.search-bar-container input:focus {
  background: #fff;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 0.95rem;
  pointer-events: none;
  color: #a0aec0;
}

.btn-clear {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: #a0aec0;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.4rem;
  line-height: 1;
}

.btn-clear:hover {
  color: #4a5568;
}

.contact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid #edf2f7;
}

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

.contact-info {
  flex: 1;
  min-width: 220px;
}

.contact-header-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.contact-header-line strong {
  font-size: 1.05rem;
  color: #1a202c;
}

.contact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.83rem;
  color: #718096;
}

.contact-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.contact-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.contact-actions button {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

/* ========== Today's Birthdays ========== */
.birthday-today-card {
  background: #ffffff;
  border: 1px solid #f6e05e;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.birthday-today-card .info strong {
  font-size: 1.1rem;
  color: #744210;
  display: block;
}

.birthday-today-card .info span {
  font-size: 0.85rem;
  color: #975a16;
}

.birthday-today-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ========== Upcoming Birthdays (Next 7 Days) ========== */
.birthday-upcoming-card {
  background: #ffffff;
  border: 1px solid #bee3f8;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.birthday-upcoming-card .info strong {
  font-size: 1.05rem;
  color: #2b6cb0;
  display: block;
}

.birthday-upcoming-card .info span {
  font-size: 0.85rem;
  color: #4a5568;
}

.upcoming-pill {
  display: inline-block;
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 600;
  margin-left: 0.4rem;
}

/* ========== Missed Birthdays ========== */
.birthday-missed-card {
  background: #ffffff;
  border: 1px solid #feb2b2;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.birthday-missed-card .info strong {
  font-size: 1.05rem;
  color: #9b2c2c;
  display: block;
}

.birthday-missed-card .info span {
  font-size: 0.85rem;
  color: #c53030;
}

.days-ago-pill {
  display: inline-block;
  background: #fff5f5;
  color: #e53e3e;
  border: 1px solid #fed7d7;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 600;
  margin-left: 0.4rem;
}

.btn-mark-done {
  background: #edf2f7;
  color: #4a5568;
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
}

.btn-mark-done:hover {
  background: #e2e8f0;
  color: #2b6cb0;
}

.placeholder {
  color: #a0aec0;
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.95rem;
}

/* ========== Toast Notification ========== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #2d3748;
  color: #fff;
  padding: 0.85rem 1.35rem;
  border-radius: 10px;
  font-size: 0.92rem;
  z-index: 9999;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.9s;
}

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ========== Tabs Toggle ========== */
.tab-toggle-group {
  display: inline-flex;
  background: #edf2f7;
  padding: 0.25rem;
  border-radius: 10px;
  gap: 0.25rem;
}

.btn-tab {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #718096;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tab:hover {
  color: #2d3748;
}

.btn-tab.active {
  background: #ffffff;
  color: #4a5568;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ========== CSV Upload Box ========== */
.visually-hidden-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

.csv-upload-box {
  display: block;
  border: 2px dashed #cbd5e0;
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: #f7fafc;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.csv-upload-box:hover,
.csv-upload-box.dragover {
  border-color: #667eea;
  background: #edf2f7;
}

.csv-icon {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
}

.csv-upload-box h3 {
  font-size: 1.15rem;
  color: #2d3748;
  margin-bottom: 0.25rem;
}

.browse-btn-styled {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.csv-filename-text {
  display: block;
  margin-top: 0.75rem;
  font-weight: 600;
  color: #2b6cb0;
  font-size: 0.9rem;
}

.csv-status-msg {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: center;
  min-height: 1.2rem;
}

.csv-status-msg.error {
  color: #e53e3e;
  font-weight: 600;
}

.csv-status-msg.success {
  color: #38a169;
  font-weight: 600;
}

.csv-status-msg.info {
  color: #3182ce;
  font-weight: 500;
}

.csv-template-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0 0.25rem;
}

.btn-link {
  background: transparent;
  border: none;
  color: #3182ce;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.2rem 0.4rem;
}

.btn-link:hover {
  color: #2b6cb0;
}

/* ========== CSV Preview Table ========== */
#csv-preview-container {
  margin-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 1.25rem;
}

.preview-header {
  margin-bottom: 0.75rem;
}

.preview-header h4 {
  font-size: 1rem;
  color: #2d3748;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  max-height: 320px;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  text-align: left;
}

.preview-table th {
  background: #edf2f7;
  color: #4a5568;
  font-weight: 600;
  padding: 0.65rem 0.75rem;
  position: sticky;
  top: 0;
  z-index: 1;
}

.preview-table td {
  padding: 0.6rem 0.75rem;
  border-top: 1px solid #edf2f7;
  color: #2d3748;
}

.preview-table tr:hover {
  background: #f7fafc;
}

/* ========== Pagination Controls (5 items per page) ========== */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  margin-top: 0.85rem;
  border-top: 1px solid #edf2f7;
}

.pagination-info {
  font-size: 0.85rem;
  color: #718096;
  font-weight: 600;
}

.btn-pagination {
  background: #edf2f7;
  color: #2d3748;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-pagination:hover:not(:disabled) {
  background: #667eea;
  color: #ffffff;
  border-color: #667eea;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.btn-pagination:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f7fafc;
  border-color: #e2e8f0;
  color: #a0aec0;
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
    gap: 0.85rem;
  }
  .form-group {
    min-width: 100%;
  }
  .contact-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .contact-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .birthday-today-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .birthday-today-actions {
    width: 100%;
  }
}

/* ========== Portal Styles ========== */
.portal-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.portal-nav-bar {
  margin-bottom: 1.5rem;
}

.portal-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.2s ease;
}

.portal-back-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}

.portal-hero {
  text-align: center;
  margin-bottom: 2.75rem;
  color: #ffffff;
}

.portal-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.portal-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.portal-subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.portal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 2.25rem 2rem;
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.portal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.16), 0 10px 15px -5px rgba(0, 0, 0, 0.1);
}

.portal-card-icon {
  font-size: 2.75rem;
  margin-bottom: 1rem;
}

.portal-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.6rem;
}

.portal-card p {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
  flex-grow: 1;
}

.portal-btn {
  display: block;
  text-align: center;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.portal-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.45);
  color: #ffffff;
}

.portal-btn-secondary {
  background: #f1f5f9;
  color: #334155;
  box-shadow: none;
  border: 1px solid #cbd5e1;
}

.portal-btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.portal-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  margin-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.portal-footer p {
  margin-bottom: 0.35rem;
}

.portal-dev-credit {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.portal-dev-credit a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.portal-dev-credit a:hover {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* ========== CSV Target Status Selector ========== */
.csv-status-select-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.csv-status-select-card label.field-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.65rem;
}

.csv-radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.csv-radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: #ffffff;
  border: 2px solid #cbd5e0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: #4a5568;
  transition: all 0.2s ease;
  user-select: none;
}

.csv-radio-option:hover {
  border-color: #667eea;
}

.csv-radio-option input[type="radio"] {
  accent-color: #667eea;
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.csv-radio-option.selected {
  border-color: #667eea;
  background: #ebf4ff;
  color: #2b6cb0;
}

/* ========== Contacts Filter Tabs & Batch Actions Bar ========== */
.contacts-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.contacts-filter-tabs {
  display: inline-flex;
  background: #edf2f7;
  padding: 0.25rem;
  border-radius: 9px;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.btn-filter-tab {
  background: transparent;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #718096;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-filter-tab:hover {
  color: #2d3748;
}

.btn-filter-tab.active {
  background: #ffffff;
  color: #2b6cb0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  color: #e53e3e;
  border: 1px solid #feb2b2;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-outline:hover:not(:disabled) {
  background: #fff5f5;
  border-color: #e53e3e;
  box-shadow: 0 2px 4px rgba(229, 62, 62, 0.15);
}

.btn-danger-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== Auth Session Flash Prevention & Loading ========== */
#auth-loading.hidden,
#auth-loading[hidden] {
  display: none !important;
}

.has-session #auth-section {
  display: none !important;
}

.auth-loading-spinner {
  display: inline-block;
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: auth-spin 0.8s linear infinite;
}

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