/* ===================================================
   Rega Base Styles
   Shared dark + gold foundation for all portals
   (login, admin, agent tools)
   =================================================== */

/* ---------- GLOBAL RESET / TYPOGRAPHY ---------- */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  /* Default dark background; page-specific CSS can override if needed */
  background: radial-gradient(circle at top, #020617 0, #000000 55%, #020617 100%);
  color: #e5e7eb;
}

/* Simple utility margins */
.mt-8  { margin-top: 8px; }
.mt-10 { margin-top: 10px; }

/* Tiny text helper */
.small-text {
  font-size: 0.76rem;
  color: #9ca3af;
}

/* ---------- BRAND IDENTITY BLOCK ---------- */

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 44px;
  width: auto;
  opacity: 0.95;
}

.brand-text h1 {
  margin: 1px 0 3px;
  font-size: 0.98rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f9fafb;
}

.brand-line-top {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ca3af;
}

.brand-text p {
  margin: 0;
  font-size: 0.82rem;
  color: #9ca3af;
}

/* Variant used on login (centered brand) */
.brand-block-center {
  text-align: center;
}

.brand-block-center .brand-logo {
  height: 70px;
  margin-bottom: 14px;
}

.brand-title-main {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9ca3af;
  margin-bottom: 2px;
}

.brand-title-sub {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #f9fafb;
  margin: 0;
}

.brand-tagline {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 6px 0 4px;
}

/* Optional decorative divider */
.luxury-divider {
  width: 80px;
  height: 1px;
  margin: 10px auto 18px;
  background: linear-gradient(
    90deg,
    rgba(212, 175, 55, 0) 0%,
    rgba(212, 175, 55, 0.7) 50%,
    rgba(212, 175, 55, 0) 100%
  );
}

/* ---------- BADGES / TAGS ---------- */

.badge {
  font-size: 0.78rem;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

.card-tag {
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

/* ---------- BUTTONS (BASE) ---------- */

.btn {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.84rem;
  cursor: pointer;
  border: 1px solid #4b5563;
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: 0.2s ease;
}

.btn:hover {
  background: rgba(30, 64, 175, 0.25);
  border-color: #6b7280;
}

/* Gold primary button */
.btn-primary {
  border-color: #c19a2f;
  background: linear-gradient(135deg, #d4af37 0%, #b9972b 100%);
  color: #111827;
  font-weight: 600;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f5d776 0%, #e2b94c 100%);
  border-color: #e0ba49;
  box-shadow:
    0 0 10px rgba(245, 215, 118, 0.3),
    0 0 18px rgba(245, 215, 118, 0.18);
}

/* Danger / logout */
.btn-danger {
  border-color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #f87171;
}

/* Common button row layout */
.btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ---------- CARD (BASE) ---------- */

.card {
  position: relative;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 18px;
  border: 1px solid rgba(31, 41, 55, 0.8);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  padding: 18px 16px 18px;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(212, 175, 55, 0.18);
  pointer-events: none;
}

/* Card header style used in admin and other panels */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-header h2 {
  margin: 0;
  font-size: 0.98rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f9fafb;
}

.card-header p {
  margin: 3px 0 0;
  font-size: 0.84rem;
  color: #9ca3af;
}

/* ---------- FORMS & INPUTS ---------- */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="file"] {
  border-radius: 9px;
  border: 1px solid #4b5563;
  background: rgba(15, 23, 42, 0.96);
  padding: 7px 9px;
  font-size: 0.84rem;
  color: #e5e7eb;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder {
  color: #6b7280;
}

input:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.4);
  background: rgba(15, 23, 42, 0.98);
}

/* Shared grid form layout (two columns, can be overridden) */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

@media (max-width: 800px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Inline label group for radios / checkboxes */
.field-row-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-row-inline label span {
  font-size: 0.8rem;
  color: #e5e7eb;
}

.field-row-inline input[type="radio"],
.field-row-inline input[type="checkbox"] {
  margin-right: 4px;
}

/* ---------- TABLES / LISTS (COMMON) ---------- */

.table-wrapper {
  overflow-x: auto;
  max-height: 320px;
  border-radius: 12px;
  border: 1px solid #1f2933;
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.list-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.list-table th,
.list-table td {
  padding: 7px 10px;
  text-align: left;
  white-space: nowrap;
}

.list-table thead th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  background: rgba(15, 23, 42, 0.98);
  border-bottom: 1px solid #1f2937;
}

.list-table tbody tr {
  border-bottom: 1px solid rgba(31, 41, 55, 0.8);
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.list-table tbody tr:last-child {
  border-bottom: none;
}

.list-table tbody tr:hover {
  background: rgba(30, 64, 175, 0.18);
  box-shadow: inset 2px 0 0 rgba(212, 175, 55, 0.4);
}

.list-table tbody tr.row-selected {
  background: rgba(15, 23, 42, 0.9);
  box-shadow:
    inset 2px 0 0 rgba(212, 175, 55, 0.9),
    0 0 0 1px rgba(30, 64, 175, 0.6);
}

.list-table td {
  color: #e5e7eb;
}

/* ---------- ROLE & STATUS PILLS (COMMON) ---------- */

.role-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.72rem;
  border: 1px solid transparent;
}

.role-agent {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(55, 65, 81, 0.9);
  color: #e5e7eb;
}

.role-admin {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.75);
  color: #facc15;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.74rem;
  border: 1px solid transparent;
}

.status-pill.active {
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(22, 163, 74, 0.8);
  color: #bbf7d0;
}

.status-pill.inactive {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.85);
  color: #e5e7eb;
}

.status-subtag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fbbf24;
}

/* ---------- RESPONSIVE HELPERS ---------- */

@media (max-width: 640px) {
  .table-wrapper {
    max-height: 260px;
  }
}
