:root {
  --green: #0f5132;
  --green-600: #146c43;
  --bg: #f6f7f5;
  --card: #ffffff;
  --text: #1a1d1a;
  --muted: #6b756b;
  --border: #e3e6e2;
  --error-bg: #fde8e8; --error-fg: #9b1c1c;
  --info-bg: #e7f1ec;  --info-fg: #0f5132;
  --ok-bg: #e6f4ea;    --ok-fg: #137333;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
}
.app-shell { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.content { padding: 20px 16px 40px; flex: 1; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.brand span { color: var(--green); }

h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2.section { font-size: 1rem; margin: 28px 0 10px; color: var(--muted); }
.muted { color: var(--muted); font-size: 0.9rem; }
.welcome { margin-bottom: 20px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.auth-card { max-width: 400px; margin: 8vh auto 0; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-card h1 { text-align: center; }

form label { display: block; font-size: 0.85rem; color: var(--muted); margin: 14px 0 0; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; padding: 12px 14px; margin-top: 6px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; font-size: 1rem; font-weight: 600; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; margin-top: 18px;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-600); }
.btn-secondary { background: #fff; color: var(--green); border-color: var(--green); }
.btn-ghost { background: transparent; color: var(--muted); border: none; margin: 0; padding: 6px 8px; }
.btn-block { width: 100%; }
.inline { margin: 0; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; text-decoration: none; color: var(--text); display: block; transition: transform .05s;
}
.tile:active { transform: scale(0.98); }
.tile-icon { font-size: 1.8rem; }
.tile-title { font-weight: 700; margin-top: 8px; }
.tile-sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.tile-disabled { opacity: 0.5; }

.upload-actions { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.queue { list-style: none; padding: 0; margin: 0; }
.queue-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff;
}
.q-name { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.q-status { font-size: 0.78rem; font-weight: 600; }
.q-uploading { color: var(--muted); }
.q-received, .q-forwarded { color: var(--ok-fg); }
.q-failed { color: var(--error-fg); }

.flashes { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; font-size: 0.9rem; }
.flash-error { background: var(--error-bg); color: var(--error-fg); }
.flash-info { background: var(--info-bg); color: var(--info-fg); }
.flash-success { background: var(--ok-bg); color: var(--ok-fg); }

.staff-nav { display: flex; align-items: center; gap: 14px; font-size: 0.85rem; }
.staff-nav a { color: var(--green); text-decoration: none; }
.push-row { margin-top: 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.push-row .btn { margin-top: 0; }

.client-picker { margin: 6px 0 14px; }
.client-picker .cp-search, .client-picker .cp-manual-input {
  width: 100%; padding: 12px 14px; margin-top: 6px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}
.cp-results {
  border: 1px solid var(--border); border-radius: 10px; margin-top: 6px; overflow: hidden; background: #fff;
}
.cp-item {
  display: block; width: 100%; text-align: left; padding: 10px 14px; border: none;
  border-bottom: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 0.9rem;
}
.cp-item:last-child { border-bottom: none; }
.cp-item:hover { background: var(--info-bg); }
.cp-status { font-size: 0.8rem; margin-top: 6px; min-height: 1em; }
.cp-manual { margin-top: 8px; }
.cp-manual-toggle { display: inline-block; margin-top: 8px; font-size: 0.75rem; }
