/* ============ FLASH MESSAGES ============ */
.alert-wrap { max-width: 1280px; margin: 0 auto; padding: 16px 32px 0; }
.alert {
  display: flex; align-items: center; gap: 10px; text-align: left;
  border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px; margin-bottom: 12px; line-height: 1.5;
}
.alert svg { flex-shrink: 0; width: 18px; height: 18px; }
.alert-error {
  background: var(--status-rejected-bg); color: var(--status-rejected);
  border: 1px solid #fecaca;
}
.alert-success {
  background: var(--status-approved-bg); color: var(--status-approved);
  border: 1px solid #a7f3d0;
}
@media (max-width: 900px) {
  .alert-wrap { padding: 14px 20px 0; }
}
@media (max-width: 560px) {
  .alert-wrap { padding: 12px 16px 0; }
}

/* ============ CARDS ============ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
}
.card-accent { position: relative; }
.card-accent::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cyan);
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-header .card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 4px;
}
.card-count {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  padding: 3px 8px;
  background: var(--status-neutral-bg);
  color: var(--status-neutral);
  border-radius: 999px;
  font-weight: 500;
}
.card-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--row-stripe);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============ TABLES ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px;
  background: var(--row-stripe);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--row-hover); }
tbody tr:last-child td { border-bottom: none; }

.deal-link {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.15s;
}
.deal-link:hover { color: var(--cyan-2); }
.deal-link .arrow {
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.15s;
  color: var(--cyan);
}
.deal-link:hover .arrow { opacity: 1; transform: translateX(0); }
.deal-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--cyan-soft);
  color: var(--cyan-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.col-date {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--text-secondary);
}
.col-date small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.date-tag {
  display: inline-block;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 2px;
}
.date-tag-est { color: var(--text-secondary); background: var(--status-neutral-bg); }
.date-tag-closed { color: var(--status-approved); background: var(--status-approved-bg); }
.date-tag-none { color: var(--text-muted); background: var(--status-neutral-bg); }

/* ============ STATUS BADGES ============ */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-requested { color: var(--status-requested); background: var(--status-requested-bg); }
.status-uploaded { color: var(--status-uploaded); background: var(--status-uploaded-bg); }
.status-approved { color: var(--status-approved); background: var(--status-approved-bg); }
.status-rejected { color: var(--status-rejected); background: var(--status-rejected-bg); }
.status-neutral { color: var(--status-neutral); background: var(--status-neutral-bg); }

.status-pill-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-pill-lg::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.tag-object {
  display: inline-block;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  background: var(--status-neutral-bg);
  color: var(--text-secondary);
  border-radius: 4px;
  letter-spacing: 0.04em;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--navy); color: white; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-cyan { background: var(--cyan); color: var(--navy); border-color: var(--cyan); font-weight: 600; }
.btn-cyan:hover { background: var(--cyan-2); border-color: var(--cyan-2); color: white; }
.btn-ghost { background: white; color: var(--navy); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--row-hover); border-color: var(--navy); }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; color: var(--text-muted); }
.btn-delete-doc:hover { background: var(--status-rejected-bg); border-color: var(--status-rejected); color: var(--status-rejected); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-on-navy { background: var(--cyan); color: var(--navy); border-color: var(--cyan); font-weight: 600; }
.btn-on-navy:hover { background: white; border-color: white; }

/* ============ UPLOAD (inline row form) ============ */
.upload-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.upload-trigger { position: relative; overflow: hidden; }
.upload-trigger input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ============ PAGINATION ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--row-stripe);
  border-top: 1px solid var(--border);
}
.pagination-info { font-size: 13px; color: var(--text-secondary); font-family: 'Geist Mono', ui-monospace, monospace; }
.pagination-controls { display: flex; gap: 8px; }

/* ============ EMPTY STATE ============ */
.empty { padding: 56px 24px; text-align: center; }
.empty-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--status-neutral-bg);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}
.empty-title { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.empty-text { font-size: 13px; color: var(--text-secondary); max-width: 360px; margin: 0 auto; }

/* ============ GENERIC FORM FIELDS ============ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.6fr 1.6fr auto;
  gap: 14px;
  align-items: end;
  padding: 22px 24px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.01em; }
.field select,
.field input[type="text"] {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  padding: 9px 12px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  height: 38px;
  width: 100%;
  min-width: 0;
}
.field select:focus,
.field input[type="text"]:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--row-stripe);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  height: 38px;
  color: var(--text-secondary);
  font-size: 13px;
}
.file-drop:hover { border-color: var(--cyan); background: var(--cyan-soft); color: var(--navy); }
.file-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop .file-icon { color: var(--text-muted); flex-shrink: 0; }
.file-drop:hover .file-icon { color: var(--cyan-2); }
.file-drop .file-name { color: var(--navy); font-weight: 500; }

/* ============ TOGGLES (settings) ============ */
.toggle { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  cursor: pointer;
  background: var(--border-strong);
  border-radius: 999px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px; width: 16px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--cyan); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-slider { box-shadow: 0 0 0 3px var(--cyan-soft); }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .btn { grid-column: span 2; justify-self: stretch; justify-content: center; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .btn { grid-column: 1; }
  thead { display: none; }
  tbody td { display: block; padding: 6px 16px; border: none; word-break: break-word; overflow-wrap: anywhere; }
  tbody tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); }
  tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 3px;
  }
  .upload-cell { justify-content: flex-start; }
}
