/* Admin Dealer Applications inbox, Phase 2.
   Reuses the same layout primitives as dealers.css for consistency
   between the two sub-tabs (Dealers / Applications). */

.dla-root {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto; /* fills #lf-view.lf-view-dealer below the subnav strip */
  min-height: 0;
}

.dla-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--lf-border);
  flex-shrink: 0;
}

.dla-top-bar h1 { font-size: 22px; font-weight: 700; margin: 0; }
.dla-actions { display: flex; gap: 8px; }

.dla-main {
  display: grid;
  grid-template-columns: var(--lf-list-w, 340px) 1fr;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ─── List panel ──────────────────────────────────────────────────── */

.dla-list-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--lf-border);
  background: var(--lf-bg);
  min-height: 0;
  overflow: hidden;
}

.dla-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px 8px;
}

.dla-chip {
  background: var(--lf-panel);
  color: var(--lf-text);
  border: 1px solid var(--lf-border);
  border-radius: var(--radius-pill, 999px);
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.dla-chip:hover { background: var(--lf-panel-hover); }
.dla-chip.active {
  background: var(--lf-accent-bg);
  border-color: var(--lf-accent);
  color: var(--lf-accent);
}

.dla-search {
  margin: 4px 16px 12px;
  background: var(--lf-input-bg);
  color: var(--lf-text);
  border: 1px solid var(--lf-border);
  border-radius: var(--radius-sm, 8px);
  padding: 7px 12px;
  font-size: 13px;
  height: 34px;
}
.dla-search:focus-visible { outline: 2px solid var(--lf-accent); outline-offset: 1px; }

.dla-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 8px 16px;
}

.dla-row {
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 8px);
  padding: 10px 12px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.dla-row:hover { background: var(--lf-panel-hover); }
.dla-row:focus-visible { outline: 2px solid var(--lf-accent); outline-offset: -2px; }
.dla-row.selected { background: var(--lf-accent-bg); border-color: var(--lf-accent); }
.dla-row-name {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}
.dla-row-sub { font-size: 12px; color: var(--lf-text-muted); margin-bottom: 6px; }
.dla-row-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.dla-row-age { font-size: 11px; color: var(--lf-text-muted); }

.dla-doc-badge {
  font-size: 11px;
  color: var(--lf-text-muted);
  background: var(--lf-panel);
  border: 1px solid var(--lf-border);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ─── Pills ──────────────────────────────────────────────────────── */

.dla-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-pill, 999px);
  border: 1px solid transparent;
}
.dla-pill-new {
  background: var(--lf-info-bg);
  color: var(--lf-info);
  border-color: var(--lf-info-border);
}
.dla-pill-reviewing {
  background: var(--lf-panel);
  color: var(--lf-purple);
  border-color: var(--lf-purple);
}
.dla-pill-approved {
  background: var(--lf-success-bg);
  color: var(--lf-success);
  border-color: var(--lf-success-border);
}
.dla-pill-rejected {
  background: var(--lf-warn-bg);
  color: var(--lf-warn);
  border-color: var(--lf-warn-border);
}
.dla-pill-withdrawn {
  background: var(--lf-panel);
  color: var(--lf-text-muted);
  border-color: var(--lf-border);
}

/* ─── Detail panel ───────────────────────────────────────────────── */

.dla-detail-panel {
  background: var(--lf-bg);
  overflow-y: auto;
  padding: 0;
  min-height: 0;
}

.dla-empty-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--lf-text-dim);
  font-size: 14px;
}

.dla-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--lf-border);
  position: sticky;
  top: 0;
  background: var(--lf-bg);
  z-index: 1;
}

.dla-detail-title h2 { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.dla-detail-sub {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
}
.dla-muted { color: var(--lf-text-muted); }

.dla-detail-body {
  padding: 16px 24px 32px;
  display: grid;
  gap: 16px;
}

.dla-card {
  background: var(--lf-panel);
  border: 1px solid var(--lf-border);
  border-radius: var(--radius, 12px);
  padding: 16px 20px;
}

.dla-card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }

.dla-card-decision {
  background: var(--lf-warn-bg);
  border-color: var(--lf-warn-border);
}

.dla-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 24px;
  margin: 0;
}
.dla-kv div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dla-kv dt { font-size: 11px; color: var(--lf-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dla-kv dd {
  font-size: 14px;
  color: var(--lf-text);
  margin: 0;
  word-break: break-word;
}
.dla-kv a { color: var(--lf-accent); text-decoration: none; }
.dla-kv a:hover { text-decoration: underline; }

.dla-notes {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--lf-bg);
  border: 1px solid var(--lf-border);
  border-radius: var(--radius-sm, 8px);
  font-size: 14px;
}
.dla-notes strong { display: block; font-size: 11px; color: var(--lf-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.dla-notes p { margin: 0; white-space: pre-wrap; line-height: 1.5; }

/* ─── Documents grid ─────────────────────────────────────────────── */

.dla-docs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.dla-doc-row {
  display: flex;
  gap: 12px;
  background: var(--lf-bg);
  border: 1px solid var(--lf-border);
  border-radius: var(--radius-sm, 8px);
  padding: 10px;
  align-items: center;
}

.dla-doc-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm, 8px);
  background: var(--lf-panel);
  border: 1px solid var(--lf-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--lf-text-muted);
  text-decoration: none;
  overflow: hidden;
}
.dla-doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dla-doc-thumb-pdf { color: var(--lf-error); }
.dla-doc-thumb-pending { color: var(--lf-warn); font-style: italic; }

.dla-doc-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.dla-doc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--lf-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}
.dla-doc-info {
  font-size: 11px;
  color: var(--lf-text-muted);
  margin-bottom: 4px;
}
.dla-doc-dl {
  font-size: 12px;
  color: var(--lf-accent);
  text-decoration: none;
}
.dla-doc-dl:hover { text-decoration: underline; }

.dla-empty-docs { font-size: 13px; padding: 8px 0; }

/* ─── Decision actions ───────────────────────────────────────────── */

.dla-decision-actions {
  display: flex;
  gap: 12px;
  padding: 12px 0;
}

.dla-decision-actions.dla-muted {
  font-size: 13px;
  color: var(--lf-text-muted);
}

.dla-btn {
  background: var(--lf-btn-bg);
  color: var(--lf-text);
  border: 1px solid var(--lf-border);
  border-radius: var(--radius-sm, 8px);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.dla-btn:hover { background: var(--lf-btn-hover); }
.dla-btn:focus-visible { outline: 2px solid var(--lf-accent); outline-offset: 1px; }
.dla-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.dla-btn-primary {
  background: var(--lf-success);
  color: var(--lf-bg);
  border-color: var(--lf-success);
  filter: brightness(1);
}
.dla-btn-primary:hover {
  filter: brightness(0.9);
}

.dla-btn-secondary {
  background: var(--lf-panel);
}

.dla-btn-danger {
  background: var(--lf-error);
  color: var(--lf-bg);
  border-color: var(--lf-error);
  filter: brightness(1);
}
.dla-btn-danger:hover {
  filter: brightness(0.9);
}

/* ─── Empty / loading / error states ─────────────────────────────── */

.dla-loading,
.dla-empty {
  padding: 20px 16px;
  font-size: 13px;
  color: var(--lf-text-muted);
  text-align: center;
}

.dla-error {
  padding: 16px;
  border: 1px solid var(--lf-error-border);
  border-radius: var(--radius-sm, 8px);
  background: var(--lf-error-bg);
  color: var(--lf-error);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  margin: 12px;
}

.dla-error-msg { font-size: 13px; }

@media (max-width: 900px) {
  .dla-main { grid-template-columns: 1fr; }
  .dla-list-panel { border-right: none; border-bottom: 1px solid var(--lf-border); max-height: 40vh; }
}
