/* Admin: XP welcome screen + Control Panel editor. */

body { overflow: auto; }

/* ---------- Welcome screen ---------- */

.welcome {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: #5a7edc;
  color: #fff;
}
.welcome-band {
  flex: none;
  height: 80px;
  background: #00309c;
  border-bottom: 2px solid #f99736;
}
.welcome-band.bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  border-bottom: 0;
  border-top: 2px solid #5f8ae8;
  font-size: 12px;
}
.back-link { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 14px; }
.back-link:hover { color: #fff; text-decoration: underline; }
.back-link img { width: 26px; height: 26px; }

.welcome-mid {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 30px 20px;
  background: radial-gradient(circle at 10% 10%, #91b1ef 0%, #5a7edc 45%);
}
.welcome-left { width: 300px; text-align: right; }
.welcome-left img { width: 64px; height: 64px; }
.welcome-brand { font: bold 28px var(--font-title); letter-spacing: -.5px; text-shadow: 1px 1px 2px rgba(0,0,0,.3); }
.welcome-left p { font-size: 16px; margin: 30px 0 0; }
.welcome-divider {
  align-self: stretch;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.9) 50%, transparent);
}
.welcome-right { width: 340px; }

.user-tile {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, #0d3aa7 0%, #3c6ed8 60%, transparent 100%);
}
.user-tile > img {
  width: 56px; height: 56px; flex: none;
  padding: 4px; border: 2px solid #fff; border-radius: 6px; background: #fff;
}
.user-fields { flex: 1; }
.user-fields b { display: block; font: bold 18px var(--font-title); margin-bottom: 6px; }
.user-fields label { display: block; margin-bottom: 6px; font-size: 11px; }
.user-fields input { margin-top: 2px; border-radius: 3px; }
.pw-row { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.pw-row input { margin: 0; }
.go-btn {
  flex: none;
  width: 26px; height: 26px; padding: 0;
  border: 1px solid #fff; border-radius: 4px;
  background: linear-gradient(180deg, #74d474, #2e9e2e);
  color: #fff; font-size: 14px; font-weight: bold;
  cursor: pointer;
}
.go-btn:hover { filter: brightness(1.1); }
.login-error {
  min-height: 1.4em;
  margin: 4px 0 0;
  color: #ffe08a;
  font-weight: bold;
}

/* ---------- Panel ---------- */

.panel-bg {
  min-height: 100%;
  padding: 16px;
  background: linear-gradient(180deg, #1d5fd0 0%, #3e86e8 50%, #7ab6f2 100%);
}
.admin-window {
  position: relative;
  max-width: 1200px;
  height: calc(100vh - 32px);
  min-height: 520px;
  margin: 0 auto;
  resize: none;
}
.toolbar-spacer { flex: 1; }
.tool-btn img { vertical-align: middle; }
a.tool-btn { text-decoration: none; }

.admin-body { padding: 8px 10px 10px; }
.admin-tab-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tab-content { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; }
.tab.dirty::after { content: " *"; color: #c00; }

.save-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #d6d2c2;
  background: var(--xp-face);
}
.save-msg { margin-left: 8px; color: var(--xp-muted); }
.save-msg.error { color: #b00; font-weight: bold; }
.save-msg.ok { color: #1a7a1a; }

/* ---------- Forms ---------- */

.form-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 4px 12px;
  align-items: start;
  margin-bottom: 8px;
}
.form-label { padding-top: 4px; }
.hint { display: block; margin-top: 2px; color: #6d6d6d; font-size: 11px; }
.field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field > span { font-size: 11px; color: #333; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; }
.inline > .field { flex: 1 1 180px; }
.inline > .field.narrow { flex: 0 0 90px; }
.inline > .field.narrow-id { flex: 0 1 200px; }
.stack > * + * { margin-top: 8px; }

fieldset.group > legend { font-weight: bold; }

.image-field { display: flex; gap: 10px; align-items: flex-start; }
.image-field .thumb {
  width: 64px; height: 64px; flex: none; object-fit: cover;
  border: 1px solid #b5b3a6; background: #f4f4ef;
}
.image-inputs { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.image-inputs .btns { display: flex; gap: 6px; }

.repeater { display: flex; flex-direction: column; gap: 8px; }
.repeat-item {
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid #d0d0bf;
  border-radius: 3px;
  background: #fff;
}
.repeat-item.compact { padding: 4px 8px; }
.repeat-body { flex: 1; min-width: 0; }
.repeat-tools { flex: none; display: flex; flex-direction: column; gap: 2px; }
.repeat-item.compact .repeat-tools { flex-direction: row; align-items: flex-end; }
.icon-btn {
  width: 22px; height: 20px; padding: 0;
  border: 1px solid #a5a29a; border-radius: 2px;
  background: linear-gradient(#fff, #e3e1d5);
  font-size: 10px; line-height: 1; cursor: pointer;
}
.icon-btn:hover:not(:disabled) { border-color: #e5a01a; }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn.remove { color: #b00; font-weight: bold; }
.repeater > .btn { align-self: flex-start; }

.repeater .repeater .repeat-item { background: #f7f7f2; }

.bands-layout { display: grid; grid-template-columns: 230px 1fr; gap: 14px; min-height: 100%; }
.band-side { display: flex; flex-direction: column; gap: 6px; }
.band-list {
  flex: 1;
  min-height: 200px;
  max-height: calc(100vh - 300px);
  overflow: auto;
  border: 1px solid var(--xp-input-border);
  background: #fff;
}
.band-item {
  display: block;
  width: 100%;
  padding: 3px 6px;
  border: 0;
  background: none;
  font: 12px var(--font-ui);
  text-align: left;
  cursor: pointer;
}
.band-item:hover { background: #eef4fd; }
.band-item.selected { background: var(--xp-select); color: #fff; }
.band-side .btns { display: flex; gap: 6px; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.editor-head h2 { margin: 0; color: #0a246a; font-size: 18px; }
.empty { color: var(--xp-muted); }

.scores { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.score { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.score input { width: 56px; }

.account-form { max-width: 420px; }

@media (max-width: 760px) {
  .welcome-mid { flex-direction: column; gap: 16px; }
  .welcome-left { width: auto; text-align: center; }
  .welcome-left p { margin-top: 10px; }
  .welcome-divider { display: none; }
  .welcome-right { width: 100%; max-width: 360px; }
  .welcome-band { height: 40px; }
  .welcome-band.bottom { height: auto; padding: 10px 16px; flex-direction: column; align-items: flex-start; }
  .panel-bg { padding: 0; }
  .admin-window { height: 100vh; border-radius: 0; }
  .admin-window .title-bar { border-radius: 0; }
  .form-row { grid-template-columns: 1fr; }
  .bands-layout { grid-template-columns: 1fr; }
  .band-list { max-height: 180px; }
  .tab-content { padding: 10px; }
}
