* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* Additional styles omitted for brevity */
label, .field-label { display: block; font-weight: 600; margin: 1rem 0 .4rem; }
label:first-child { margin-top: 0; }
input[type="text"], input[type="date"], textarea {
  width: 100%;
  padding: .7rem;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #0f172a;
  color: inherit;
  font-size: 1rem;
}
.inline-check { display: flex; align-items: flex-start; gap: .6rem; margin: 1rem 0 .6rem; font-weight: 500; line-height: 1.45; }
.inline-check input[type="checkbox"] { flex: 0 0 auto; width: 1rem; height: 1rem; margin: .15rem 0 0; accent-color: #38bdf8; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  color: #fff;
}
.logo { height: 2.25rem; margin-bottom: 1rem; }
.user-bar { text-align: right; font-size: .85rem; margin: -2rem 0 1rem; }
.admin-badge { display: inline-block; margin-left: .4rem; padding: .15rem .45rem; border: 1px solid #7dd3fc; border-radius: 4px; color: #7dd3fc; font-size: .75rem; font-weight: 600; vertical-align: middle; }
.user-bar button {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 6px;
  padding: .2rem .6rem;
  margin-left: .5rem;
  cursor: pointer;
}
.eyebrow { text-transform: uppercase; letter-spacing: .15em; font-size: .8rem; margin: 0; opacity: .85; }
.hero h1 { margin: .4rem 0; font-size: 2.5rem; }
.tagline { max-width: 40rem; margin: 0 auto; line-height: 1.5; }
main { flex: 1; width: 100%; max-width: 96rem; margin: -1.5rem auto 2rem; padding: 0 1rem; }
[hidden] { display: none !important; }
.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid #475569; background: #1e293b; }
.tabs button { flex: 1; min-width: 0; margin: 0; padding: .9rem .5rem; border-radius: 0; border-bottom: 3px solid transparent; background: transparent; font-size: .95rem; }
.tabs button[aria-selected="true"] { border-bottom-color: #38bdf8; color: #7dd3fc; }
.tabs button:hover { background: #334155; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #38bdf8; outline-offset: 3px; }
#metadata-panel h2 { margin-top: 0; }
#metadata-panel .metadata-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
#metadata-panel .metadata-actions button { margin-top: 1.25rem; }
#metadata-panel .metadata-actions .danger-command { border: 1px solid #b91c1c; background: #b91c1c; }
#metadata-panel .metadata-actions .danger-command:hover:not(:disabled) { background: #991b1b; }
#upload-panel, #metadata-panel { width: 100%; max-width: 56rem; margin-inline: auto; }
#metadata-form { max-width: 36rem; }
#metadata-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
#metadata-message { min-height: 1.4em; }
#metadata-message.error { color: #f87171; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin: 1rem 0 1.5rem; border-block: 1px solid #334155; }
.dashboard-metric { display: flex; flex-direction: column; gap: .4rem; padding: .85rem 1rem; border-right: 1px solid #334155; }
.dashboard-metric span { color: #94a3b8; font-size: .85rem; }
.dashboard-metric strong { font-size: 1.6rem; }
.dashboard-breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.5rem; }
.dashboard-breakdown h3 { margin: 0 0 .75rem; font-size: 1rem; }
.dashboard-rows { display: grid; gap: .65rem; }
.dashboard-row { display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(4rem, 2fr) 2rem; align-items: center; gap: .75rem; font-size: .9rem; }
.dashboard-row-name { overflow-wrap: anywhere; }
.dashboard-track { display: block; height: .55rem; overflow: hidden; border-radius: 4px; background: #334155; }
.dashboard-track > span { display: block; height: 100%; background: #38bdf8; }
.dashboard-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.upload-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem 1rem; font-size: .9rem; }
.upload-details dt { color: #94a3b8; }
.upload-details dd { margin: 0; overflow-wrap: anywhere; }
#upload-form, #result-card { max-width: none; margin: 0 0 1rem; }
.card {
  background: #1e293b;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}
label, .field-label { display: block; font-weight: 600; margin: 1rem 0 .4rem; }
label:first-child { margin-top: 0; }
input[type="text"], input[type="date"], textarea {
  width: 100%;
  padding: .7rem;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #0f172a;
  color: inherit;
  font-size: 1rem;
}
.hint { font-size: .85rem; color: #94a3b8; margin: .4rem 0 0; }
textarea { resize: vertical; min-height: 5rem; font-family: inherit; }
select, input[type="search"] {
  padding: .7rem;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #0f172a;
  color: inherit;
  font-size: 1rem;
}
select { width: 100%; }
.filters { display: flex; align-items: flex-start; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.filters input[type="search"] { flex: 1 1 14rem; min-width: 0; }
.filters select { flex: 0 1 14rem; width: auto; }
.status-filter { position: relative; flex: 1 1 16rem; min-width: 0; max-width: 100%; font-size: .9rem; }
.discipline-picker { width: 100%; }
.discipline-picker summary > span { display: inline-block; max-width: calc(100% - 1rem); overflow-wrap: anywhere; vertical-align: middle; }
.status-filter summary { min-height: 44px; padding: .7rem .8rem; border: 1px solid #475569; border-radius: 8px; background: #0f172a; cursor: pointer; }
.status-filter summary::marker { color: #7dd3fc; }
.status-filter summary:hover, .status-filter[open] summary { border-color: #38bdf8; }
.status-filter summary:focus-visible { outline: 2px solid #38bdf8; outline-offset: 3px; }
.status-filter-heading { display: inline-flex; align-items: center; justify-content: space-between; gap: .75rem; width: calc(100% - 1rem); vertical-align: middle; }
.status-filter-heading > span:first-child { color: #94a3b8; }
#apps-status-summary, #apps-discipline-summary { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #e2e8f0; font-weight: 600; }
.status-options { position: absolute; top: calc(100% + 6px); right: 0; z-index: 10; width: 100%; min-width: 0; max-height: min(24rem, 60vh); overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: .4rem; border: 1px solid #475569; border-radius: 8px; background: #0f172a; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.status-options label { display: grid; grid-template-columns: 1rem minmax(0, 1fr); align-items: start; gap: .65rem; margin: 0; padding: .65rem; border-radius: 4px; font-weight: 400; line-height: 1.5; cursor: pointer; }
.status-options label:hover, .status-options label:focus-within { background: #1e293b; }
.status-options input { width: 1rem; height: 1rem; margin: .15rem 0 0; accent-color: #38bdf8; cursor: pointer; }
.status-options input:checked + span { color: #7dd3fc; }
.status-options .filter-select-all { border-bottom: 1px solid #334155; border-radius: 0; margin-bottom: .25rem; font-weight: 600; }
.directory-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid #334155; }
.directory-views, .directory-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; min-width: 0; }
.directory-views label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-size: .85rem; font-weight: 400; cursor: pointer; }
.directory-views input { margin: 0; width: 1rem; height: 1rem; accent-color: #38bdf8; }
.directory-actions select { width: auto; max-width: 100%; min-width: 0; padding: .5rem; font-size: .85rem; }
.directory-command, .directory-icon { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; margin: 0; padding: .5rem .65rem; border: 1px solid #475569; border-radius: 4px; background: transparent; font-size: .85rem; }
.directory-command:hover:not(:disabled), .directory-icon:hover:not(:disabled) { background: #334155; }
.directory-command svg, .directory-icon svg { flex-shrink: 0; }
.directory-icon { width: 32px; height: 32px; padding: 0; }
.directory-icon[aria-pressed="true"] { color: #facc15; border-color: #a16207; }
.directory-icon[aria-pressed="true"] svg { fill: currentColor; }
.directory-row-actions { display: flex; gap: .35rem; }
#directory-message:empty { display: none; }
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.apps-table { width: 100%; min-width: 80rem; table-layout: fixed; border-collapse: collapse; }
.apps-table th:nth-child(1), .apps-table td:nth-child(1) { width: 9%; }
.apps-table th:nth-child(2), .apps-table td:nth-child(2) { width: 8%; }
.apps-table th:nth-child(3), .apps-table td:nth-child(3) { width: 18%; }
.apps-table th:nth-child(4), .apps-table td:nth-child(4) { width: 18%; }
.apps-table th:nth-child(5), .apps-table td:nth-child(5) { width: 8%; }
.apps-table th:nth-child(6), .apps-table td:nth-child(6) { width: 8%; }
.apps-table th:nth-child(7), .apps-table td:nth-child(7) { width: 8%; }
.apps-table th:nth-child(8), .apps-table td:nth-child(8) { width: 8%; }
.apps-table th:nth-child(9), .apps-table td:nth-child(9) { width: 9%; }
.apps-table th:nth-child(10), .apps-table td:nth-child(10) { width: 6%; }
.apps-table td { overflow-wrap: anywhere; }
.apps-table th, .apps-table td { text-align: left; padding: .6rem .5rem; border-top: 1px solid #334155; vertical-align: top; }
.apps-table th { border-top: 0; color: #94a3b8; font-size: .85rem; }
.apps-table td:nth-child(3) { white-space: pre-wrap; }
.app-text-details summary { cursor: pointer; }
.app-text-details summary > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.app-text-details p { margin: .5rem 0 0; white-space: pre-wrap; }
.apps-table a { color: #7dd3fc; text-decoration: underline; font-weight: 600; }
.apps-table a:hover, .apps-table a:focus-visible { color: #e0f2fe; }
.dropzone {
  border: 2px dashed #475569;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
}
.dropzone p { margin: 0; }
.dropzone:hover, .dropzone:focus, .dropzone.over { border-color: #38bdf8; background: #0f172a; outline: none; }
.file-list { max-height: 14rem; overflow-y: auto; margin: .5rem 0 0; padding: 0; list-style: none; }
.file-item { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .5rem; border-top: 1px solid #334155; }
.file-item:first-child { border-top: 0; }
.file-item-name { min-width: 0; overflow-wrap: anywhere; color: #cbd5e1; font-size: .85rem; }
.file-remove { display: inline-flex; flex: 0 0 32px; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0; padding: 0; border: 1px solid #475569; border-radius: 4px; background: transparent; }
.file-remove:hover:not(:disabled) { background: #334155; }
.upload-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.upload-actions button { margin-top: .75rem; }
.upload-source { min-width: 0; margin: 1rem 0; padding: 0; border: 0; }
.upload-source legend { margin-bottom: .4rem; font-weight: 600; }
.upload-source-options { display: inline-flex; max-width: 100%; border: 1px solid #475569; border-radius: 6px; overflow: hidden; }
.upload-source-options label { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .65rem .85rem; cursor: pointer; font-weight: 500; }
.upload-source-options label + label { border-left: 1px solid #475569; }
.upload-source-options label:has(input:checked) { background: #0f172a; color: #7dd3fc; }
.upload-source-options input { margin: 0; accent-color: #38bdf8; }
#html-code { min-height: 20rem; font-family: Consolas, "Courier New", monospace; font-size: .9rem; line-height: 1.5; tab-size: 2; }
button {
  margin-top: 1.25rem;
  padding: .75rem 1.5rem;
  border: 0;
  border-radius: 8px;
  background: #4f46e5;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #6366f1; }
button:disabled { opacity: .6; cursor: wait; }
#status { min-height: 1.4em; margin: .75rem 0 0; }
#status.error { color: #f87171; }
.success h2 { margin-top: 0; color: #4ade80; }
.success a { color: #38bdf8; word-break: break-all; }
footer { text-align: center; padding: 1rem; font-size: .8rem; color: #64748b; }
