/* eBONDS Portal v3 — Global Design System
   Based on eBONDS Design Guide (Genesis World, April 2026)
   Fonts: Fira Sans + Bebas Neue (Google Fonts)
*/

@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:wght@200;300;400;500;600;700;800&family=Bebas+Neue&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  --dark-blue:   #1B458B;
  --mid-blue:    #488AC9;
  --light-blue:  #ddeeff;
  --bg:          #eef1f6;
  --white:       #ffffff;
  --text:        #2c3a4a;
  --text-muted:  #6b7a8d;
  --border:      #cdd5e0;
  --success:     #27ae60;
  --danger:      #c0392b;
  --warning:     #e67e22;
  --card-shadow: 0 2px 14px rgba(27,69,139,0.11);
  --radius:      10px;
  --header-gradient: linear-gradient(135deg, #1B458B 0%, #1e4fa3 60%, #2a65c2 100%);
  --btn-gradient:    linear-gradient(135deg, var(--dark-blue), var(--mid-blue));
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Fira Sans', Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--mid-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.bebas { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.04em; }

h1, h2, h3, h4 { font-family: 'Bebas Neue', sans-serif; color: var(--dark-blue); letter-spacing: 0.04em; }
h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }

.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.uc           { text-transform: uppercase; }

/* ============================================================
   LAYOUT
   ============================================================ */
.page-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 28px 60px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-gap    { gap: 12px; }
.flex-wrap   { flex-wrap: wrap; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  height: 66px;
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--header-gradient);
  box-shadow: 0 3px 12px rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
}

.site-header .logo {
  height: 50px;
  width: auto;
  display: block;
}

.site-header .logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: white;
  letter-spacing: 0.06em;
}

.site-header .header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-btn {
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.28);
  color: white;
  border-radius: 7px;
  font-family: 'Fira Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.18s;
  white-space: nowrap;
}

.header-btn:hover { background: rgba(255,255,255,0.24); }
.header-btn.active { background: rgba(255,255,255,0.28); }

.nav-breadcrumb {
  font-family: 'Fira Sans', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-breadcrumb a { color: rgba(255,255,255,0.85); }
.nav-breadcrumb .sep { color: rgba(255,255,255,0.4); }
.nav-breadcrumb .current { color: white; font-weight: 600; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.card-header {
  background: var(--header-gradient);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3,
.card-header h4 {
  font-family: 'Bebas Neue', sans-serif;
  color: white;
  margin: 0;
  letter-spacing: 0.04em;
}

.card-header h3 { font-size: 18px; }
.card-header h4 { font-size: 16px; }

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #f8fafd;
}

/* Module card (landing page) */
.module-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
  cursor: pointer;
}

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(27,69,139,0.18);
}

.module-card .card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--btn-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.module-card .card-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: white;
  stroke-width: 1.8;
}

.module-card .card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--dark-blue);
  margin-bottom: 8px;
}

.module-card .card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 8px;
  font-family: 'Fira Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 20px;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover   { opacity: 0.9; }
.btn:active  { transform: scale(0.99); }
.btn:disabled{ opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--btn-gradient);
  color: white;
}

.btn-secondary {
  background: var(--bg);
  color: var(--dark-blue);
  border: 1.5px solid var(--border);
}

.btn-success {
  background: linear-gradient(135deg, #219a52, #27ae60);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #a93226, #c0392b);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, #ca6f1e, #e67e22);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--dark-blue);
  border: 1.5px solid var(--dark-blue);
}

.btn-sm {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 7px;
}

.btn-lg {
  font-size: 15px;
  padding: 12px 28px;
}

.btn-icon {
  padding: 8px;
  border-radius: 7px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}

.btn-icon:hover { background: var(--bg); color: var(--dark-blue); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

label, .form-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: 'Fira Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: white;
  transition: border-color 0.18s, box-shadow 0.18s;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mid-blue);
  box-shadow: 0 0 0 3px rgba(72,138,201,0.15);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a8d' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

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

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-help { font-size: 12px; color: var(--text-muted); }
.form-error { font-size: 12px; color: var(--danger); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.14s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f4f7fb; }

tbody td {
  padding: 11px 14px;
  color: var(--text);
  vertical-align: middle;
}

/* ============================================================
   STATUS BADGES & PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Tenant status badges */
.badge-live       { background: #d4f5e4; color: #0d6e36; }
.badge-integrating{ background: #ddeeff; color: #1B458B; }
.badge-blocked    { background: #fde8e8; color: #c0392b; }
.badge-onhold     { background: #fef9e7; color: #7d6608; }
.badge-dead       { background: #e8eaf0; color: #5a6478; }
.badge-awaiting   { background: #ede0f7; color: #6c3483; }
.badge-default    { background: #eeeeee; color: #555555; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,25,50,0.62);
  backdrop-filter: blur(3px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  transform: translateY(-16px) scale(0.97);
  transition: transform 0.22s;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1000px; }

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

.modal-header h3 {
  font-size: 24px;
  color: var(--dark-blue);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.modal-close:hover { background: var(--bg); }

.modal-body    { padding: 24px 28px; }
.modal-footer  { padding: 16px 28px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #1a2a40;
  color: white;
  padding: 14px 20px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: all;
  max-width: 340px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.toast.show  { opacity: 1; transform: translateY(0); }
.toast.hide  { opacity: 0; transform: translateY(-10px); }

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--mid-blue); }

/* ============================================================
   LOADING BAR
   ============================================================ */
#loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 9999;
  background: linear-gradient(90deg, var(--mid-blue), #7ec8f5);
  transition: width 0.4s ease;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h4 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13.5px;
}

/* ============================================================
   DETAIL FIELD PAIRS (label + value)
   ============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px 24px;
}

.detail-field .dfl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.detail-field .dfv {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.detail-field .dfv.large {
  font-size: 22px;
  font-weight: 600;
  color: var(--dark-blue);
}

/* ============================================================
   STAT TILES
   ============================================================ */
.stat-tile {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-tile .stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.stat-tile .stat-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px;
  color: var(--dark-blue);
  line-height: 1;
}

.stat-tile .stat-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   PAGE TITLE BAR
   ============================================================ */
.page-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--border);
}

.page-title-bar h2 {
  font-size: 30px;
}

/* ============================================================
   SECTION TABS
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 24px;
  gap: 4px;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'Fira Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
  margin-bottom: -1.5px;
}

.tab-btn:hover { color: var(--dark-blue); }

.tab-btn.active {
  color: var(--dark-blue);
  border-bottom-color: var(--dark-blue);
  font-weight: 700;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
  position: relative;
  max-width: 320px;
}

.search-bar input {
  padding-left: 38px;
  background: var(--bg);
}

.search-bar input:focus { background: white; }

.search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ============================================================
   EXTENSION CARDS
   ============================================================ */
.ext-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
}

.ext-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(27,69,139,0.16);
}

.ext-card .ext-header {
  background: var(--header-gradient);
  padding: 18px 20px 14px;
}

.ext-card .ext-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: white;
  letter-spacing: 0.04em;
}

.ext-card .ext-version {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}

.ext-card .ext-body {
  padding: 16px 20px;
  flex: 1;
}

.ext-card .ext-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.ext-card .ext-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #f8fafd;
  display: flex;
  gap: 8px;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--header-gradient);
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-card .login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-card .login-logo .logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  color: var(--dark-blue);
  letter-spacing: 0.06em;
  display: block;
  margin-top: 10px;
}

.login-card h2 {
  font-size: 26px;
  text-align: center;
  margin-bottom: 28px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .page-wrap { padding: 20px 16px 48px; }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .site-header { padding: 0 16px; }
  .site-header .logo-text { font-size: 22px; }
  .page-wrap { padding: 16px 12px 40px; }
  h1 { font-size: 28px; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* Scroll indicator */
.scrollable { overflow-y: auto; }

/* ============================================================
   SIDEBAR LAYOUT (Tenant Tracker dashboard)
   ============================================================ */
.tracker-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .tracker-layout { grid-template-columns: 1fr; }
}
