[hidden] { display: none !important; }

:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --brand: #7c3aed;
  --brand-2: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --ok: #22c55e;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--panel);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand { display: flex; gap: 12px; align-items: center; padding: 10px 10px 14px; border-bottom: 1px solid var(--border); }
.brand__logo {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #2563eb);
  box-shadow: 0 12px 26px rgba(124,58,237,0.35);
  font-weight: 800;
}
.brand__logo-img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: contain;
  background: white;
  padding: 6px;
  box-shadow: 0 12px 26px rgba(124,58,237,0.35);
}
.brand__name { font-weight: 700; }
.brand__sub { font-size: 12px; color: var(--muted-2); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 8px; }
.nav__item {
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 160ms ease;
}
.nav__item:hover { background: #f1f5f9; border-color: var(--border); color: var(--text); }
.nav__item--active { background: #ede9fe; border-color: #c4b5fd; color: var(--text); }

.sidebar__footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.status { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.status__dot { width: 10px; height: 10px; border-radius: 50%; }
.status__dot--warn { background: var(--warn); }
.status__dot--ok { background: var(--ok); }
.status__dot--bad { background: var(--danger); }
.status__text { font-size: 13px; color: var(--muted); }

/* Status badges for vendor view (read-only status display) */
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.status-submitted { background: #e0e7ff; color: #3730a3; }
.status-offer { background: #d1fae5; color: #065f46; }
.status-decline { background: #fee2e2; color: #991b1b; }
.status-start { background: #dbeafe; color: #1e40af; }
.meta { font-size: 12px; color: var(--muted-2); }

.main { padding: 22px 24px; overflow: auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.title { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.subtitle { margin-top: 6px; color: var(--muted); font-size: 13px; }

.btn {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: 160ms ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,0.25); }
.btn--secondary {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}

.topbar__actions { display: flex; gap: 10px; }

.content { display: flex; flex-direction: column; gap: 14px; }

.filters {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 12px; color: var(--muted-2); }

.input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.card {
  grid-column: span 12;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

@media (min-width: 1200px) {
  .card { grid-column: span 4; }
}

@media (min-width: 800px) and (max-width: 1199px) {
  .card { grid-column: span 6; }
}

.card__title { font-size: 14px; font-weight: 600; margin: 0 0 6px; line-height: 1.3; }
.card__meta { font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag {
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  font-size: 11px;
}
.card__desc { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.4; flex: 1; }
.card__actions { display: flex; gap: 8px; margin-top: auto; }
.card__actions .btn { padding: 6px 10px; font-size: 12px; }

.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.panel__title { font-weight: 700; }
.panel__desc { color: var(--muted); font-size: 13px; margin-top: 6px; }

.row { display: flex; gap: 10px; margin-top: 14px; }
.row--right { justify-content: flex-end; }

.empty {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.code {
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  overflow: auto;
  max-height: 420px;
}

.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal__card {
  position: relative;
  width: min(860px, calc(100vw - 30px));
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.modal__header { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px; border-bottom: 1px solid var(--border); }
.modal__title { font-weight: 800; }
.modal__body { 
  padding: 14px; 
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.icon-btn { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 6px 10px; cursor: pointer; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form__row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 780px) { .form__row { grid-template-columns: 1fr 1fr; } }

.alert { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.alert--error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.alert--ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }

.table-container { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; }
th { border-bottom: 1px solid var(--border); font-weight: 600; color: var(--muted); }
tbody tr:hover { background: var(--panel-2); }

.loading-jobs {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  white-space: nowrap;
}
.loading-jobs small {
  color: #888;
  font-size: 14px;
}

/* Auth overlay - full screen centered */
#viewAuth {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 1000;
}

#viewAuth .panel {
  width: 100%;
  max-width: 400px;
  margin: 20px;
  background: white;
  box-shadow: 0 25px 80px rgba(0,0,0,0.3);
  border: none;
  border-radius: 20px;
  padding: 32px;
}

#viewAuth .panel__title {
  font-size: 24px;
  margin-bottom: 6px;
  color: #1e293b;
}

#viewAuth .panel__desc {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
}

#viewAuth .field {
  margin-bottom: 12px;
}

#viewAuth .input {
  background: #f8fafc;
  border-color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 12px;
}

#viewAuth .input:focus {
  background: white;
  border-color: #7c3aed;
}

#viewAuth .btn {
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
}

/* Loading spinner for infinite scroll */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  color: var(--muted);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
