:root {
  --bg: #f3f0e8;
  --surface: #fffaf0;
  --surface-strong: #fff4dc;
  --ink: #1d2522;
  --muted: #63716b;
  --line: #d8d0bf;
  --gold: #c8972f;
  --green: #3f8f5a;
  --red: #b54c43;
  --blue: #355c7d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(53, 92, 125, .13), transparent 34%), var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.userbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, .94);
  padding: 8px 28px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.userbar a {
  color: var(--ink);
  text-decoration: none;
}
.userbar a:hover {
  color: var(--blue);
}
.userbar form {
  display: block;
}
.link-button {
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
}
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}
.auth-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
}
.auth-card .brand {
  margin-bottom: 18px;
}
.auth-card h2 {
  margin: 0 0 16px;
}
.form-error {
  border: 1px solid rgba(181, 76, 67, .35);
  border-radius: 8px;
  background: rgba(181, 76, 67, .08);
  color: var(--red);
  padding: 10px 12px;
  font-weight: 800;
}
.app {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 240, .82);
  padding: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: #243029;
  color: #ffd478;
  font-weight: 900;
}
.brand p, .eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.brand h1, .topbar h2, .event-hero h1 {
  margin: 2px 0 0;
  letter-spacing: 0;
}
.panel, .calendar, .filters, .table-wrap, .empty, .event-hero, .danger-zone {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.panel {
  padding: 16px;
  margin-bottom: 16px;
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 20px;
}
form {
  display: grid;
  gap: 12px;
}
label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}
input, select {
  min-height: 42px;
}
textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.35;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.checkline input {
  width: auto;
  min-height: 0;
}
button, .button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 13px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}
.mark.readonly {
  display: inline-grid;
  place-items: center;
  cursor: default;
}
.primary {
  border-color: #a97717;
  background: var(--gold);
  color: #13110b;
}
.danger {
  border-color: rgba(181, 76, 67, .35);
  color: var(--red);
}
.workspace {
  min-width: 0;
  padding: 28px;
}
.single {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px;
}
.topbar, .event-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}
.event-hero {
  padding: 22px;
  margin-top: 16px;
}
.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.stats div, .stat-link {
  min-width: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
}
.stat-link:hover {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(200, 151, 47, .18);
}
.stats b {
  display: block;
  font-size: 22px;
}
.stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.dashboard {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}
.metric-card, .dashboard-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.metric-card {
  min-height: 116px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px;
}
.metric-card span, .metric-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.metric-card b {
  display: block;
  font-size: 30px;
  line-height: 1;
}
.meter, .bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(99, 113, 107, .18);
}
.meter i, .bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(240px, .9fr) minmax(240px, 1fr);
  gap: 10px;
}
.dashboard-panel {
  padding: 14px;
}
.dashboard-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}
.role-bars, .risk-list, .recent-list, .skipper-dashboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.role-bars li {
  display: grid;
  grid-template-columns: 78px 1fr 32px;
  align-items: center;
  gap: 8px;
}
.role-bars span, .risk-list span, .recent-list span, .skipper-dashboard-list span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-bars b, .risk-list b {
  text-align: right;
}
.risk-list li, .recent-list li, .skipper-dashboard-list li {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.recent-list li {
  grid-template-columns: 64px 1fr;
}
.skipper-dashboard-list li {
  grid-template-columns: minmax(90px, .8fr) minmax(130px, 1.2fr) minmax(70px, .8fr);
}
.skipper-dashboard-list b {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.risk-list a, .recent-list a, .skipper-dashboard-list a {
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}
.risk-list a:hover, .recent-list a:hover, .skipper-dashboard-list a:hover {
  text-decoration: underline;
}
.calendar {
  padding: 16px;
  margin-bottom: 16px;
}
.calendar header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.calendar h3 {
  margin: 0;
  text-transform: capitalize;
}
.weekdays, .month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(70px, 1fr));
  gap: 6px;
}
.weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}
.day {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}
.day.today {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px rgba(200, 151, 47, .2);
}
.day.muted {
  background: rgba(255, 255, 255, .38);
}
.day b, .day span {
  display: block;
}
.day span {
  color: var(--muted);
  font-size: 11px;
}
.day ul {
  list-style: none;
  margin: 7px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.day li {
  overflow: hidden;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px minmax(210px, auto) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}
.inline-form button {
  align-self: end;
}
.table-wrap {
  overflow: auto;
}
.compact-table {
  margin-top: 8px;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 820px;
}
th, td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 10px;
  vertical-align: middle;
}
th {
  background: var(--surface-strong);
  text-align: left;
}
th:first-child, td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
}
.event-link {
  display: grid;
  gap: 4px;
  min-width: 96px;
  text-decoration: none;
}
.player-link {
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}
.player-link:hover {
  text-decoration: underline;
}
.event-link small, .role, .status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.player-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.player-cell span {
  display: grid;
  gap: 2px;
}
details summary {
  min-width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.import-details {
  margin: 12px 0;
}
.import-details summary {
  min-height: 40px;
  padding: 9px 13px;
  font-weight: 900;
}
.import-details form {
  margin-top: 12px;
}
.inline-editor form {
  position: fixed;
  z-index: 80;
  width: min(300px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 18px 42px rgba(29, 37, 34, .18);
}
.mark {
  width: 78px;
  min-height: 34px;
  padding: 6px 8px;
}
.mark.present {
  border-color: rgba(63, 143, 90, .35);
  background: rgba(63, 143, 90, .12);
  color: var(--green);
}
.mark.absent {
  border-color: rgba(181, 76, 67, .3);
  background: rgba(181, 76, 67, .08);
  color: var(--red);
}
.summary {
  font-weight: 900;
}
.summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.equipment-pill {
  display: inline-grid;
  gap: 2px;
  min-width: 120px;
  margin: 2px 4px 2px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
  vertical-align: top;
}
.empty {
  padding: 22px;
  color: var(--muted);
  font-weight: 800;
}
.muted-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.notice {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  text-align: center;
  font-weight: 800;
}
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.composition {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.composition li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.skipper-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
}
.skipper-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.skipper-list span {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.skipper-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-button {
  min-height: 32px;
  padding: 5px 9px;
}
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.row-actions form {
  display: inline-grid;
}
.danger-zone {
  margin-top: 16px;
  padding: 16px;
}
.danger-zone form {
  display: flex;
  align-items: center;
  gap: 12px;
}
.danger-zone span {
  color: var(--muted);
  font-size: 13px;
}
.ru-date-picker {
  position: relative;
}
.ru-date-field {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 6px;
}
.ru-date-toggle {
  min-height: 42px;
  padding: 0;
}
.ru-date-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(292px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 18px 42px rgba(29, 37, 34, .18);
}
.ru-date-popover[hidden] {
  display: none;
}
.ru-date-head {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ru-date-title {
  font-weight: 900;
  text-align: center;
  text-transform: capitalize;
}
.ru-date-nav {
  min-height: 32px;
  padding: 0;
}
.ru-date-weekdays, .ru-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.ru-date-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}
.ru-date-day {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 0;
}
.ru-date-day.outside {
  color: #8a928d;
}
.ru-date-day.selected {
  background: var(--gold);
}
.ru-date-day.today:not(.selected) {
  box-shadow: inset 0 0 0 1px var(--gold);
}
.ru-date-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}
.ru-date-actions button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 4px;
}
@media (max-width: 860px) {
  .app, .event-grid {
    grid-template-columns: 1fr;
  }
  .metric-grid, .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .topbar, .event-hero {
    display: grid;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .weekdays, .month-grid {
    grid-template-columns: repeat(7, minmax(42px, 1fr));
  }
  .day {
    min-height: 72px;
    padding: 5px;
  }
  .day span, .day li, .day small {
    display: none;
  }
}

/* Bootstrap app skin */
:root {
  --app-bg: #eef1f0;
  --app-panel: #ffffff;
  --app-panel-soft: #f8f5ee;
  --app-ink: #14201b;
  --app-muted: #64706a;
  --app-line: #d8ddd8;
  --app-gold: #d3a033;
  --app-gold-dark: #9a6d16;
  --app-green: #2f8f58;
  --app-red: #bd4d43;
  --app-blue: #2f5f86;
  --app-nav: #17231d;
}

body.app-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% -10%, rgba(211, 160, 51, .16), transparent 28%),
    linear-gradient(135deg, rgba(47, 95, 134, .11), transparent 42%),
    var(--app-bg);
  color: var(--app-ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.app-navbar {
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(90deg, #14201b, #21352b);
  box-shadow: 0 10px 28px rgba(20, 32, 27, .18);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: 28px;
  color: #fff !important;
}

.app-brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 212, 120, .38);
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
  color: #ffd478;
  font-weight: 900;
  letter-spacing: 0;
}

.app-brand-kicker,
.app-brand-name {
  display: block;
  line-height: 1.1;
}

.app-brand-kicker {
  color: rgba(255, 255, 255, .62);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.app-brand-name {
  font-size: 20px;
  font-weight: 900;
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, .28);
}

.navbar-toggler-icon {
  filter: invert(1);
}

.app-nav-links {
  gap: 4px;
}

.app-nav-links .nav-link {
  border-radius: 8px;
  color: rgba(255, 255, 255, .76);
  font-weight: 800;
  padding: 9px 12px;
}

.app-nav-links .nav-link:hover,
.app-nav-links .nav-link:focus {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.app-user {
  display: grid;
  gap: 1px;
  margin-right: 12px;
  color: #fff;
  text-align: right;
}

.app-user-name {
  font-size: 14px;
  font-weight: 900;
}

.app-user-role {
  color: rgba(255, 255, 255, .58);
  font-size: 11px;
  font-weight: 800;
}

.app-logout {
  display: block;
}

body.app-body main.container,
body.app-body main.container-fluid {
  padding-top: 24px !important;
  padding-bottom: 36px !important;
}

body.app-body main.container-fluid {
  max-width: 1760px;
}

body.app-body .app-shell {
  display: grid;
  gap: 14px;
}

body.app-body [id] {
  scroll-margin-top: 86px;
}

body.app-body .app-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 2px;
}

body.app-body .app-page-head h1,
body.app-body .app-hero-card h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
}

body.app-body .app-kicker {
  margin-bottom: 5px;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body.app-body h1,
body.app-body h2,
body.app-body h3,
body.app-body h4,
body.app-body h5 {
  color: var(--app-ink);
  font-weight: 900;
  letter-spacing: 0;
}

body.app-body .text-muted {
  color: var(--app-muted) !important;
}

body.app-body .card {
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 28px rgba(20, 32, 27, .07);
}

body.app-body .card-body {
  padding: 16px;
}

body.app-body .app-metric-row {
  align-items: stretch;
}

body.app-body .app-metric {
  height: 100%;
  color: var(--app-ink);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

body.app-body a.app-metric {
  cursor: pointer;
}

body.app-body .app-metric:hover,
body.app-body a.app-metric:hover {
  border-color: rgba(211, 160, 51, .7);
  box-shadow: 0 14px 34px rgba(154, 109, 22, .15);
  transform: translateY(-1px);
}

body.app-body .app-metric .card-body {
  display: grid;
  align-content: space-between;
  min-height: 88px;
  gap: 6px;
}

body.app-body .app-metric span,
body.app-body .app-metric small,
body.app-body .app-mini-metric span {
  overflow: hidden;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-body .app-metric b {
  overflow: hidden;
  font-size: 28px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-body .app-metric b.app-metric-small {
  font-size: 20px;
}

body.app-body .app-dashboard-details {
  scroll-margin-top: 16px;
}

body.app-body .app-dashboard-details .card-body {
  padding: 14px 16px;
}

body.app-body .app-scroll-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

body.app-body .app-mini-metric {
  display: grid;
  gap: 6px;
  min-height: 74px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

body.app-body .app-mini-metric b {
  overflow: hidden;
  font-size: 26px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-body .app-hero-card {
  background: linear-gradient(180deg, #fff, #fbf8f0);
}

body.app-body .app-action-card h5,
body.app-body .app-list-card h2,
body.app-body .app-list-card h5 {
  margin-bottom: 12px;
}

body.app-body .app-profile-daystack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.app-body .app-profile-daycard {
  flex: 0 0 auto;
}

body.app-body .app-profile-daycard .card-body {
  display: flex;
  flex-direction: column;
}

body.app-body .app-filter-bar {
  box-shadow: none;
}

body.app-body .display-6,
body.app-body .fs-3 {
  color: var(--app-ink);
  line-height: 1;
}

body.app-body .btn {
  border-radius: 8px;
  font-weight: 900;
}

body.app-body .btn-warning {
  border-color: var(--app-gold-dark);
  background: var(--app-gold);
  color: #18130a;
}

body.app-body .btn-warning:hover {
  border-color: #80570f;
  background: #c38f25;
}

body.app-body .btn-outline-dark,
body.app-body .btn-outline-secondary {
  border-color: #aeb8b1;
  color: var(--app-ink);
}

body.app-body .btn-outline-dark:hover,
body.app-body .btn-outline-secondary:hover {
  border-color: var(--app-nav);
  background: var(--app-nav);
  color: #fff;
}

body.app-body .btn-success,
body.app-body .text-bg-success {
  background-color: var(--app-green) !important;
  border-color: var(--app-green) !important;
}

body.app-body .btn-outline-danger,
body.app-body .text-bg-danger {
  border-color: rgba(189, 77, 67, .55);
  color: var(--app-red);
}

body.app-body .btn-outline-danger:hover {
  background: var(--app-red);
  color: #fff;
}

body.app-body .form-control,
body.app-body .form-select {
  border-color: #cfd6d0;
  border-radius: 8px;
  min-height: 42px;
}

body.app-body .form-control:focus,
body.app-body .form-select:focus {
  border-color: var(--app-gold);
  box-shadow: 0 0 0 .2rem rgba(211, 160, 51, .2);
}

body.app-body .form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding-left: 0;
  color: var(--app-ink);
  font-size: 14px;
  font-weight: 800;
}

body.app-body .form-check .form-check-input,
body.app-body input.form-check-input {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  min-height: 0;
  margin: 0;
  border-radius: 4px;
}

body.app-body .form-check-label {
  margin: 0;
  color: var(--app-ink);
  font-size: 14px;
  font-weight: 800;
}

body.app-body form {
  display: block;
}

body.app-body .card form,
body.app-body form.card {
  display: block;
}

body.app-body .table-responsive {
  border-color: var(--app-line) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 30px rgba(20, 32, 27, .07);
}

body.app-body .app-table-card {
  background: #fff;
}

body.app-body .app-killboard-table-card {
  max-height: clamp(520px, calc(100vh - 270px), 720px);
  overflow: auto;
}

body.app-body .app-killboard-table {
  min-width: 760px;
}

body.app-body .app-killboard-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

body.app-body .app-killboard-arrow {
  display: inline-block;
  transition: transform .18s ease;
  font-size: 18px;
  line-height: 1;
}

body.app-body .app-killboard-toggle[aria-expanded="true"] .app-killboard-arrow {
  transform: rotate(180deg);
}

body.app-body .app-killboard-collapse {
  background: #f7f5ef;
  border-top: 1px solid var(--app-line);
}

body.app-body .app-killboard-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  align-items: stretch;
}

body.app-body .app-killboard-side {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  padding: 14px;
}

body.app-body .app-killboard-side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

body.app-body .app-killboard-side-title {
  font-size: 14px;
  font-weight: 900;
  color: #1c2621;
}

body.app-body .app-killboard-side-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--app-muted);
}

body.app-body .app-killboard-link {
  color: var(--app-blue);
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

body.app-body .app-killboard-link:hover {
  text-decoration: underline;
}

body.app-body .app-killboard-gear-layout {
  display: grid;
  gap: 8px;
}

body.app-body .app-killboard-gear-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.app-body .app-killboard-gear-card {
  min-height: 74px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffef9 0%, #f8f4ea 100%);
  padding: 8px 8px 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

body.app-body .app-killboard-gear-card.is-empty {
  opacity: .58;
}

body.app-body .app-killboard-gear-card.is-wide {
  grid-column: 1 / -1;
}

body.app-body .app-killboard-gear-slot {
  font-size: 10px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--app-muted);
  align-self: flex-start;
}

body.app-body .app-killboard-gear-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: auto;
}

body.app-body .app-killboard-gear-empty {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #ede7db;
  color: var(--app-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
}

body.app-body .app-killboard-center {
  background: #f3efe6;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  min-height: 100%;
}

body.app-body .app-killboard-center-badge {
  width: 100%;
  border-radius: 999px;
  background: #1f2b24;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 6px 10px;
}

body.app-body .app-killboard-center-time {
  font-size: 13px;
  font-weight: 800;
  color: #1b251f;
}

body.app-body .app-killboard-center-fame {
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  color: #b36d00;
}

body.app-body .app-killboard-center-note {
  font-size: 12px;
  color: var(--app-muted);
}

body.app-body .app-killboard-side-title,
body.app-body .app-killboard-center-time,
body.app-body .app-killboard-center-note,
body.app-body .app-killboard-link {
  letter-spacing: 0;
}

@media (max-width: 991.98px) {
  body.app-body .app-killboard-details {
    grid-template-columns: 1fr;
  }
}

body.app-body .app-journal-table-card {
  max-height: clamp(520px, calc(100vh - 270px), 680px);
  overflow: auto;
}

body.app-body .table {
  --bs-table-bg: rgba(255, 255, 255, .95);
  --bs-table-striped-bg: #f8f5ee;
  margin-bottom: 0;
  min-width: 900px;
}

body.app-body .table th {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid var(--app-line);
  background: #f3ecd9;
  color: #1b251f;
  font-size: 13px;
  font-weight: 900;
  vertical-align: middle;
}

body.app-body .table td {
  border-color: #e3e6e1;
  vertical-align: middle;
}

body.app-body .table td,
body.app-body .table th {
  white-space: nowrap;
}

body.app-body .table a {
  color: var(--app-blue);
  text-decoration: none;
}

body.app-body .table a:hover {
  text-decoration: underline;
}

body.app-body .table tbody tr:hover td {
  background: #fbf7ed;
}

body.app-body .app-roster-table {
  min-width: 760px;
}

body.app-body .app-roster-player-col {
  width: 28%;
}

body.app-body .app-roster-role-col {
  width: 150px;
}

body.app-body .app-roster-ip-col {
  width: 92px;
}

body.app-body .app-roster-table .app-roster-equipment {
  white-space: normal;
}

body.app-body .app-roster-table .app-roster-equipment .badge {
  margin: 2px 4px 2px 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

body.app-body .app-roster-table .app-roster-ip {
  min-width: 92px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

body.app-body .badge {
  border-radius: 999px;
  font-weight: 900;
  padding: .42em .7em;
}

body.app-body .app-money {
  font-weight: 900;
  color: var(--app-ink);
}

body.app-body .app-tabs {
  border-bottom-color: var(--app-line);
}

body.app-body .app-tabs .nav-link {
  border-radius: 8px 8px 0 0;
  color: var(--app-muted);
  font-weight: 900;
}

body.app-body .app-tabs .nav-link:hover {
  border-color: transparent;
  color: var(--app-ink);
}

body.app-body .app-tabs .nav-link.active {
  border-color: var(--app-line) var(--app-line) #fff;
  background: #fff;
  color: var(--app-ink);
}

body.app-body .app-composition-card {
  overflow: hidden;
}

body.app-body .app-composition-chart {
  position: relative;
  display: grid;
  place-items: center;
  width: min(240px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: transparent;
}

body.app-body .app-composition-chart svg {
  position: absolute;
  inset: 0;
  overflow: visible;
}

body.app-body .app-composition-slice {
  cursor: help;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .15s ease, transform .15s ease, filter .15s ease;
}

body.app-body .app-composition-slice:hover {
  filter: brightness(1.04);
  opacity: .9;
  transform: scale(1.015);
}

body.app-body .app-chart-tooltip {
  position: fixed;
  z-index: 1100;
  max-width: 220px;
  border: 1px solid rgba(32, 22, 7, .18);
  border-radius: 8px;
  background: rgba(32, 22, 7, .94);
  color: #fffaf0;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
  transform: translate(12px, 12px);
  box-shadow: 0 12px 30px rgba(32, 22, 7, .18);
}

body.app-body .app-composition-chart div {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: 36%;
  aspect-ratio: 1;
  place-content: center;
  border-radius: 50%;
  background: #fffaf0;
  box-shadow: 0 0 0 1px var(--app-line);
  line-height: 1.1;
}

body.app-body .app-composition-chart b {
  font-size: 28px;
}

body.app-body .app-composition-chart span {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
}

body.app-body .app-composition-legend {
  display: grid;
  gap: 8px;
}

body.app-body .app-composition-legend div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

body.app-body .app-composition-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

body.app-body .app-composition-legend span {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-body .app-composition-legend small {
  color: var(--app-muted);
  font-weight: 800;
}

body.app-body .app-role-pills {
  gap: 6px;
}

body.app-body .app-role-pills .nav-link {
  border: 1px solid var(--app-line);
  border-radius: 8px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 900;
}

body.app-body .app-role-pills .nav-link.active {
  border-color: rgba(211, 160, 51, .85);
  background: #d3a033;
  color: #201607;
}

body.app-body .app-weapon-tabs {
  min-height: 106px;
}

body.app-body .app-weapon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

body.app-body .app-weapon-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

body.app-body .app-weapon-chip span {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-body .app-weapon-chip b {
  flex: 0 0 auto;
}

body.app-body .app-role-select {
  min-width: 96px;
}

body.app-body .app-role-confirm-select {
  max-width: 260px;
  min-width: 190px;
}

body.app-body .app-user-link-field {
  width: min(100%, 280px);
}

body.app-body .app-user-link-field .form-label {
  margin-bottom: 3px;
}

body.app-body .resource-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: -6px 0 14px;
}

body.app-body .resource-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
  align-items: stretch;
}

body.app-body .resource-tier {
  height: 100%;
  overflow: hidden;
}

body.app-body .resource-tier .card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.app-body .resource-tier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  padding: 12px 14px;
  color: #fff;
}

body.app-body .resource-tier-head h2 {
  margin: 0;
  font-size: 22px;
}

body.app-body .resource-tier-head span {
  font-weight: 800;
  opacity: .84;
}

body.app-body .resource-tier-t4 .resource-tier-head {
  background: #2f5f86;
}

body.app-body .resource-tier-t5 .resource-tier-head {
  background: #9f4b48;
}

body.app-body .resource-tier-t6 .resource-tier-head {
  background: #d28a2e;
}

body.app-body .resource-tier-t7 .resource-tier-head {
  background: #d3a033;
  color: #1f1708;
}

body.app-body .resource-tier-t8 .resource-tier-head {
  background: #eef1ef;
  color: #17211c;
}

body.app-body .resource-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0;
  font-weight: 800;
}

body.app-body .resource-sub {
  margin-top: 6px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 700;
}

body.app-body .resource-linked {
  border-color: #d3a033;
  background: #fff8e5;
}

body.app-body .resource-prev-placeholder {
  min-height: 46px;
}

body.app-body .resource-result {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f5f7f4;
  border: 1px solid var(--app-line);
}

body.app-body .resource-result div,
body.app-body .resource-profit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.app-body .resource-result span,
body.app-body .resource-profit span {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
}

body.app-body .resource-result b {
  font-size: 18px;
}

body.app-body .resource-sell {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

body.app-body .resource-profit {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--app-line);
}

body.app-body .resource-profit b {
  font-size: 18px;
}

body.app-body .resource-profit small {
  min-width: 58px;
  text-align: right;
  font-weight: 900;
}

body.app-body .resource-profit-good {
  background: #edf8f0;
  color: #236b3e;
}

body.app-body .resource-profit-bad {
  background: #fff1ee;
  color: #a53a2f;
}

body.app-body .resource-profit-neutral {
  background: #f5f7f4;
  color: var(--app-muted);
}

body.app-body .battle-rank {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-height: 38px;
  border: 1px solid #e1e7e1;
  border-radius: 8px;
  background: #f5f8f5;
  padding: 8px 10px;
  margin-bottom: 8px;
}

body.app-body .battle-rank span,
body.app-body .battle-rank b {
  position: relative;
  z-index: 1;
}

body.app-body .battle-rank span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-body .battle-rank i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: rgba(47, 143, 88, .18);
}

body.app-body .battle-rank-danger i {
  background: rgba(189, 77, 67, .16);
}

body.app-body .app-attention-card {
  border-color: #dfe6df;
  background: #ffffff;
}

body.app-body .app-attention-grid {
  align-items: stretch;
}

body.app-body .app-attention-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}

body.app-body .app-attention-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--app-muted);
}

body.app-body .app-attention-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #f8faf8;
  color: var(--app-ink);
  text-decoration: none;
}

body.app-body .app-attention-item:hover {
  border-color: #b8c9bd;
  background: #f2f7f2;
}

body.app-body .app-attention-item span {
  grid-row: span 2;
  align-self: start;
  min-width: 58px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

body.app-body .app-attention-item b,
body.app-body .app-attention-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-body .app-attention-item b {
  font-size: 14px;
}

body.app-body .app-attention-item small {
  color: var(--app-muted);
}

body.app-body .app-attention-danger span {
  background: #ffe3df;
  color: #9b3128;
}

body.app-body .app-attention-warning span {
  background: #fff0c2;
  color: #7a520b;
}

body.app-body .app-attention-info span {
  background: #e3eefb;
  color: #245887;
}

body.app-body .app-attention-empty {
  min-height: 62px;
  padding: 12px;
  border: 1px dashed #d6ded6;
  border-radius: 8px;
  color: var(--app-muted);
  background: #fbfcfb;
  font-size: 13px;
}

body.app-body .text-bg-warning {
  background-color: #f0c35b !important;
  color: #201607 !important;
}

body.app-body .text-bg-secondary {
  background-color: #596960 !important;
}

body.app-body .text-bg-light {
  border: 1px solid #d8ddd8;
  background-color: #f5f7f4 !important;
  color: #596960 !important;
}

body.app-body .btn-group .btn {
  min-height: 42px;
}

body.app-body .border-bottom {
  border-color: var(--app-line) !important;
}

body.app-body .auth-page {
  background:
    radial-gradient(circle at 50% 0, rgba(211, 160, 51, .18), transparent 34%),
    linear-gradient(135deg, rgba(47, 95, 134, .14), transparent 44%),
    var(--app-bg);
}

body.app-body .auth-card {
  border-color: var(--app-line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 45px rgba(20, 32, 27, .12);
}

@media (max-width: 991px) {
  body.app-body .resource-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  body.app-body .app-page-head {
    align-items: stretch;
    display: grid;
  }

  .app-user {
    margin: 12px 0;
    text-align: left;
  }

  .app-logout {
    margin-bottom: 8px;
  }
}

@media (max-width: 720px) {
  body.app-body .resource-grid {
    grid-template-columns: 1fr;
  }

  body.app-body main.container,
  body.app-body main.container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  .app-brand-name {
    font-size: 18px;
  }

  .app-brand-mark {
    width: 40px;
    height: 40px;
  }

  body.app-body .card-body {
    padding: 14px;
  }
}
