/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --primary:    #1d6fce;
  --primary-dk: #155ab0;
  --surface:    #ffffff;
  --bg:         #f4f6fa;
  --border:     #e0e4ec;
  --text:       #1a1d23;
  --muted:      #6b7280;
  --radius:     8px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);

  --blue:   #1d6fce; --blue-bg:   #e8f0fc;
  --orange: #d97706; --orange-bg: #fef3c7;
  --red:    #dc2626; --red-bg:    #fee2e2;
  --purple: #7c3aed; --purple-bg: #ede9fe;
  --green:  #16a34a; --green-bg:  #dcfce7;
  --admin:  #374151; --admin-bg:  #f3f4f6;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       font-size: 15px; line-height: 1.6; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
textarea, input, select { font: inherit; }

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.navbar-brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 16px; }
.navbar-brand:hover { text-decoration: none; }
.navbar-right { display: flex; align-items: center; gap: 12px; }
.navbar-name { color: var(--muted); font-size: 14px; }

/* ── Container ──────────────────────────────────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 32px 24px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all .15s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dk); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

/* Microsoft button */
.btn-microsoft {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 24px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 500; cursor: pointer; transition: all .15s;
  text-decoration: none; margin-bottom: 12px;
}
.btn-microsoft:hover { background: var(--bg); text-decoration: none; box-shadow: var(--shadow); }

/* ── Pills / Status badges ──────────────────────────────────────────────── */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.pill-lg { font-size: 14px; padding: 5px 14px; }
.pill-blue   { color: var(--blue);   background: var(--blue-bg); }
.pill-orange { color: var(--orange); background: var(--orange-bg); }
.pill-red    { color: var(--red);    background: var(--red-bg); }
.pill-purple { color: var(--purple); background: var(--purple-bg); }
.pill-green  { color: var(--green);  background: var(--green-bg); }
.pill-admin  { color: var(--admin);  background: var(--admin-bg); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 14px; font-weight: 600; color: var(--muted);
           text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-success { background: var(--green-bg);  color: var(--green); border: 1px solid #bbf7d0; }
.alert-error   { background: var(--red-bg);    color: var(--red);   border: 1px solid #fecaca; }

/* ── Page header ────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-header h1 { font-size: 24px; font-weight: 700; }

/* ── Submissions list ───────────────────────────────────────────────────── */
.submissions-list { display: flex; flex-direction: column; gap: 10px; }

.submission-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow); transition: box-shadow .15s;
  color: var(--text);
}
a.submission-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); text-decoration: none; }

.submission-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.submission-title-link { font-weight: 600; font-size: 15px; color: var(--primary); }
.submission-title-link:hover { text-decoration: underline; }
.submission-desc { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.submission-meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; }
.submission-status { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.admin-card { flex-wrap: wrap; }
.admin-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.inline-status-form select {
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; background: var(--surface); cursor: pointer;
}

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 24px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}

/* ── Workflow info ───────────────────────────────────────────────────────── */
.workflow-info { margin-top: 40px; }
.workflow-info h3 { font-size: 13px; font-weight: 600; color: var(--muted);
                    text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.workflow-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.workflow-arrow { color: var(--muted); font-size: 16px; }

/* ── Login page ─────────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 48px 40px; text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,.08); max-width: 380px; width: 100%;
}
.login-logo { margin-bottom: 16px; }
.login-card h1 { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.login-subtitle { color: var(--muted); margin-bottom: 32px; }
.login-hint { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ── Form ───────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.required { color: var(--red); }
.optional { color: var(--muted); font-weight: 400; }
.form-group input[type="text"],
.form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 15px;
  transition: border-color .15s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,111,206,.1);
}
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 24px; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer; transition: all .15s;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--primary); background: var(--blue-bg);
}
.dropzone-inner p { margin: 8px 0; }
.dropzone-inner .link { color: var(--primary); cursor: pointer; font-weight: 500; }
input[type="file"]#files { display: none; }

.file-list { margin-top: 16px; text-align: left; }
.file-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--bg); border-radius: 6px; margin-top: 6px; font-size: 13px;
}
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--muted); flex-shrink: 0; }

/* ── Detail layout ──────────────────────────────────────────────────────── */
.detail-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
@media (max-width: 720px) { .detail-layout { grid-template-columns: 1fr; } }

/* Files grid */
.files-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.file-preview { width: 140px; }
.file-preview img { width: 140px; height: 100px; object-fit: cover; border-radius: 6px;
                    border: 1px solid var(--border); display: block; }
.file-preview-name { font-size: 12px; color: var(--muted); margin-top: 4px;
                     overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-doc {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; color: var(--text);
}
.file-doc:hover { background: var(--blue-bg); text-decoration: none; }

/* Comments */
.comment { padding: 12px 0; border-top: 1px solid var(--border); }
.comment:first-child { border-top: none; }
.comment-header { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.comment-form { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border);
                          border-radius: var(--radius); resize: vertical; }
.comment-form textarea:focus { outline: none; border-color: var(--primary); }

/* Status form in sidebar */
.status-form { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.status-form label { font-size: 13px; color: var(--muted); font-weight: 500; }
.status-form select, .status-form textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px;
}
.status-form select:focus, .status-form textarea:focus {
  outline: none; border-color: var(--primary);
}

/* Admin note box */
.admin-note-box {
  margin-top: 12px; padding: 12px; background: var(--orange-bg);
  border-radius: 6px; border: 1px solid #fed7aa; font-size: 14px;
}
.admin-note-box strong { display: block; color: var(--orange); margin-bottom: 4px; }

/* Timeline */
.status-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-step { display: flex; align-items: center; gap: 10px; padding: 8px 0;
                 font-size: 14px; color: var(--muted); }
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); background: var(--surface);
}
.timeline-step.done .timeline-dot { background: var(--green); border-color: var(--green); }
.timeline-step.active { font-weight: 600; color: var(--primary); }
.timeline-step.active .timeline-dot { background: var(--primary); border-color: var(--primary); }

/* ── Filter bar ─────────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  cursor: pointer; text-decoration: none; transition: all .15s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.count { background: rgba(0,0,0,.08); border-radius: 100px; padding: 1px 7px; font-size: 11px; }
.filter-btn.active .count { background: rgba(255,255,255,.25); }
.count-orange { background: var(--orange-bg); color: var(--orange); }
.count-red    { background: var(--red-bg);    color: var(--red); }
.count-green  { background: var(--green-bg);  color: var(--green); }
.count-purple { background: var(--purple-bg); color: var(--purple); }

/* ── Utilities ──────────────────────────────────────────────────────────── */
.text-muted { color: var(--muted); }
.small { font-size: 12px; }
.link { color: var(--primary); cursor: pointer; }
