:root {
  --bg1: #061329;
  --bg2: #0b1f3a;
  --card: rgba(255, 255, 255, 0.96);
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ef;
  --green: #059669;
  --amber: #d97706;
  --blue: #1d4ed8;
  --danger: #dc2626;
  --navy: #0f172a;
  --soft: #f8fafc;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  --radius: 24px;
}

.hmb-trs-container * {
  box-sizing: border-box;
}

.hmb-trs-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  color: #fff;
  border-radius: 24px;
}

.hmb-trs-hero {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.7fr 0.9fr;
  gap: 18px;
  align-items: center;
}

.hmb-trs-hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.hmb-trs-hero p {
  margin: 10px 0 0;
  color: #d4dce7;
  font-size: 15px;
}

.hmb-live-box {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 18px;
}

.hmb-live-day {
  font-size: 30px;
  font-weight: 900;
  margin-top: 6px;
}

.hmb-live-date {
  color: #d7e0ea;
  font-size: 14px;
  margin-top: 4px;
}

.hmb-tabs {
  display: flex;
  gap: 10px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.hmb-tab-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
}

.hmb-tab-btn.active {
  background: #fff;
  color: var(--navy);
}

.hmb-tab-pane {
  display: none;
}

.hmb-tab-pane.active {
  display: block;
}

.hmb-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.hmb-card {
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.hmb-role-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 10px;
}

.hmb-role-person {
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 900;
  line-height: 1;
  margin: 6px 0 10px;
  letter-spacing: -0.03em;
  word-break: break-word;
}

.green {
  color: var(--green);
}

.amber {
  color: var(--amber);
}

.blue {
  color: var(--blue);
}

.hmb-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 14px;
}

.hmb-list {
  display: grid;
  gap: 10px;
}

.hmb-item {
  background: var(--soft);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
}

.hmb-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.hmb-section-title {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 900;
}

.hmb-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hmb-trs-container input,
.hmb-trs-container select,
.hmb-trs-container textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font: inherit;
  color: var(--text);
  background: #fff;
}

.hmb-trs-container textarea {
  min-height: 90px;
  resize: vertical;
}

.hmb-btn-primary,
.hmb-btn-outline,
.hmb-btn-danger {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
  font: inherit;
}

.hmb-btn-primary {
  background: var(--navy);
  color: #fff;
}

.hmb-btn-outline {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.hmb-btn-danger {
  background: var(--danger);
  color: #fff;
}

.hmb-btn-small {
  padding: 9px 12px;
  border-radius: 12px;
}

.hmb-person-row,
.hmb-duty-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 10px;
}

.hmb-person-actions,
.hmb-duty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hmb-hint {
  background: var(--soft);
  color: var(--muted);
  border-radius: 18px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.45;
}

.hmb-status {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(16, 185, 129, 0.18);
  color: #d1fae5;
  display: none;
}

.hmb-badge {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 800;
}

.hmb-role-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.hmb-guard {
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius);
  padding: 20px;
}

.hmb-guard h3 {
  margin: 0 0 6px;
}

.hmb-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.hmb-gap-bottom {
  margin-bottom: 14px;
}

.hmb-gap-top {
  margin-top: 10px;
}

.hmb-gap-top-lg {
  margin-top: 18px;
}

.hmb-today-rotation {
  font-size: 32px;
  font-weight: 900;
  color: var(--green);
  margin-top: 6px;
}

@media (max-width: 1100px) {
  .hmb-cards,
  .hmb-admin-grid,
  .hmb-role-edit-grid,
  .hmb-trs-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .hmb-trs-container {
    padding: 12px;
  }

  .hmb-card {
    padding: 16px;
  }

  .hmb-role-title {
    font-size: 20px;
  }

  .hmb-person-row,
  .hmb-duty-row {
    grid-template-columns: 1fr;
  }

  .hmb-row {
    flex-direction: column;
  }
}

/* Login modal */
.hmb-modal[hidden] {
  display: none !important;
}

.hmb-modal:not([hidden]) {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100000;
}

.hmb-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 19, 41, 0.72);
  backdrop-filter: blur(4px);
}

.hmb-modal__dialog {
  position: relative;
  margin: 8vh auto 2rem;
  max-width: 420px;
  width: calc(100% - 32px);
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
}

.hmb-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.hmb-modal__title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.hmb-modal__close {
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
}

.hmb-modal__close:hover {
  color: var(--text);
}

.hmb-modal__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.hmb-modal__tab {
  flex: 1;
  padding: 12px 14px;
  border: 0;
  background: var(--soft);
  cursor: pointer;
  font-weight: 800;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}

.hmb-modal__tab.active {
  background: #fff;
  color: var(--navy);
  border-bottom-color: var(--blue);
}

.hmb-modal__panel {
  padding: 20px;
}

.hmb-modal__hint {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.hmb-modal__submit {
  width: 100%;
  margin-top: 14px;
}

.hmb-modal__remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.hmb-modal__error {
  padding: 12px 20px 20px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

.hmb-link-btn {
  background: none;
  border: 0;
  color: #93c5fd;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.hmb-link-btn:hover {
  color: #bfdbfe;
}

.hmb-empty-note {
  color: var(--muted);
  font-style: italic;
}
