/* Seed Equipment Request App — base styles */
:root {
  --color-primary: #00509e;
  --color-primary-dark: #003b73;
  --color-accent: #05a357;
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-border: #e0e4e8;
  --color-text: #1f2733;
  --color-text-muted: #5b6b79;
  --color-danger: #c62828;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top navigation */
.topnav {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 12px 0;
}
.topnav .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; row-gap: 10px; }
.topnav .brand { font-weight: 700; font-size: 1.1rem; color: #fff; display: flex; align-items: center; gap: 10px; }
.topnav .brand img { height: 28px; }
.topnav nav { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.topnav nav a { color: #dce7f5; margin: 0; font-size: 0.92rem; }
.topnav nav a:hover { color: #fff; text-decoration: none; }
.topnav nav a.active { color: #fff; font-weight: 600; border-bottom: 2px solid var(--color-accent); padding-bottom: 4px; }
.topnav .admin-menu { position: relative; }
.topnav .admin-menu summary {
  color: #dce7f5;
  cursor: pointer;
  font-size: 0.92rem;
  list-style: none;
  user-select: none;
}
.topnav .admin-menu summary::-webkit-details-marker { display: none; }
.topnav .admin-menu summary::after { content: " ▾"; font-size: 0.75rem; }
.topnav .admin-menu[open] summary::after { content: " ▴"; }
.topnav .admin-menu summary:hover,
.topnav .admin-menu summary:focus-visible,
.topnav .admin-menu[open] summary { color: #fff; }
.topnav .admin-menu summary:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 2px; }
.topnav .admin-menu.active summary { color: #fff; font-weight: 600; border-bottom: 2px solid var(--color-accent); padding-bottom: 4px; }
.topnav .admin-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 12px);
  right: 0;
  min-width: 180px;
  padding: 7px 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.topnav nav .admin-dropdown a,
.topnav nav .admin-dropdown a.active {
  display: block;
  padding: 9px 14px;
  color: var(--color-text);
  border: 0;
  font-weight: 500;
  white-space: nowrap;
}
.topnav nav .admin-dropdown a:hover { color: var(--color-primary-dark); background: #eef5fc; }
.topnav nav .admin-dropdown a.active { color: var(--color-primary-dark); background: #e0edfb; font-weight: 700; }
.topnav .user-chip { display: flex; align-items: center; gap: 8px; margin-left: 4px; padding-left: 18px; border-left: 1px solid rgba(255,255,255,0.25); }
.topnav .user-chip img { width: 28px; height: 28px; border-radius: 50%; }

.page-header { padding: 28px 0 10px; }
.page-header h1 { margin: 0 0 4px; font-size: 1.6rem; }
.page-header p { color: var(--color-text-muted); margin: 0; }

.main-content { padding: 20px 0 60px; }

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

.card h2 { margin-top: 0; font-size: 1.2rem; }
.card h3 { font-size: 1.05rem; margin-top: 0; }

/* Forms */
label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; margin-top: 14px; }
label.inline { display: inline; font-weight: 500; margin: 0; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number],
input[type=password], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,80,158,0.15);
}
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 200px; }
/* Narrow, intentionally fixed-width columns (e.g. Sort Order, Active
   checkbox, small action buttons in catalog/teams list rows) must opt
   out of the 200px min-width above, otherwise they balloon past their
   intended flex-basis and force the whole row to wrap unnecessarily. */
.form-row > div.col-fixed { min-width: 0; }
.help-text { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 4px; }
.field-error { color: var(--color-danger); font-size: 0.82rem; margin-top: 4px; }

fieldset { border: 1px solid var(--color-border); border-radius: 6px; padding: 14px 16px; margin-top: 14px; }
legend { font-weight: 600; padding: 0 6px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn.btn-secondary { background: #fff; color: var(--color-text); border-color: var(--color-border); }
.btn.btn-secondary:hover { background: #f2f4f6; }
.btn.btn-success { background: var(--color-accent); }
.btn.btn-success:hover { background: #048b49; }
.btn.btn-danger { background: var(--color-danger); }
.btn.btn-danger:hover { background: #a01f1f; }
.btn.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn.btn-icon { width: 32px; padding-left: 0; padding-right: 0; line-height: 1; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-group { display: flex; gap: 10px; margin-top: 20px; }
.catalog-reorder { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.catalog-reorder label { flex-basis: 100%; margin-top: 0; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; vertical-align: middle; }
th { color: var(--color-text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #fafbfc; }
/* NOTE: intentionally NOT applied directly to a <td> — setting
   display:flex on a table cell makes browsers generate an anonymous
   wrapper around it, which can render that cell's border at a
   different height than sibling cells in the same row (the
   "stepped" row-border misalignment under action buttons). Apply
   this class to a <div> nested inside the <td> instead. */
.table-actions { display: flex; gap: 8px; flex-wrap: nowrap; white-space: nowrap; justify-content: flex-end; }

/* All Requests admin table: keep request #, SA, items, status, and
   submitted-date cells on a single line so the auto table-layout
   algorithm doesn't misjudge column widths and wrap them unnecessarily.
   Customer name is still allowed to wrap if it's ever unusually long. */
.requests-table th, .requests-table td { white-space: nowrap; }
.requests-table td:nth-child(2) { white-space: normal; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
.badge-gray { background: #e6e9ec; color: #4a5563; }
.badge-amber { background: #fdf0d2; color: #92650a; }
.badge-blue { background: #d9e8fb; color: #0a4a92; }
.badge-green { background: #d7f0e2; color: #0a7a45; }
.badge-red { background: #fadada; color: #a01f1f; }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; }
.flash-success { background: #e0f5e9; color: #0a7a45; border: 1px solid #b8e6cc; }
.flash-error { background: #fbe4e4; color: #a01f1f; border: 1px solid #f2b8b8; }
.flash-info { background: #e0edfb; color: #0a4a92; border: 1px solid #b8d6f2; }

/* Wizard steps */
.steps { display: flex; margin-bottom: 24px; list-style: none; padding: 0; gap: 8px; flex-wrap: wrap; }
.steps li {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 10px 8px;
  border-radius: 6px;
  background: #eef1f4;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.steps li.active { background: var(--color-primary); color: #fff; }
.steps li.done { background: #d7f0e2; color: #0a7a45; }

/* Category / item selection */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 10px; }
.category-card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  background: #fff;
}
.category-card input { display: none; }
.category-card.selected { border-color: var(--color-primary); background: #eef5fc; }
.category-card .cat-name { font-weight: 700; margin-top: 8px; }

.item-list { margin-top: 10px; }
.item-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.item-row:last-child { border-bottom: none; }
.item-info .item-name { font-weight: 600; }
.item-info .item-model { font-size: 0.8rem; color: var(--color-text-muted); }
.item-qty input { width: 80px; }

.review-section { margin-bottom: 18px; }
.review-section dt { font-size: 0.78rem; color: var(--color-text-muted); text-transform: uppercase; margin-top: 10px; }
.review-section dd { margin: 2px 0 0; font-size: 0.95rem; }
.truncate-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.empty-state { text-align: center; padding: 40px 20px; color: var(--color-text-muted); }

.login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.login-card { max-width: 420px; text-align: center; }
.login-card img.logo { height: 42px; margin-bottom: 18px; }
.btn-webex {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: #05a357; color: #fff; padding: 12px 24px; border-radius: 6px;
  font-weight: 700; font-size: 1rem; margin-top: 18px; width: 100%;
}
.btn-webex:hover { background: #048b49; text-decoration: none; }

.text-muted { color: var(--color-text-muted); }
.small { font-size: 0.85rem; }
.mt-0 { margin-top: 0; }
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: end; }
.filters > div { min-width: 160px; }

/* Required field asterisk */
.req-star { color: var(--color-danger); font-weight: 700; margin-right: 2px; }
