/* ==========================================================================
   Society Dekho - Minimalist UI Components
   Matched to the modern mobile & desktop design system
   Strictly NO emojis - Clean SVG Icons only
   ========================================================================== */

/* Typography Helpers */
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 15.5px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-3xl { font-size: 28px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-emerald { color: var(--emerald); }
.text-amber { color: var(--amber); }
.text-rose { color: var(--rose); }

/* Flex & Grid Helpers */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 12px; }
}

/* Modern Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-smooth);
}

.card:hover {
  border-color: #cbd5e1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background-color: var(--bg-muted);
  color: var(--text-main);
}

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

.btn-success {
  background-color: var(--emerald);
  color: #ffffff;
}

.btn-success:hover {
  background-color: #15803d;
}

.btn-outline {
  background-color: #ffffff;
  border-color: var(--border-light);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-muted);
  border-color: #cbd5e1;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background-color: var(--bg-muted);
  color: var(--text-main);
}

.btn-danger {
  background-color: var(--rose);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  min-height: 32px;
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 11px 24px;
  font-size: 14.5px;
  min-height: 44px;
  border-radius: var(--radius-sm);
}

.btn-full {
  width: 100%;
}

/* Filter Tab Pills */
.filter-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.filter-pills-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.filter-pill:hover {
  background: var(--bg-muted);
  color: var(--text-main);
}

.filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-paid {
  background-color: var(--emerald-light);
  color: var(--emerald);
}

.badge-due, .badge-pending {
  background-color: var(--rose-light);
  color: var(--rose);
}

.badge-progress {
  background-color: var(--amber-light);
  color: var(--amber);
}

.badge-resolved {
  background-color: var(--emerald-light);
  color: var(--emerald);
}

.badge-high {
  background-color: var(--rose-light);
  color: var(--rose);
}

.badge-general {
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge-event {
  background-color: var(--purple-light);
  color: var(--purple);
}

.badge-owner {
  background-color: var(--bg-muted);
  color: var(--text-main);
}

.badge-tenant {
  background-color: #fff7ed;
  color: #c2410c;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-main);
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: var(--transition-smooth);
  min-height: 42px;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-light);
  pointer-events: none;
}

.search-input {
  padding-left: 36px;
  border-radius: var(--radius-full);
  background-color: var(--bg-muted);
  border: 1px solid transparent;
}

.search-input:focus {
  background-color: #ffffff;
  border-color: var(--border-focus);
}

/* Dotted Upload Box */
.upload-image-box {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-muted);
}

.upload-image-box:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Data Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  min-width: 580px;
}

.data-table th {
  background-color: var(--bg-muted);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background-color: #f8fafc;
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.96);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-dialog-lg {
  max-width: 720px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background-color: var(--bg-muted);
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background-color: #f8fafc;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
}

.toast-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  line-height: 1.2;
}

.toast-msg {
  font-size: 11.5px;
  color: #cbd5e1;
  margin-top: 1px;
}

@media (max-width: 640px) {
  .toast-container {
    bottom: 70px;
    right: 12px;
    left: 12px;
  }
  .toast {
    min-width: 100%;
    max-width: 100%;
  }
}
