/* Berlitz 360 — shared components */

/* Page header */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--b360-ink);
}
.page-head__sub {
  margin-top: 3px;
  font-size: 13px;
  color: var(--b360-ink-3);
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--b360-r);
  padding: 9px 14px;
  border: 1px solid var(--b360-line-2);
  background: var(--b360-surface);
  color: var(--b360-ink);
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover {
  background: var(--b360-surface-2);
  border-color: var(--b360-ink-3);
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--b360-blue);
  border-color: var(--b360-blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(27, 108, 181, 0.25);
}
.btn.primary:hover {
  background: #155a9c;
  border-color: #155a9c;
}
.btn.danger {
  border-color: var(--b360-err-line);
  color: var(--b360-err);
}
.btn.danger:hover { background: var(--b360-err-soft); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Surface / panel */
.panel {
  background: var(--b360-surface);
  border: 1px solid var(--b360-line);
  border-radius: var(--b360-r-lg);
  box-shadow: var(--b360-shadow-sm);
  margin-bottom: 14px;
  min-width: 0;
  overflow: hidden;
}
.panel__hd {
  padding: 13px 16px;
  border-bottom: 1px solid var(--b360-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #fff 0%, var(--b360-surface-2) 100%);
}
.panel__hd h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.panel__meta {
  font-size: 12px;
  color: var(--b360-ink-3);
}
.panel__bd { padding: 16px; }

/* Table */
.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
table.data thead th {
  font-size: 12px;
  font-weight: 500;
  color: var(--b360-ink-2);
  text-align: right;
  padding: 11px 14px;
  background: var(--b360-surface-2);
  border-bottom: 1px solid var(--b360-line);
  white-space: nowrap;
}
table.data tbody tr {
  border-bottom: 1px solid var(--b360-line);
  cursor: pointer;
  transition: background 0.12s;
}
table.data tbody tr:hover { background: #F1F5F9; }
table.data tbody tr:last-child { border-bottom: none; }
table.data tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nm { font-weight: 560; }
.sub2 { font-size: 12px; color: var(--b360-ink-3); }

/* Chips */
.chip {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip.on {
  background: var(--b360-ok-soft);
  color: var(--b360-ok);
  border: 1px solid var(--b360-ok-line);
}
.chip.off {
  background: var(--b360-surface-2);
  color: var(--b360-ink-2);
  border: 1px solid var(--b360-line-2);
}
.chip.role {
  background: var(--b360-blue-soft);
  color: var(--b360-navy-2);
  border: 1px solid var(--b360-blue-line);
}
.chip.sys {
  background: var(--b360-sys-soft);
  color: var(--b360-sys);
  border: 1px solid var(--b360-sys-line);
}

/* Live status */
.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  white-space: nowrap;
}
.live .d {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--b360-line-2);
  flex: 0 0 auto;
}
.live.on { color: var(--b360-ok); font-weight: 500; }
.live.on .d {
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.live.off { color: var(--b360-ink-3); }

/* Mobile cards (list alternate) */
.cards {
  display: none;
  padding: 10px;
  gap: 9px;
  flex-direction: column;
}
.ucard {
  border: 1px solid var(--b360-line);
  border-radius: var(--b360-r-lg);
  padding: 12px 13px;
  cursor: pointer;
  background: var(--b360-surface);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.ucard:hover {
  border-color: var(--b360-blue-line);
  box-shadow: var(--b360-shadow-sm);
}
.ucard .hd {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

/* Drawer */
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--b360-ease);
  z-index: 30;
}
.scrim.is-on {
  opacity: 1;
  pointer-events: auto;
}
.drawer {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: min(480px, 100%);
  background: var(--b360-surface);
  border-inline-end: 1px solid var(--b360-line);
  z-index: 31;
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 0.28s var(--b360-ease), visibility 0.28s;
  display: flex;
  flex-direction: column;
  overflow: auto;
  box-shadow: var(--b360-shadow-lg);
}
.drawer.is-on {
  transform: none;
  visibility: visible;
}
.drawer__hd {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--b360-line);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  z-index: 2;
}
.drawer__hd h2 {
  font-size: 16px;
  font-weight: 650;
  margin: 0;
}
.drawer__x {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--b360-ink-2);
  padding: 2px 8px;
  border-radius: var(--b360-r);
}
.drawer__x:hover { background: var(--b360-surface-2); }

/* Forms */
.form { padding: 16px; }
fieldset {
  border: none;
  border-top: 1px solid var(--b360-line);
  margin: 0 0 16px;
  padding: 14px 0 0;
}
fieldset:first-of-type { border-top: none; padding-top: 0; }
legend {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--b360-ink-3);
  letter-spacing: 0.04em;
  padding: 0 0 8px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.row.one { grid-template-columns: 1fr; }
.f {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.f label {
  font-size: 12px;
  color: var(--b360-ink-2);
  font-weight: 500;
}
.f .hint {
  font-size: 11px;
  color: var(--b360-ink-3);
}
input, select, textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--b360-ink);
  background: var(--b360-surface);
  border: 1px solid var(--b360-line-2);
  border-radius: var(--b360-r);
  padding: 9px 11px;
  width: 100%;
  max-width: 100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  max-width: none;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--b360-blue);
  box-shadow: 0 0 0 3px var(--b360-blue-soft);
}
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: none;
}
input[disabled], select[disabled] {
  background: var(--b360-surface-2);
  color: var(--b360-ink-3);
}
.cbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.cb {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: var(--b360-r);
  font-size: 13px;
  cursor: pointer;
}
.cb:hover { background: var(--b360-surface-2); }
.cb input[type="checkbox"],
.cb input[type="radio"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--b360-blue);
  cursor: pointer;
}
.cb span { flex: 1; min-width: 0; }
.warnbox {
  font-size: 12px;
  background: var(--b360-warn-soft);
  border: 1px solid var(--b360-warn-line);
  color: var(--b360-warn);
  border-radius: var(--b360-r);
  padding: 10px 12px;
  margin-top: 10px;
  line-height: 1.55;
}
.fixed {
  font-size: 12px;
  background: var(--b360-surface-2);
  border: 1px solid var(--b360-line);
  color: var(--b360-ink-3);
  border-radius: var(--b360-r);
  padding: 10px 12px;
  margin-top: 10px;
  line-height: 1.6;
}
.formfoot {
  display: flex;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--b360-line);
  flex-wrap: wrap;
}
.formfoot .spacer { flex: 1; }
.note {
  font-size: 12px;
  color: var(--b360-ink-3);
  padding: 10px 14px 12px;
  margin: 0;
}

/* Settings layout */
.settings-wrap {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.settings-wrap > * { min-width: 0; }
.settings-nav {
  background: var(--b360-surface);
  border: 1px solid var(--b360-line);
  border-radius: var(--b360-r-lg);
  padding: 6px;
  box-shadow: var(--b360-shadow-sm);
}
.settings-nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: right;
  font-family: inherit;
  font-size: 13px;
  padding: 10px 11px;
  border: none;
  background: transparent;
  border-radius: var(--b360-r);
  cursor: pointer;
  color: var(--b360-ink-2);
}
.settings-nav button:hover { background: var(--b360-surface-2); }
.settings-nav button.is-on {
  background: var(--b360-blue-soft);
  color: var(--b360-navy-2);
  font-weight: 500;
}
.settings-nav button[disabled] {
  color: var(--b360-ink-3);
  cursor: not-allowed;
  opacity: 0.65;
}
.settings-nav .soon {
  font-size: 10.5px;
  color: var(--b360-ink-3);
  border: 1px solid var(--b360-line);
  border-radius: 999px;
  padding: 0 7px;
  margin-inline-start: auto;
}

/* List rows (settings) */
.lrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--b360-line);
  border-radius: var(--b360-r);
  margin-bottom: 6px;
  background: var(--b360-surface);
  transition: border-color 0.12s;
}
.lrow:hover { border-color: var(--b360-line-2); }
.lrow .g {
  color: var(--b360-ink-3);
  cursor: grab;
  font-size: 13px;
}
.lrow .t { flex: 1; min-width: 0; font-size: 13px; }
.lrow .d {
  border: none;
  background: transparent;
  color: var(--b360-err);
  cursor: pointer;
  font-size: 16px;
  padding: 0 5px;
  border-radius: var(--b360-r);
}
.lrow .d:hover { background: var(--b360-err-soft); }
.lrow .d[disabled] {
  color: var(--b360-ink-3);
  opacity: 0.4;
  cursor: not-allowed;
}
.lrow.lock { background: var(--b360-surface-2); }
.addrow {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.addrow input { flex: 1; }
.used {
  font-size: 11.5px;
  color: var(--b360-ink-3);
  margin-top: 8px;
}

/* Course catalog (settings) */
.course-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.course-save-msg {
  font-size: 12.5px;
  color: var(--b360-ink-3);
}
.course-save-msg.is-ok { color: var(--b360-ok, #1a7f4b); }
.course-save-msg.is-err { color: var(--b360-warn, #b45309); }
.course-row {
  border: 1px solid var(--b360-line);
  border-radius: var(--b360-r);
  padding: 12px;
  margin-bottom: 8px;
  background: var(--b360-surface);
}
.course-row.is-off { opacity: 0.62; }
.course-row__title {
  font-weight: 600;
  color: var(--b360-navy);
  font-size: 13.5px;
}
.course-row__meta {
  font-size: 12px;
  color: var(--b360-ink-3);
  margin-top: 2px;
}
.course-row__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  align-items: flex-end;
}
.course-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  flex: 1 1 140px;
}
.course-field--sm { flex: 0 1 110px; min-width: 90px; }
.course-field--check {
  flex: 0 0 auto;
  min-width: 0;
  align-items: center;
}
.course-field span {
  font-size: 11.5px;
  color: var(--b360-ink-3);
}
.course-field input[type="text"],
.course-field input[type="number"],
.course-field select {
  width: 100%;
}
.course-field input[type="checkbox"] {
  width: auto;
  margin-top: 4px;
}
.course-row__del {
  align-self: flex-end;
}

/* Empty / placeholder states */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--b360-ink-3);
}
.empty h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--b360-ink);
  font-weight: 650;
}
.empty p { margin: 0 auto; max-width: 420px; font-size: 13.5px; }

.hide { display: none !important; }

@container app (max-width: 900px) {
  .cbs { grid-template-columns: 1fr; }
  .settings-wrap { grid-template-columns: minmax(0, 1fr); }
  .settings-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
  }
  .settings-nav button { width: auto; white-space: nowrap; }
}
@container app (max-width: 620px) {
  table.data { display: none; }
  .cards { display: flex; }
  .drawer { width: 100%; }
  .row { grid-template-columns: 1fr; }
  .formfoot .btn { flex: 1 1 100%; }
  .page-head h1 { font-size: 19px; }
}
