/* ==========================================================================
   K5 Investment Group — portal.css
   Shell, auth, tables, KPIs, pills, property cards, toolbar.
   Paired with main.css (brand tokens).
   ========================================================================== */

.body--portal main { padding: 0; }

/* Auth pages */
.auth-wrap {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background:
    radial-gradient(circle at 20% 100%, rgba(184,135,45,.1), transparent 55%),
    linear-gradient(170deg, #FAFAF7 0%, #F5ECD7 100%);
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.2rem 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.auth-card .muted { font-size: .92rem; margin-bottom: 1.4rem; }
.auth-card__foot {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  font-size: .88rem;
  color: var(--slate-soft);
  text-align: center;
}

/* Flash messages */
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 1.2rem;
  font-size: .92rem;
  border: 1px solid transparent;
}
.flash--ok    { background: #EEF9F0; color: #1F6E3D; border-color: #C7E8D3; }
.flash--error { background: #FCECEC; color: #8B1E1E; border-color: #F4C7C7; }

/* Shell (sidebar + main) */
.shell-wrap {
  background: linear-gradient(180deg, #F5ECD7 0%, var(--bg) 220px);
  padding: 2.5rem 0 4rem;
  min-height: calc(100vh - 80px);
}
.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}
.shell__nav {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: sticky;
  top: 84px;
}
.shell__nav-head {
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.shell__nav-head strong {
  display: block;
  font-family: var(--font-display);
  color: var(--navy);
  font-size: 1.1rem;
}
.shell__nav-head small {
  font-size: .78rem;
  color: var(--slate-soft);
  display: block;
  margin-top: 2px;
  word-break: break-all;
}
.shell__nav-list { display: grid; gap: 2px; }
.shell__nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--slate);
  font-weight: 500;
  font-size: .93rem;
}
.shell__nav-link:hover { background: var(--light-gold); color: var(--navy); }
.shell__nav-link.is-active {
  background: var(--navy);
  color: #fff;
}
.shell__nav-link.is-active:hover { background: var(--navy-deep); color: #fff; }
.shell__nav-icon {
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}
.shell__main {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  min-width: 0;
}
.shell__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}
.shell__head h1 {
  font-size: 1.6rem;
  margin: 0;
}
.shell__head .btn { flex-shrink: 0; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .shell__nav { position: static; }
}

/* KPI cards */
.kpi-row {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 2rem;
}
.kpi {
  background: var(--light-gold);
  border-radius: 12px;
  padding: 1.2rem 1.3rem;
  border: 1px solid rgba(184,135,45,.2);
}
.kpi strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
}
.kpi span {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--gold);
  font-weight: 600;
}

/* Data tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table thead th {
  background: var(--navy);
  color: #fff;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
}
.data-table tbody tr:nth-child(even) { background: #FBF9F2; }
.data-table tbody tr:hover { background: var(--light-gold); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table a { color: var(--navy); font-weight: 500; }
.data-table a:hover { color: var(--gold); }
.data-table__empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--slate-soft);
}

/* Data-table layout polish
 * - .cell-property / .cell-guest force reasonable column widths so names
 *   don't collapse into single-word columns on narrow viewports.
 * - Emails use overflow-wrap:anywhere (break only if a word is too long),
 *   NOT word-break:break-all (which chops every character).
 * - .num right-aligns numeric columns for easy scanning.
 * - .data-table-wrap lets the whole table scroll sideways instead of
 *   squashing — the right answer for narrow viewports / sidecar windows.
 */
.data-table          { table-layout: auto; }
.data-table td.cell-guest    { min-width: 180px; line-height: 1.4; }
.data-table td.cell-property { min-width: 200px; line-height: 1.4; }
.data-table td.cell-status   { min-width: 140px; line-height: 1.5; }
.data-table td.num,
.data-table th.num           { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .email           { overflow-wrap: anywhere; word-break: normal; }
.data-table .nowrap          { white-space: nowrap; }

.data-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.data-table-wrap .data-table { border: 0; border-radius: 0; }

/* A <button> styled to look like a plain text link — used for inline actions
 * inside tables where a full <a> would need a separate form wrapper. */
.linklike {
  background: none; border: 0; padding: 0; font: inherit; color: var(--navy);
  cursor: pointer; font-weight: 500;
}
.linklike:hover { color: var(--gold); text-decoration: underline; }

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: #EEE;
  color: #555;
  white-space: nowrap;
}
.pill--requested { background: #FFF4DD; color: #8B6A14; }
.pill--approved  { background: #DEF6E4; color: #1F6E3D; }
.pill--denied    { background: #FCECEC; color: #8B1E1E; }
.pill--cancelled { background: #ECECEC; color: #4B5563; }
.pill--completed { background: #E5EAF4; color: #0B2545; }
.pill--handled   { background: #DEF6E4; color: #1F6E3D; }
.pill--open      { background: #FFF4DD; color: #8B6A14; }
.pill--admin     { background: #E5EAF4; color: #0B2545; }
.pill--guest     { background: #F5ECD7; color: #8B6A14; }
.pill--active    { background: #DEF6E4; color: #1F6E3D; }
.pill--hidden    { background: #ECECEC; color: #4B5563; }
.pill--paid      { background: #DEF6E4; color: #1F6E3D; }
.pill--deposit   { background: #F5ECD7; color: #8B6A14; }
.pill--pending   { background: #FFF4DD; color: #8B6A14; }
.pill--owed      { background: #FCECEC; color: #8B1E1E; }

/* Property admin card (admin properties list) */
.property-list {
  display: grid;
  gap: 14px;
}
.property-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--white);
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.property-row:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.property-row__img {
  width: 88px; height: 66px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(11,37,69,.7), rgba(184,135,45,.4));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.6);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.property-row__body h3 {
  font-size: 1.05rem;
  margin: 0 0 4px;
}
.property-row__body p {
  font-size: .85rem;
  color: var(--slate-soft);
  margin: 0;
}
.property-row__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
@media (max-width: 640px) {
  .property-row { grid-template-columns: 68px 1fr; }
  .property-row__actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Toolbar */
.portal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 1.4rem;
}
.portal-toolbar .spacer { flex: 1; }

/* Two-column layout inside portal */
.portal-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) { .portal-two-col { grid-template-columns: 1fr; } }

/* Panels */
.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.4rem;
}
.panel h2, .panel h3 { margin-top: 0; }
.panel--cream { background: var(--light-gold); border-color: rgba(184,135,45,.25); }

/* Definition-style rows (booking/inquiry detail) */
.dl-grid {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px 20px;
  font-size: .95rem;
}
.dl-grid dt { color: var(--slate-soft); font-weight: 500; }
.dl-grid dd { margin: 0; color: var(--navy); font-weight: 500; word-break: break-word; }
@media (max-width: 560px) { .dl-grid { grid-template-columns: 1fr; gap: 4px; } .dl-grid dd { margin-bottom: 10px; } }

/* Button row */
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.btn-row form { display: inline; }

/* Small helpers */
.right  { text-align: right; }
.nowrap { white-space: nowrap; }
.tiny   { font-size: .8rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
