/* SET-BC ProD Applications — staff submit UI */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #d1d5db;
  --border-light: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-light: #eff6ff;
  --accent-border: #bfdbfe;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fca5a5;
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #6ee7b7;
  --header-bg: #1e293b;
  --header-text: #f1f5f9;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* Header */
.app-header {
  background: var(--header-bg);
  color: var(--header-text);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}

.header-brand { display: flex; align-items: baseline; gap: 8px; }
.header-logo { font-weight: 800; font-size: 15px; letter-spacing: .04em; color: #93c5fd; }
.header-title { font-size: 15px; font-weight: 600; }

.header-nav { display: flex; gap: 4px; margin-left: auto; }
.nav-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.nav-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-btn.active { background: rgba(147,197,253,.2); color: #fff; }

/* Main */
.app-main {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 22px; margin-bottom: 4px; }
.muted { color: var(--text-muted); }
.muted.small, .small { font-size: 12px; }
.hint { font-style: italic; color: var(--text-muted); font-weight: 400; }

.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.hero h1 { font-size: 24px; margin-bottom: 8px; }
.hero p { margin-bottom: 16px; line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.info-card h2 { font-size: 15px; margin-bottom: 8px; }
.info-card ul { padding-left: 18px; color: var(--text-muted); line-height: 1.6; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: #f9fafb; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-danger-ghost { background: transparent; border: none; color: var(--danger); cursor: pointer; font-size: 13px; }

/* Form */
.form-card fieldset {
  border: none;
  border-top: 1px solid var(--border-light);
  padding: 16px 0 8px;
  margin: 0 0 4px;
}
.form-card fieldset:first-of-type { border-top: none; padding-top: 0; }
.form-card legend {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding: 0;
  margin-bottom: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: 12px; font-weight: 600; color: #374151; }
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-border);
}
.field textarea { resize: vertical; }

.checkbox-field {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}
.checkbox-field input { margin-top: 2px; }
.checkbox-field span { font-weight: 500; font-size: 13px; }

.cost-lines { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.cost-line {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  background: #f9fafb;
  border: 1px solid var(--border-light);
  border-radius: 6px;
}
@media (max-width: 640px) {
  .cost-line { grid-template-columns: 1fr; }
}
.cost-line .field { margin-bottom: 0; }

.amount-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  font-size: 15px;
}
.amount-bar strong { font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.alert {
  padding: 10px 12px;
  border-radius: 6px;
  margin: 12px 0;
  font-size: 13px;
}
.alert-error { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); }

/* Success */
.success-card { text-align: center; padding: 36px 24px; }
.success-icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--success-bg);
  border: 2px solid var(--success-border);
  color: var(--success);
  font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.success-card h1 { margin-bottom: 6px; }
.prod-id-box {
  margin: 20px auto;
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 8px;
  max-width: 360px;
}
.prod-id-box .label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 4px; }
.prod-id-box code { font-size: 22px; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.success-card .hero-actions { justify-content: center; margin-top: 20px; }

/* Mine */
.inline-form { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 8px; }
.inline-form .grow { flex: 1; }
.mine-results { margin-top: 12px; }
.app-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.app-table th, .app-table td {
  text-align: left; padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
}
.app-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.app-table tr:hover td { background: #f9fafb; }
.app-table a { color: var(--accent); font-weight: 600; text-decoration: none; }
.app-table a:hover { text-decoration: underline; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #e5e7eb;
  color: #374151;
}
.badge-submitted { background: var(--accent-light); color: var(--accent); }
.badge-approved { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }
.empty-state { padding: 24px; text-align: center; color: var(--text-muted); }

/* Detail */
.dl-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.dl-grid dt { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.dl-grid dd { font-size: 14px; word-break: break-word; }
.detail-section { margin-top: 18px; }
.detail-section h2 { font-size: 14px; margin-bottom: 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

.app-footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
