:root {
  --bg-0: #070f17;
  --bg-1: #0d1b2a;
  --bg-2: #11263a;
  --panel: rgba(16, 37, 57, 0.86);
  --panel-border: rgba(119, 159, 194, 0.22);
  --text-main: #e4edf6;
  --text-dim: #9cb3c8;
  --accent: #2ca58d;
  --radius: 14px;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  --font-main: "Space Grotesk", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  --surface-2: rgba(9, 22, 35, 0.78);
  --surface-3: rgba(10, 24, 37, 0.62);
  --row-hover: rgba(44, 165, 141, 0.13);
  --topbar-bg: rgba(7, 17, 27, 0.93);
}

html[data-theme="light"] {
  --bg-0: #edf2f7;
  --bg-1: #dde7f2;
  --bg-2: #d3deea;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(78, 104, 130, 0.22);
  --text-main: #1f2c3a;
  --text-dim: #4a6277;
  --accent: #0d8d74;
}

html[data-theme="steel"] {
  --bg-0: #d8ecfb;
  --bg-1: #c9e2f7;
  --bg-2: #b8d9f4;
  --panel: rgba(243, 251, 255, 0.94);
  --panel-border: rgba(70, 127, 170, 0.3);
  --text-main: #12324b;
  --text-dim: #436d8f;
  --accent: #2f84c2;
  --surface-2: rgba(232, 246, 255, 0.98);
  --surface-3: rgba(219, 240, 254, 0.95);
  --row-hover: rgba(47, 132, 194, 0.14);
  --topbar-bg: rgba(231, 246, 255, 0.97);
}

html[data-style="2"] {
  --font-main: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  --radius: 4px;
  --panel-border: rgba(88, 132, 171, 0.38);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

html[data-style="4"] {
  --font-main: "PT Serif", Georgia, serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  --radius: 3px;
  --shadow: 0 8px 20px rgba(82, 69, 42, 0.14);
}

html[data-style="4"][data-theme="light"] {
  --bg-0: #f6f6f6;
  --bg-1: #efefef;
  --bg-2: #e8e8e8;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-border: rgba(124, 124, 124, 0.33);
  --text-main: #222222;
  --text-dim: #5f5f5f;
  --accent: #6a6a6a;
  --surface-2: rgba(255, 255, 255, 0.92);
  --surface-3: rgba(248, 248, 248, 0.94);
  --row-hover: rgba(77, 77, 77, 0.1);
  --topbar-bg: rgba(250, 250, 250, 0.96);
}

html[data-style="4"][data-theme="steel"] {
  --bg-0: #e9f3fb;
  --bg-1: #dcecf8;
  --bg-2: #d1e6f5;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-border: rgba(96, 139, 171, 0.36);
  --text-main: #1f3446;
  --text-dim: #4a6a81;
  --accent: #2f84c2;
  --surface-2: rgba(244, 250, 255, 0.94);
  --surface-3: rgba(234, 245, 252, 0.95);
  --row-hover: rgba(47, 132, 194, 0.12);
  --topbar-bg: rgba(241, 249, 255, 0.97);
}

html[data-style="4"][data-theme="night"] {
  --bg-0: #1a2027;
  --bg-1: #222a33;
  --bg-2: #2a3440;
  --panel: rgba(36, 43, 53, 0.96);
  --panel-border: rgba(122, 139, 157, 0.35);
  --text-main: #ecf2f8;
  --text-dim: #b8c5d3;
  --accent: #7db3e2;
  --surface-2: rgba(41, 49, 60, 0.92);
  --surface-3: rgba(35, 42, 51, 0.94);
  --row-hover: rgba(125, 179, 226, 0.16);
  --topbar-bg: rgba(30, 38, 47, 0.96);
}

html[data-style="4"][data-theme="night"] .panel-toolbar input,
html[data-style="4"][data-theme="night"] #settings-language-select,
html[data-style="4"][data-theme="night"] #theme-select,
html[data-style="4"][data-theme="night"] .editor-form input,
html[data-style="4"][data-theme="night"] .editor-form select,
html[data-style="4"][data-theme="night"] #language-select,
html[data-style="4"][data-theme="night"] #pwd-current,
html[data-style="4"][data-theme="night"] #pwd-new,
html[data-style="4"][data-theme="night"] #pwd-confirm {
  background: #2a3440;
  color: #ecf2f8;
  border-color: rgba(122, 139, 157, 0.55);
}

html[data-style="6"] {
  --font-main: "Exo 2", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  --bg-0: #0e1116;
  --bg-1: #121a22;
  --bg-2: #101820;
  --panel: rgba(14, 20, 27, 0.88);
  --panel-border: rgba(126, 185, 235, 0.5);
  --text-main: #e5f0f8;
  --text-dim: #9eb8cd;
  --accent: #54b6ff;
  --surface-2: rgba(11, 18, 25, 0.82);
  --surface-3: rgba(9, 15, 22, 0.76);
  --row-hover: rgba(84, 182, 255, 0.14);
  --topbar-bg: rgba(8, 14, 20, 0.95);
  --radius: 20px;
  --shadow: 0 20px 40px rgba(2, 6, 10, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--text-main);
  background:
    radial-gradient(circle at 82% 10%, #17406b 0%, transparent 44%),
    radial-gradient(circle at 10% 92%, #15334f 0%, transparent 40%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
  overflow-x: hidden;
}

.ambient-lines {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(151, 187, 218, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(151, 187, 218, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 80%);
  pointer-events: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 14;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) minmax(220px, 1fr);
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--panel-border);
  background: var(--topbar-bg);
  backdrop-filter: blur(9px);
}

html[data-style="2"] .topbar {
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  border-bottom-width: 2px;
}

html[data-style="2"] .panel {
  padding: 0.72rem;
}

html[data-style="2"] .main-table th,
html[data-style="2"] .main-table td {
  padding: 0.44rem 0.45rem;
  border-bottom-style: dashed;
  font-size: 0.86rem;
}

html[data-style="2"] .main-table th {
  font-size: 0.72rem;
}

html[data-style="2"] .bookmark-tab,
html[data-style="2"] .ghost-btn,
html[data-style="2"] .top-chip {
  border-radius: 4px;
}

.brand-link {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.eyebrow {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-link h1 {
  margin: 0.2rem 0 0;
  line-height: 1;
  letter-spacing: 0.08em;
  font-size: clamp(1.5rem, 2.3vw, 2.1rem);
}

.top-chip,
.module-btn,
.bookmark-tab,
.ghost-btn,
.menu-close {
  font: inherit;
  color: var(--text-main);
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
}

.top-chip {
  width: 100%;
  text-align: center;
  padding: 0.55rem 0.7rem;
}

.top-chip strong {
  display: block;
  font-size: 0.92rem;
}

.user-chip strong {
  font-size: 0.82rem;
  font-weight: 600;
}

.top-module-title {
  justify-self: center;
  text-align: center;
}

.top-module-title strong {
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-settings-box {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 0.4rem;
}

.user-chip {
  border: 0;
  background: transparent;
  padding: 0;
}

.settings-icon-btn {
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-main);
  font: 600 1rem/1 var(--font-main);
  cursor: pointer;
}

.settings-icon-btn:hover {
  border-color: var(--accent);
}

.module-switcher {
  position: relative;
}

.module-chip strong {
  text-transform: uppercase;
}

.module-switch-menu {
  position: absolute;
  top: calc(100% + 0.42rem);
  right: 0;
  min-width: 260px;
  z-index: 18;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  display: grid;
  gap: 0.35rem;
}

.module-btn {
  text-align: left;
  padding: 0.5rem 0.66rem;
  cursor: pointer;
}

.module-btn.active {
  border-color: rgba(44, 165, 141, 0.82);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.main-content {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.auth-panel {
  max-width: 460px;
  margin: 2.5rem auto;
}

.auth-form {
  max-width: none;
}

.auth-error {
  min-height: 1.2rem;
  color: #c54444;
}

body.auth-only .main-content {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

body.auth-only .auth-panel {
  margin: 0;
  width: min(460px, 100%);
}

.auth-actions {
  display: flex;
  gap: 0.5rem;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.35rem;
}

.password-toggle {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-main);
  min-width: 2rem;
  height: 2rem;
  cursor: pointer;
  line-height: 1;
}

html[data-style="4"] body {
  background:
    repeating-linear-gradient(
      0deg,
      color-mix(in srgb, var(--bg-1) 88%, #ffffff 12%) 0 34px,
      color-mix(in srgb, var(--bg-2) 76%, #ffffff 24%) 34px 35px
    ),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 58%, var(--bg-2));
}

html[data-style="4"] .ambient-lines {
  display: none;
}

html[data-style="4"] .topbar {
  position: static;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 2px solid var(--panel-border);
  box-shadow: 0 2px 0 rgba(113, 104, 87, 0.2);
}

html[data-style="4"] .brand-link h1 {
  letter-spacing: 0.02em;
  font-size: 1.5rem;
}

html[data-style="4"] .main-content {
  max-width: 1320px;
  margin: 0 auto;
}

html[data-style="4"] .panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: none;
}

html[data-style="4"] .bookmarks {
  border-bottom: 2px solid var(--panel-border);
}

html[data-style="4"] .bookmark-tab,
html[data-style="4"] .ghost-btn,
html[data-style="4"] .top-chip,
html[data-style="4"] .module-btn {
  border-radius: 2px;
  box-shadow: none;
}

html[data-style="4"] .main-table th,
html[data-style="4"] .main-table td {
  white-space: normal;
  border-bottom: 1px solid var(--panel-border);
}

html[data-style="4"] .main-table th {
  color: var(--text-dim);
  font-weight: 700;
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  padding: 1rem;
}

html[data-style="6"] .topbar {
  border-bottom: 1.5px solid color-mix(in srgb, var(--accent) 50%, var(--panel-border));
  box-shadow: 0 0 0 1px rgba(84, 182, 255, 0.12) inset;
}

html[data-style="6"] .brand-link h1 {
  letter-spacing: 0.12em;
  text-shadow: 0 0 16px rgba(84, 182, 255, 0.22);
}

html[data-style="6"] .panel {
  background:
    linear-gradient(155deg, rgba(17, 28, 40, 0.9), rgba(11, 18, 25, 0.92));
  box-shadow:
    0 0 0 1px rgba(84, 182, 255, 0.18) inset,
    0 20px 40px rgba(2, 6, 10, 0.45);
}

html[data-style="6"] .bookmark-tab,
html[data-style="6"] .ghost-btn,
html[data-style="6"] .top-chip,
html[data-style="6"] .module-btn {
  border-radius: 14px 5px 14px 5px;
}

html[data-style="6"] .style-btn.active,
html[data-style="6"] .bookmark-tab.active,
html[data-style="6"] .module-btn.active {
  box-shadow: 0 0 18px rgba(84, 182, 255, 0.22);
}

html[data-style="6"] .main-table {
  border-collapse: separate;
  border-spacing: 0;
}

html[data-style="6"] .main-table th {
  font-family: var(--font-mono);
}

html[data-style="6"] .main-table td {
  border-bottom-width: 1.5px;
}

.module-hidden {
  display: none;
}

.bookmarks {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--panel-border);
}

.bookmark-tab {
  padding: 0.5rem 0.72rem;
  cursor: pointer;
}

.bookmark-tab.active {
  border-color: rgba(44, 165, 141, 0.82);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.tab-panel {
  display: grid;
  gap: 0.7rem;
}

.tab-panel.module-hidden {
  display: none;
}

.employees-toolbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.employees-toolbar #employees-search {
  max-width: 560px;
}

.dismissed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-main);
  white-space: nowrap;
}

#employees-dismissed-period {
  font: inherit;
  color: var(--text-main);
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
  padding: 0.62rem 0.72rem;
  min-width: 210px;
}

.panel-toolbar input,
#settings-language-select,
#theme-select,
.settings-card input,
.settings-card select,
.settings-card textarea,
.editor-form input,
.editor-form select,
#language-select,
#pwd-current,
#pwd-new,
#pwd-confirm {
  width: 100%;
  font: inherit;
  color: var(--text-main);
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(9, 22, 35, 0.74);
  background: var(--surface-2);
  padding: 0.62rem 0.72rem;
}

.table-wrap {
  overflow-x: auto;
}

.main-table {
  width: 100%;
  border-collapse: collapse;
}

.main-table th,
.main-table td {
  text-align: left;
  padding: 0.62rem 0.55rem;
  border-bottom: 1px solid var(--panel-border);
  font-size: 0.92rem;
  white-space: nowrap;
}

.main-table th {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0;
}

.sort-indicator {
  color: var(--text-dim);
  font-size: 0.76rem;
}

.sort-btn.active .sort-indicator {
  color: var(--text-main);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: var(--row-hover);
}

.employee-dismissed td {
  text-decoration: line-through;
  opacity: 0.8;
}

.system-user-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  margin-left: 0.35rem;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--text-main);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  vertical-align: middle;
}

.employee-status-cell {
  text-align: center;
  width: 70px;
}

.employee-status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  color: #fff;
  font: 700 0.72rem/1 var(--font-main);
}

.employee-status-dot.green {
  background: #1c9e49;
}

.employee-status-dot.red {
  background: #c54444;
}

.employee-status-dot.neutral {
  background: #8a98a5;
}

.panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

.ghost-btn,
.menu-close {
  padding: 0.5rem 0.72rem;
  cursor: pointer;
}

.status-codes-box {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.6rem 0.72rem;
  background: var(--surface-3);
}

.status-codes-box p {
  margin: 0;
}

.status-codes-box p:first-child {
  color: var(--text-dim);
  font-size: 0.84rem;
  margin-bottom: 0.24rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.module-card {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--surface-3);
  padding: 0.7rem;
  cursor: pointer;
}

.module-card h3,
.module-card p {
  margin: 0;
}

.module-card p {
  margin-top: 0.3rem;
  color: var(--text-dim);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.settings-card {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--surface-3);
  padding: 0.75rem;
}

.settings-card h3 {
  margin: 0 0 0.6rem;
}

.settings-card label,
.editor-form label {
  display: grid;
  gap: 0.26rem;
  margin-bottom: 0.48rem;
}

.settings-card span,
.editor-form span {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.settings-card input[readonly] {
  opacity: 0.88;
}

.hint {
  margin: 0.4rem 0 0;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.settings-footer {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.settings-footer-right {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.audit-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.audit-toolbar #audit-search {
  max-width: 560px;
}

#audit-body code {
  display: block;
  max-width: 360px;
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.78rem/1.35 var(--font-mono);
  color: var(--text-main);
}

.danger-btn {
  border-color: rgba(239, 106, 106, 0.44);
}

.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.editor-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.editor-head h2 {
  margin: 0;
}

.editor-form {
  display: grid;
  gap: 0.5rem;
  max-width: 620px;
}

.editor-row {
  display: grid;
  gap: 0.5rem 0.7rem;
}

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

.employee-editor-form {
  max-width: 980px;
}

.employee-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 0.9rem;
  align-items: start;
}

.employee-editor-fields {
  display: grid;
  gap: 0.5rem;
}

.employee-editor-row-head {
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
}

.employee-editor-row-position {
  grid-template-columns: minmax(0, 1fr) minmax(130px, 210px);
}

.position-editor-form {
  max-width: 920px;
  gap: 0.7rem;
}

.employee-photo-box {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.45rem;
  background: var(--surface-3);
}

.employee-photo-corner {
  justify-self: end;
  width: 200px;
  min-height: 240px;
  display: grid;
  gap: 0.5rem;
  justify-items: stretch;
}

.employee-photo-stage {
  position: relative;
  width: 190px;
  height: 230px;
}

#employee-editor-photo-preview,
#employee-editor-camera-video,
.employee-photo-empty {
  position: absolute;
  inset: 0;
  width: 190px;
  height: 230px;
  border-radius: 8px;
}

.employee-photo-empty {
  border: 1px dashed var(--panel-border);
  background:
    radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--accent) 36%, transparent) 0 26px, transparent 27px),
    linear-gradient(color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent) 10%, transparent));
}

#employee-editor-photo-preview {
  object-fit: cover;
  border: 1px solid var(--panel-border);
  z-index: 1;
}

#employee-editor-photo-file {
  width: 100%;
}

.employee-photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.icon-btn {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-main);
  cursor: pointer;
  min-height: 2.1rem;
  font-size: 1.05rem;
}

.icon-btn svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.icon-btn:hover {
  background: var(--surface-2);
}

#employee-editor-photo-camera,
#employee-editor-camera-shot,
#employee-editor-camera-stop {
  width: 100%;
}

#employee-editor-camera-video {
  object-fit: cover;
  border: 1px solid var(--panel-border);
  background: #000;
  z-index: 2;
}

.employee-camera-actions {
  display: grid;
  gap: 0.35rem;
}

.employee-camera-actions.module-hidden {
  display: none;
}

.drop-zone-active {
  border-color: color-mix(in srgb, var(--accent) 78%, var(--panel-border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
}

.employee-roles-box {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.55rem;
  background: var(--surface-3);
}

.roles-title {
  margin: 0 0 0.45rem;
  color: var(--text-main);
}

.employee-roles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.7rem;
}

.employee-role-item {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.2rem 0.1rem 0.2rem 0.35rem;
}

.editor-form label.employee-role-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.employee-role-item span {
  flex: 1;
}

.employee-role-item input {
  width: 1rem;
  height: 1rem;
  margin: 0 0.15rem 0 0;
  flex: 0 0 auto;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.checkbox-line input {
  width: auto;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  border: 1px solid rgba(123, 211, 137, 0.35);
  background: rgba(10, 32, 24, 0.95);
  color: #c7f5d1;
  padding: 0.72rem 0.86rem;
  border-radius: 10px;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.style-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid var(--panel-border);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 0.18rem;
}

.style-btn {
  min-width: 2rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  border-radius: 8px;
  padding: 0.2rem 0.35rem;
  font: 600 0.82rem/1 var(--font-mono);
  cursor: pointer;
}

.style-btn.active {
  color: var(--text-main);
  border-color: var(--panel-border);
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}

html[data-style="4"] .ambient-lines {
  background-image:
    linear-gradient(90deg, rgba(113, 104, 87, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(113, 104, 87, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: none;
}

html[data-style="4"] .main-table th {
  border-bottom-width: 2px;
  letter-spacing: 0.04em;
}

html[data-style="6"] .panel,
html[data-style="6"] .top-chip,
html[data-style="6"] .style-switcher,
html[data-style="6"] .module-btn,
html[data-style="6"] .bookmark-tab,
html[data-style="6"] .ghost-btn {
  border-width: 1.5px;
}

html[data-style="6"] .main-table th,
html[data-style="6"] .main-table td {
  border-bottom-color: color-mix(in srgb, var(--accent) 35%, var(--panel-border));
}

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

.position-employees-box,
.discussion-box {
  margin-top: 0.8rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.75rem;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
}

.position-employees-box h3,
.discussion-box h3 {
  margin: 0 0 0.55rem;
}

.discussion-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.discussion-messages {
  max-height: 280px;
  overflow: auto;
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  padding-right: 0.2rem;
}

.discussion-message {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  background: var(--surface-1);
}

.discussion-message p {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.discussion-message-head {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--text-dim);
}

.discussion-own {
  padding: 0.06rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
}

.discussion-attachments {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
}

.discussion-attachments a {
  word-break: break-word;
}

.discussion-image {
  display: block;
  margin-top: 0.42rem;
  max-width: min(280px, 100%);
  max-height: 220px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  object-fit: cover;
}

.chat-compose-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-attach-btn {
  min-width: 2.2rem;
  padding: 0 0.45rem;
  font-size: 1.1rem;
}

.mention-box {
  display: grid;
  gap: 0.25rem;
  margin-top: -0.25rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 0.35rem;
  max-height: 180px;
  overflow-y: auto;
}

.mention-box.module-hidden {
  display: none;
}

.mention-item {
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-main);
  padding: 0.28rem 0.35rem;
  cursor: pointer;
  font: inherit;
}

.mention-item:hover,
.mention-item.active {
  border-color: var(--panel-border);
  background: var(--row-hover);
}

.discussion-message-highlight {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--panel-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

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

  .module-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .main-content {
    padding: 0.8rem;
  }

  .bookmarks {
    flex-wrap: wrap;
  }

  .panel-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .employees-toolbar {
    flex-wrap: wrap;
  }

  .employees-toolbar #employees-search {
    max-width: 100%;
    width: 100%;
  }

  .employee-editor-grid {
    grid-template-columns: 1fr;
  }

  .employee-photo-corner {
    justify-self: start;
  }

  .editor-row.two-cols {
    grid-template-columns: 1fr;
  }

  .employee-editor-row-head,
  .employee-editor-row-position {
    grid-template-columns: 1fr;
  }

  .employee-roles-grid {
    grid-template-columns: 1fr;
  }
}
