:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-strong: #f0f4f1;
  --ink: #17201b;
  --muted: #647067;
  --line: #d9e1da;
  --accent: #1f7a5a;
  --accent-dark: #145d44;
  --blue: #2765ad;
  --amber: #a76312;
  --red: #b43f3f;
  --soft-red: #fff0ed;
  --soft-green: #edf8f2;
  --soft-blue: #eef4fb;
  --soft-amber: #fff6e6;
  --shadow: 0 8px 22px rgba(25, 38, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  min-height: 40px;
  padding: 7px 12px;
}

button:hover {
  border-color: #b4c4bb;
  background: var(--panel-strong);
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

button.primary:hover {
  background: var(--accent-dark);
}

button.danger {
  border-color: #e1aaa5;
  color: var(--red);
}

button.ghost {
  background: transparent;
}

button.link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  text-align: left;
}

button.link-button:hover {
  color: var(--accent);
  background: transparent;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 10px;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.login-card p {
  color: var(--muted);
  margin: 0 0 20px;
}

.login-card form {
  display: grid;
  gap: 14px;
}

.reset-box {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.reset-box summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 700;
}

.reset-box form {
  margin-top: 12px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 360px) auto;
  gap: 14px;
  align-items: center;
  padding: 12px clamp(14px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-size: 18px;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: calc(100vh - 65px);
}

.tabs {
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  background: color-mix(in srgb, var(--panel) 80%, var(--bg));
  min-width: 0;
}

.tab-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border: 0;
  background: transparent;
  margin-bottom: 4px;
}

.tab-button.active {
  background: var(--panel-strong);
  color: var(--accent-dark);
  font-weight: 700;
}

.content {
  min-width: 0;
  padding: clamp(14px, 3vw, 28px);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(23, 32, 27, 0.28);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 41;
  width: min(620px, 100vw);
  height: 100vh;
  overflow-y: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 20px;
  box-shadow: -12px 0 28px rgba(25, 38, 31, 0.16);
}

.subh-upload-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  align-items: start;
  margin-bottom: 14px;
}

.subh-upload-card h3,
.subh-upload-card p {
  margin-top: 0;
}

.subh-upload-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.subh-upload-card:nth-child(1) .subh-upload-icon {
  background: var(--soft-green);
  color: var(--accent-dark);
}

.subh-upload-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.subh-upload-form p {
  margin: 0;
}

.subh-upload-form button {
  justify-self: start;
}

.subh-records-panel {
  margin-top: 14px;
}

.subh-records-table {
  min-width: 980px;
}

.subh-records-table td .pill + .pill {
  margin-top: 5px;
}

.subh-drawer {
  width: min(720px, 100vw);
}

.drawer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.drawer-heading h3 {
  margin: 3px 0 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title h2 {
  margin: 0;
  font-size: 24px;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.metric small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 2fr) 90px;
  gap: 10px;
  align-items: center;
}

.bar-label,
.bar-value {
  min-width: 0;
  font-size: 13px;
}

.bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-value {
  color: var(--muted);
  text-align: right;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e8eeea;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.bar-fill.danger {
  background: var(--amber);
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar .inline-control {
  flex: 0 1 170px;
}

.export-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 5px;
}

.subh-period-exports {
  position: relative;
  padding-left: 4px;
  border-left: 1px solid var(--line);
}

.subh-period-exports[open] {
  z-index: 20;
}

.export-menu-trigger {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

.export-menu-trigger:hover {
  border-color: #b4c4bb;
  background: var(--panel-strong);
}

.export-menu-trigger::-webkit-details-marker {
  display: none;
}

.export-menu-trigger::marker {
  display: none;
}

.export-menu-chevron {
  font-size: 16px;
  line-height: 1;
  margin-left: 1px;
}

.export-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 25;
  display: grid;
  min-width: 248px;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgb(25 45 34 / 18%);
}

.export-menu-panel .export-action {
  justify-content: flex-start;
  width: 100%;
}

.export-menu-featured {
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.export-menu-group {
  display: grid;
  gap: 4px;
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.export-menu-group-label {
  padding: 1px 8px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.export-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 34px;
  padding: 5px 8px;
  white-space: nowrap;
}

.export-action-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.export-action-csv {
  width: 34px;
  min-width: 34px;
  padding: 5px;
  color: #1e6c45;
}

.export-action-word {
  color: #2b579a;
}

.export-action-pdf {
  color: #b3261e;
}

.export-action.is-unavailable {
  opacity: 0.58;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f2f5f2;
  color: #36443b;
  font-size: 13px;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.compact-input {
  max-width: 86px;
}

.tiny-grid {
  gap: 6px;
}

.compliance-table textarea {
  min-width: 180px;
  min-height: 54px;
}

.haccp-day-groups {
  display: grid;
  gap: 14px;
}

.day-group {
  display: grid;
  gap: 8px;
  border-top: 2px solid var(--line);
  padding-top: 10px;
}

.day-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.day-group h4 {
  margin: 0;
  font-size: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.green {
  background: var(--soft-green);
  color: var(--accent-dark);
}

.pill.blue {
  background: var(--soft-blue);
  color: var(--blue);
}

.pill.amber {
  background: var(--soft-amber);
  color: var(--amber);
}

.pill.red {
  background: var(--soft-red);
  color: var(--red);
}

.roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chemical-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.permission-portal {
  display: grid;
  gap: 10px;
}

.permission-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 80%, var(--bg));
  padding: 12px;
}

.permission-group h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 80%, var(--bg));
  color: var(--ink);
  padding: 7px 10px;
  font-weight: 700;
}

.role-tag.selected {
  border-color: #8dc4a5;
  background: var(--soft-green);
  color: var(--accent-dark);
}

.role-tag input {
  width: auto;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.check-row label {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.check-row input {
  width: auto;
}

.check-line {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.check-line input {
  width: auto;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  gap: 10px;
}

.day-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.day-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.day-card small {
  color: var(--muted);
}

.shift-cell {
  display: grid;
  gap: 7px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.shift-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.status-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.status-buttons button {
  min-height: 32px;
  padding: 5px 6px;
  font-size: 12px;
}

.status-buttons button.active[data-status="available"] {
  background: var(--soft-green);
  border-color: #8dc4a5;
  color: var(--accent-dark);
}

.status-buttons button.active[data-status="unavailable"] {
  background: var(--soft-red);
  border-color: #e2a09b;
  color: var(--red);
}

.status-buttons button.active[data-status="preferred"] {
  background: var(--soft-blue);
  border-color: #9abde0;
  color: var(--blue);
}

.status-buttons button.active[data-status="not_preferred"] {
  background: var(--soft-amber);
  border-color: #d7aa5a;
  color: var(--amber);
}

.status-buttons button.active[data-status="empty"] {
  background: #edf0ed;
  border-color: #c9d2cb;
  color: var(--muted);
}

.warning-text {
  color: var(--red);
  font-weight: 700;
}

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

.empty-state {
  border: 1px dashed #b7c4bb;
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 80%, var(--bg));
  color: var(--muted);
  padding: 18px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.assignment-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.4fr auto;
  gap: 10px;
  align-items: end;
}

.compact-title {
  margin-bottom: 8px;
}

.compact-title h3 {
  font-size: 16px;
}

.expense-list {
  display: grid;
  gap: 8px;
}

.expense-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr 130px 1fr auto auto;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: color-mix(in srgb, var(--panel) 80%, var(--bg));
}

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

.template-mapping-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.template-mapping-row > .muted {
  align-self: center;
}

.template-mapping-row > button {
  align-self: end;
  white-space: nowrap;
}

.incoming-item-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 80%, var(--bg));
  padding: 12px;
}

.incoming-item-row .danger {
  justify-self: start;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  background: #17201b;
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 1021px) {
  .subtabs { flex-wrap: wrap; overflow-x: visible; }
}

@media (max-width: 1020px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .tabs {
    display: flex;
    max-width: 100vw;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tab-button {
    width: auto;
    white-space: nowrap;
  }

  .metric-row,
  .grid.two,
  .grid.three,
  .grid.four,
  .calendar-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .inline-form,
  .assignment-form,
  .expense-row,
  .incoming-item-row,
  .template-mapping-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  button {
    min-height: 44px;
  }

  .content {
    padding: 12px;
  }

  .panel {
    padding: 12px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar button {
    flex: 1 1 140px;
  }

  .toolbar .export-actions,
  .toolbar .export-action {
    flex: 0 0 auto;
  }

  .toolbar .export-action-csv {
    flex-basis: 34px;
  }

  .toolbar .subh-period-exports {
    margin-left: 0;
  }

  .toolbar .subh-period-exports .export-menu-panel {
    right: auto;
    left: 0;
  }

  .toolbar .inline-control {
    flex: 1 1 100%;
  }

  table {
    min-width: 640px;
  }
}

/* AuditReady module navigation and record-focused HACCP workspace */
.module-layout {
  grid-template-columns: 264px minmax(0, 1fr);
  background: #f4f7f5;
}

.module-sidebar {
  position: sticky;
  top: 65px;
  align-self: start;
  min-height: calc(100vh - 65px);
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #123d32 0%, #0d3028 100%);
}

.module-sidebar-title {
  margin: 0 12px 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.module-button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 64px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, .78);
  text-align: left;
}

.module-button:hover {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
}

.module-button.active {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
}

.module-button > span:last-child {
  display: grid;
  gap: 3px;
}

.module-button strong { font-size: 14px; }
.module-button small { color: rgba(255, 255, 255, .55); font-size: 11px; line-height: 1.3; }
.module-button.active small { color: rgba(255, 255, 255, .72); }

.module-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .1);
  color: #bce7d8;
  font-weight: 900;
}

.workspace { min-width: 0; }

.subtabs {
  position: sticky;
  top: 65px;
  z-index: 8;
  display: flex;
  gap: 5px;
  max-width: 100%;
  padding: 10px clamp(14px, 3vw, 28px);
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  scrollbar-width: thin;
}

.subtab-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  white-space: nowrap;
  color: var(--muted);
}

.subtab-button:hover { background: var(--panel-strong); }
.subtab-button.active { background: #dff1ea; color: #124f3b; font-weight: 800; }

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff0dd;
  color: #8c4a06;
  font-size: 11px;
  font-weight: 800;
}

.panel {
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(20, 52, 41, .06);
}

.panel-heading,
.record-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-heading h3,
.panel-heading p { margin-top: 0; }

.record-card-list,
.stack-list { display: grid; gap: 10px; }

.record-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.record-card.has-alert { border-color: #e5a49d; background: #fffaf9; }
.record-card-head > div { display: grid; gap: 3px; }
.record-card-head span:not(.pill) { color: var(--muted); font-size: 12px; }
.record-card > button { justify-self: end; }

.list-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
}
.list-card span { color: var(--muted); font-size: 12px; }

.automation-panel { margin-top: 16px; }
.automation-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.automation-status-grid > div {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 10px;
  background: var(--panel-strong);
}
.automation-status-grid span { color: var(--muted); font-size: 12px; }
.automation-status-grid strong { overflow-wrap: anywhere; }

.quick-entry-panel { margin-bottom: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row-actions .danger { margin-left: auto; }
@media (max-width: 640px) {
  .row-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .row-actions .danger { margin-left: 0; }
  .quick-entry-panel { padding: 12px; }
}
.week-selector { max-width: 360px; }

@media (min-width: 1021px) {
  .subtabs { flex-wrap: wrap; overflow-x: visible; }
}

@media (max-width: 1020px) {
  .module-layout { grid-template-columns: 1fr; }
  .module-sidebar {
    position: static;
    display: flex;
    gap: 8px;
    min-height: auto;
    padding: 10px 12px;
    overflow-x: auto;
    border-right: 0;
  }
  .module-sidebar-title { display: none; }
  .module-button {
    flex: 0 0 190px;
    min-height: 56px;
    margin: 0;
  }
  .subtabs { top: 0; }
}

@media (max-width: 640px) {
  .module-sidebar { padding: 8px; }
  .module-button { flex-basis: 154px; grid-template-columns: 30px minmax(0, 1fr); }
  .module-mark { width: 30px; height: 30px; }
  .module-button small { display: none; }
  .subtabs { padding: 8px 10px; }
  .subtab-button { min-height: 42px; }
  .automation-status-grid { grid-template-columns: 1fr; }
  .record-card { padding: 12px; }
  .week-selector { width: 100%; max-width: none; }
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.login-brand-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.branding-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.branding-preview img:first-child { width: 92px; height: 92px; object-fit: contain; }
.branding-preview img:last-child { width: 54px; height: 54px; object-fit: contain; }

.dictation-panel { display: grid; gap: 10px; padding: 14px; }
.dictation-panel audio { width: 100%; max-width: 460px; }
.dictation-panel textarea { min-height: 96px; }
.error-text { color: #9f241c; }
