/* Angular Material look of the Crucible apps: 64px mat-toolbar in the environment's
   brand colour, Roboto, elevated cards, outlined fields, and a dark theme that switches
   the accent to the brand's darkMode shade. */
:root {
  --primary: #C41230; --primary-text: #fff; --dark-primary: #EF5A5A;
  --bg: #fafafa; --surface: #fff; --text: rgba(0, 0, 0, .87); --muted: rgba(0, 0, 0, .6);
  --line: rgba(0, 0, 0, .12); --hover: rgba(0, 0, 0, .04); --error: #b00020; --ok: #2e7d32;
  --accent: var(--primary);
}
body.dark {
  --bg: #303030; --surface: #424242; --text: #fff; --muted: rgba(255, 255, 255, .7);
  --line: rgba(255, 255, 255, .12); --hover: rgba(255, 255, 255, .06); --error: #ef9a9a; --ok: #a5d6a7;
  --accent: var(--dark-primary);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; font-size: 14px; line-height: 20px; color: var(--text); background: var(--bg); }
.hidden { display: none !important; }
/* The platform sign-in background, dimmed so the cards stay the focus. */
body.has-bg { background: linear-gradient(rgba(250, 250, 250, .55), rgba(250, 250, 250, .55)), url("/background.jpg") center / cover fixed; }
body.dark.has-bg { background: linear-gradient(rgba(48, 48, 48, .82), rgba(48, 48, 48, .82)), url("/background.jpg") center / cover fixed; }
.material-icons { font-size: 20px; vertical-align: middle; }

.banner { display: none; text-align: center; padding: 2px 8px; font-weight: 500; }
.banner span + span { margin-left: 16px; }

.toolbar { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 16px;
  background: var(--primary); color: var(--primary-text);
  box-shadow: 0 2px 4px -1px rgba(0,0,0,.2), 0 4px 5px 0 rgba(0,0,0,.14), 0 1px 10px 0 rgba(0,0,0,.12); }
.toolbar .app-icon { width: 32px; height: 32px; }
.toolbar .title { font-size: 20px; font-weight: 500; letter-spacing: .0125em; }
.toolbar .spacer { flex: 1; }
.user { position: relative; }
.user-btn { display: flex; align-items: center; gap: 6px; background: none; border: none; color: inherit; font: inherit; font-weight: 500;
  padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.user-btn:hover { background: rgba(255, 255, 255, .12); }
.user-btn .material-icons:first-child { font-size: 28px; }
.menu { position: absolute; right: 0; top: 46px; min-width: 180px; padding: 8px 0; background: var(--surface); color: var(--text); border-radius: 4px;
  box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12); }
.menu button { display: flex; align-items: center; gap: 16px; width: 100%; height: 48px; padding: 0 16px; background: none; border: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer; }
.menu button:hover { background: var(--hover); }
.menu .material-icons { color: var(--muted); font-size: 24px; }

main { max-width: 1140px; margin: 24px auto; padding: 0 16px; display: grid; gap: 24px; }
.card { background: var(--surface); border-radius: 4px; padding: 16px 24px 24px;
  box-shadow: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
h2 { font-size: 20px; font-weight: 500; line-height: 32px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.warn { color: var(--error); }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 18px; }
code { font-family: "Roboto Mono", monospace; font-size: 12px; background: var(--hover); padding: 1px 4px; border-radius: 3px; word-break: break-all; }

.row { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0 0; }
.field { position: relative; display: flex; flex-direction: column; min-width: 220px; }
.field.grow { flex: 1; }
.field.compact { min-width: 200px; }
.field label { position: absolute; top: -8px; left: 10px; padding: 0 4px; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 16px; }
.field input, .field select { font: inherit; color: var(--text); background: transparent; height: 48px; padding: 0 14px;
  border: 1px solid rgba(127, 127, 127, .5); border-radius: 4px; }
.field input:hover, .field select:hover { border-color: var(--text); }
.field input:focus, .field select:focus { outline: none; border: 2px solid var(--accent); padding: 0 13px; }
.field:focus-within label { color: var(--accent); }
.field select option { background: var(--surface); }
.dest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 16px 0 4px; }
.dest-label { color: var(--muted); font-size: 12px; margin-right: 4px; }
.radio { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.radio input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.radio.disabled { opacity: .45; cursor: not-allowed; }
#detectText { margin-top: 6px; }
#detectText.bad { color: var(--error); }
#detectText.good { color: var(--ok); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 16px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 12px; padding: 28px; border: 2px dashed var(--line);
  border-radius: 4px; color: var(--muted); text-align: center; cursor: pointer; transition: background .2s, border-color .2s; }
.drop .material-icons { font-size: 40px; color: var(--accent); }
.drop:hover, .drop.over, .drop:focus { border-color: var(--accent); background: var(--hover); outline: none; }

.actions { display: flex; gap: 8px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 4px; font: inherit; font-weight: 500;
  letter-spacing: .0892857143em; cursor: pointer; border: none; }
.btn .material-icons { font-size: 18px; }
.btn.flat { background: var(--accent); color: #fff; }
body.dark .btn.flat { color: #000; }
.btn.stroked { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { background: var(--line); color: var(--muted); cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: none;
  background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--error); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 56px; padding: 0 12px; text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); }
td { height: 52px; padding: 6px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover td { background: var(--hover); }
td.actions-cell { text-align: right; width: 56px; }
td .sub { color: var(--muted); font-size: 12px; }

.bar { height: 4px; margin-top: 20px; background: var(--line); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
#progressText { margin-top: 8px; }
.msg { margin-top: 12px; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--ok); }
