/* ════════════════════════════════════════════════════════════
   SHARED UI COMPONENTS & UTILITIES (LIGHT COMPACT DEFAULT)
   Buttons, Modals, Form Controls, Badges, PTR/PTS Calculator FAB
   ════════════════════════════════════════════════════════════ */

/* EMOJI PICKER BUTTONS */
.btn-emoji-pick {
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-color, #CBD5E1);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-emoji-pick:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: #2563EB;
  transform: scale(1.15);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.98) !important;
}

.btn-primary {
  background: #2563EB;
  color: #FFFFFF !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
  border: 1px solid #1D4ED8;
}

.btn-primary:hover {
  background: #1D4ED8;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #0F172A;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
  color: #0F172A;
}

.btn-danger {
  background: #FFE4E6;
  border: 1px solid #FECDD3;
  color: #E11D48;
}

.btn-danger:hover {
  background: #E11D48;
  color: #FFFFFF !important;
}

.btn-developer {
  background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
  color: #FFFFFF !important;
  border: 1px solid #5B21B6;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.btn-developer:hover {
  background: linear-gradient(135deg, #6D28D9 0%, #5B21B6 100%);
}

.btn-sm {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.w-full {
  width: 100%;
}

/* FORM CONTROLS */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ════════════════════════════════════════════════════════════
   MICROSOFT EXCEL COMPACT DENSITY TABLE DESIGN SYSTEM
   ════════════════════════════════════════════════════════════ */
.excel-table, .data-table, .reports-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-family: var(--font-body);
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
}

.excel-table th, .data-table th, .reports-list-table th {
  background: #E2E8F0;
  color: #0F172A;
  font-weight: 800;
  text-align: left;
  padding: 3px 8px;
  height: 24px;
  border: 1px solid #CBD5E1;
  font-family: var(--font-heading);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.excel-table td, .data-table td, .reports-list-table td {
  padding: 2px 8px;
  height: 23px;
  border: 1px solid #E2E8F0;
  color: #0F172A;
  white-space: nowrap;
  line-height: 1.2;
}

.excel-table tr:nth-child(even) td, .data-table tr:nth-child(even) td, .reports-list-table tr:nth-child(even) td {
  background: #F8FAFC;
}

.excel-table tr:hover td, .data-table tr:hover td, .reports-list-table tr:hover td {
  background: #BAE6FD !important;
}

.form-control {
  width: 100%;
  padding: 6px 10px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12.5px;
  outline: none;
  transition: var(--transition);
}

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

/* MODALS */
.modal-backdrop,
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active,
.modal-backdrop.open,
.modal-overlay.open,
.modal-overlay.active {
  display: flex !important;
}

.modal-card {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2) !important;
  max-height: 90vh;
  width: 95%;
  max-width: 680px;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-close:hover {
  color: #E11D48;
  border-color: #FECDD3;
}

/* FLOATING ACTION BUTTON (FAB) FOR PTR/PTS CALCULATOR */
.fab-calc-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-calc-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.5);
}

.fab-calc-btn:active {
  transform: scale(0.95);
}

/* PTR / PTS PRICE CALCULATOR INSIDE MODAL */
.ptr-pts-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-left: 4px solid #2563EB;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.ptr-pts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 10px;
}

.ptr-pts-title {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ptr-pts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.ptr-pts-input-box {
  display: flex;
  flex-direction: column;
}

.ptr-pts-input-box label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.ptr-pts-input-box input {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  color: #0F172A;
  background: #F8FAFC;
  outline: none;
}

.ptr-pts-input-box input:focus {
  border-color: #2563EB;
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.ptr-pts-result-box {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ptr-pts-result-box.pts-box {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

.ptr-pts-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #166534;
}

.pts-box .ptr-pts-label {
  color: #1E40AF;
}

.ptr-pts-val {
  font-size: 16px;
  font-weight: 800;
  color: #15803D;
  font-family: var(--font-mono);
}

.pts-box .ptr-pts-val {
  color: #2563EB;
}

.ptr-pts-profit {
  font-size: 10.5px;
  color: #475569;
  margin-top: 3px;
  font-weight: 600;
}

/* BADGES & STATUS PILLS */
.badge-tenant {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.badge-dev {
  background: #F3E8FF;
  color: #6B21A8;
  border: 1px solid #E9D5FF;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* TOAST NOTIFICATIONS */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 88px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: #FFF;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-info { background: #2563EB; }
.toast-success { background: #059669; }
.toast-error { background: #E11D48; }

/* UNIFIED PORTAL TOP NAVIGATION BAR */
.hub-header {
  background: linear-gradient(135deg, #0B1727 0%, #0F2744 50%, #111C38 100%) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 4px 20px rgba(11, 23, 39, 0.4) !important;
}

.hub-header .brand-title {
  color: #FFFFFF !important;
}

.hub-header .brand-tagline {
  color: #94A3B8 !important;
}

.portal-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.7) !important;
  padding: 3px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.portal-tab-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  color: #CBD5E1 !important;
  transition: all 0.2s ease;
}

.portal-tab-link:hover {
  color: #FFFFFF !important;
  background: rgba(255, 255, 255, 0.15) !important;
}

.portal-tab-link.active {
  background: linear-gradient(135deg, #3B82F6, #1D4ED8) !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.45) !important;
}
