/* Light / Dark (Cursor 스타일 다크 + 정돈된 라이트) */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg-page: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-surface-2: #f8fafc;
  --bg-muted: #eef2f7;
  --border: #e5eaf0;
  --border-strong: #cfd8e3;
  --text: #1a2332;
  --text-secondary: #4b5565;
  --text-muted: #6b7789;
  --accent: #0099e8;
  --accent-soft: rgba(0, 153, 232, 0.12);
  --shadow: 0 2px 8px rgba(26, 35, 50, 0.06);
  --shadow-card: 0 8px 24px rgba(26, 35, 50, 0.08);
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --table-header: #f1f5f9;
  --table-row-border: #e2e8f0;
  --chart-grid: rgba(148, 163, 184, 0.4);
  --chart-center-text: #0f172a;
  --chart-legend: #475569;
  --chart-doughnut-border: #ffffff;
  --chart-idle: #cbd5e1;
  --chart-empty-slice: #e2e8f0;
  --gantt-bar: #0099e8;
  --gantt-bar-progress: #0099e8;
  --gantt-bar-planned: #c026d3;
  --gantt-bar-done: #64748b;
  --gantt-wrap-bg: #f8fafc;
  /** 다중 선택 목록: 라이트는 밝은 회색 톤 */
  --control-muted-fill: #aeb4bd;
  --control-muted-fill-hover: #9ca3af;
  --control-muted-text: #1e293b;
  --control-muted-border: #9ca3af;
  --font-ui: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --focus-outline: rgba(0, 153, 232, 0.45);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #1e1e1e;
  --bg-surface: #252526;
  --bg-surface-2: #2d2d30;
  --bg-muted: #2a2a2d;
  --border: #3c3c3c;
  --border-strong: #505050;
  --text: #cccccc;
  --text-secondary: #b0b0b0;
  --text-muted: #858585;
  --accent: #569cd6;
  --accent-soft: rgba(86, 156, 214, 0.16);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.35);
  --input-bg: #3c3c3c;
  --input-border: #505050;
  --table-header: #2d2d30;
  --table-row-border: #3c3c3c;
  --chart-grid: rgba(128, 128, 128, 0.35);
  --chart-center-text: #e8e8e8;
  --chart-legend: #b4b4b4;
  --chart-doughnut-border: #252526;
  --chart-idle: #505050;
  --chart-empty-slice: #3c3c3c;
  --gantt-bar: #569cd6;
  --gantt-bar-progress: #569cd6;
  --gantt-bar-planned: #d670d8;
  --gantt-bar-done: #858585;
  --gantt-wrap-bg: #252526;
  /** 다중 선택 목록: 다크는 더 진한 회색 톤 */
  --control-muted-fill: #3a3a3a;
  --control-muted-fill-hover: #2d2d2d;
  --control-muted-text: #e8e8e8;
  --control-muted-border: #252525;
  --font-ui: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --focus-outline: rgba(86, 156, 214, 0.45);
}

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

html {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-page);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

body.admin-app {
  display: flex;
  flex-direction: column;
  --sidebar-width: 300px;
}

.app-top-bar {
  display: flex;
  flex-shrink: 0;
  min-height: 50px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.app-top-bar-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-right: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-page) 72%, var(--bg-surface)) 0%,
    var(--bg-surface) 100%
  );
}

.app-top-bar-main {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-width: 0;
  background: var(--bg-surface);
}

.admin-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  margin: 0;
  border-bottom: none;
  background: transparent;
  flex-shrink: 1;
  box-shadow: none;
}

.admin-tab {
  margin: 0;
  padding: 0 18px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  display: none;
  align-items: center;
  min-height: 100%;
  transition: color 0.15s ease, border-color 0.15s ease;
}

body.admin-app.admin-authenticated .admin-tab.is-allowed {
  display: inline-flex;
}

.admin-tab[hidden] {
  display: none !important;
}

.admin-tab:hover {
  color: var(--text-secondary);
}

.admin-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

body.admin-app:not(.admin-authenticated) .app-top-bar,
body.admin-app:not(.admin-authenticated) .app-body {
  display: none;
}

body.admin-app.admin-authenticated .admin-login-gate {
  display: none;
}

.admin-login-gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-page) 80%, var(--bg-surface)) 0%,
    var(--bg-page) 100%
  );
}

.admin-login-card {
  width: min(420px, 100%);
  padding: 28px 26px 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.admin-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.admin-login-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-login-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.admin-login-hint {
  margin: 0 0 14px;
}

.admin-login-form .control-group {
  margin-bottom: 12px;
}

.admin-login-form .control-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.admin-login-form .control-group input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  box-sizing: border-box;
}

.admin-login-error {
  margin: 0 0 12px;
  font-size: 13px;
  color: #b91c1c;
}

.admin-login-submit {
  width: 100%;
  min-height: 42px;
}

.admin-session-user {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.btn-admin-logout {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

.admin-page-content {
  padding: 14px 20px 24px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.admin-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.admin-stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-stat-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.admin-stat-card-icon {
  font-size: 1.1rem;
  opacity: 0.85;
}

.admin-stat-card-value {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.admin-stat-card-meta {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.admin-stat-bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
}

.admin-stat-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.admin-stat-card--primary .admin-stat-card-value { color: var(--accent); }
.admin-stat-card--progress .admin-stat-bar > span { background: #0099e8; }
.admin-stat-card--planned .admin-stat-bar > span { background: #8b5cf6; }
.admin-stat-card--done .admin-stat-bar > span { background: #64748b; }

.btn-admin-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(0, 153, 232, 0.24);
}

.btn-admin-primary:hover {
  filter: brightness(1.06);
  color: #fff !important;
  border-color: var(--accent) !important;
}

html[data-theme="dark"] .btn-admin-primary {
  color: #fff !important;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.status-badge--undecided {
  background: #f1f5f9;
  color: #64748b;
}

.status-badge--planned {
  background: #ede9fe;
  color: #6d28d9;
}

.status-badge--progress {
  background: #e0f2fe;
  color: #0369a1;
}

.status-badge--complete {
  background: #dcfce7;
  color: #15803d;
}

.status-badge--closed {
  background: #e2e8f0;
  color: #475569;
}

.status-badge--hold {
  background: #ffedd5;
  color: #c2410c;
}

html[data-theme="dark"] .status-badge--undecided { background: #3a3a3a; color: #cbd5e1; }
html[data-theme="dark"] .status-badge--planned { background: #4c1d95; color: #e9d5ff; }
html[data-theme="dark"] .status-badge--progress { background: #0c4a6e; color: #bae6fd; }
html[data-theme="dark"] .status-badge--complete { background: #14532d; color: #bbf7d0; }
html[data-theme="dark"] .status-badge--closed { background: #334155; color: #e2e8f0; }
.product-table-col-name {
  font-weight: 600;
  color: var(--text);
}

html[data-theme="dark"] .admin-nav-item.is-active {
  color: #fff;
}

h1, h2, h3 { margin: 10px 0; color: var(--text); }

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.app-header-mark {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(0, 153, 232, 0.24);
}
.app-header-title-wrap {
  min-width: 0;
}
.app-header-eyebrow {
  margin: 0 0 1px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.app-header-title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  line-height: 1.15;
}
.app-header-title-accent {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
}
html[data-theme="dark"] .app-header-mark {
  box-shadow: 0 8px 18px rgba(86, 156, 214, 0.22);
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 0 14px;
  border-left: 1px solid var(--border);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-muted);
}
.theme-switch button {
  margin: 0;
  padding: 5px 10px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
}
.theme-switch button:hover {
  color: var(--text);
  background: var(--bg-surface-2);
}
.theme-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}
html[data-theme="dark"] .theme-switch button[aria-pressed="true"] {
  color: #1e1e1e;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header-actions .m-icon-btn {
  box-shadow: var(--shadow);
}

html[data-theme="light"] #btnThemeToggleAdmin .m-icon-moon,
html[data-theme="dark"] #btnThemeToggleAdmin .m-icon-sun {
  display: none;
}

.chart-card label { color: var(--text-secondary); }
.chart-card input[type="radio"] { accent-color: var(--accent); }

.app-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  gap: 0;
}

#adminFilterSidebar {
  flex-shrink: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

#adminFilterSidebar[hidden] {
  display: none !important;
}

.app-body.has-filter-sidebar #adminFilterSidebar:not([hidden]) {
  display: flex;
}

.admin-tab-panel {
  flex: 1;
  display: none;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
}

.admin-tab-panel.is-active {
  display: flex;
}

.admin-tab-panel > .main-content {
  min-height: 0;
}

.app-body.has-filter-sidebar .admin-hr-page {
  max-width: none;
  margin: 0;
}

.admin-accounts-page {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.admin-system-page {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.admin-system-card {
  margin-bottom: 0;
}

.admin-system-stats {
  margin-bottom: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-stat-card-value--text {
  font-size: 1.35rem;
  line-height: 1.25;
}

.admin-system-title {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.admin-system-intro {
  margin: 0 0 8px;
}

.admin-system-panel {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-muted) 72%, var(--bg-surface));
}

.admin-system-panel-head {
  margin-bottom: 4px;
}

.admin-system-panel-meta {
  margin: 4px 0 0;
}

.admin-system-panel-hint {
  margin: 12px 0 0;
}

.admin-system-message {
  margin-top: 10px !important;
}

.admin-system-action-row {
  margin-top: 14px;
  gap: 8px;
}

.admin-system-action-row + .admin-system-action-row {
  margin-top: 10px;
}

.admin-system-action-row .btn-admin-primary,
.admin-system-action-row .btn-admin-secondary {
  flex: 1 1 120px;
  min-width: 0;
}

.admin-system-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.admin-system-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.admin-system-toolbar .admin-system-title {
  margin: 0;
}

.admin-system-summary {
  font-size: 12px;
  color: var(--text-muted);
}

.admin-system-toolbar-actions {
  margin: 8px 0 10px;
}

.admin-system-toolbar-actions button {
  flex: 0 1 auto;
}

.admin-system-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
}

.admin-system-table-wrap.is-empty .admin-system-table {
  display: none;
}

.admin-system-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-system-table th,
.admin-system-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--table-row-border);
  text-align: left;
  vertical-align: middle;
}

.admin-system-table thead tr {
  background: var(--table-header);
}

.admin-system-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.admin-system-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-system-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}

.admin-system-col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.admin-system-empty {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.admin-system-empty[hidden] {
  display: none;
}

.admin-system-upload-panel {
  margin-bottom: 0;
}

.admin-system-upload-panel + .admin-system-data-panel {
  margin-top: 14px;
}

.admin-system-data-panel + .admin-system-developer-backup-panel,
.admin-system-upload-panel + .admin-system-developer-backup-panel {
  margin-top: 14px;
}

.admin-developer-backup-meta {
  margin: 0 0 12px;
}

.admin-system-backup-unavailable {
  color: #b45309;
}

.admin-system-upload-field {
  margin-bottom: 10px;
}

.admin-system-upload-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.admin-system-upload-actions {
  margin-top: 12px;
}

.admin-developer-backup-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.admin-developer-backup-actions .btn-admin-clear {
  margin-left: 0;
}

.admin-system-upload-actions .btn-sample-csv-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex: 0 1 auto;
}

.admin-system-data-panel {
  margin-top: 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-muted) 72%, var(--bg-surface));
}

.admin-system-data-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.admin-system-data-meta {
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}

.admin-system-data-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

.admin-system-data-meta div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

@media (max-width: 860px) {
  .admin-system-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .admin-system-stats {
    grid-template-columns: 1fr;
  }
}

.admin-accounts-card {
  margin-bottom: 0;
}

.admin-accounts-stats {
  margin-bottom: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-accounts-intro {
  margin: 0 0 14px;
}

.admin-accounts-form-panel {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-muted) 72%, var(--bg-surface));
}

.admin-accounts-form-mode {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.admin-accounts-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}

.admin-accounts-form-grid .control-group {
  margin-bottom: 0;
}

.admin-accounts-form-grid .control-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.admin-accounts-form-grid .control-group input {
  width: 100%;
  min-height: 36px;
  padding: 7px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  box-sizing: border-box;
}

.admin-accounts-form-grid .control-group input:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 1px;
  border-color: var(--accent);
}

.admin-accounts-message {
  margin: 12px 0 0;
  font-size: 12px;
}

.admin-accounts-message.is-error {
  color: #b91c1c;
}

.admin-accounts-message.is-success {
  color: #047857;
}

.admin-accounts-form-actions {
  margin-top: 14px;
  gap: 8px;
}

.admin-accounts-form-actions button {
  flex: 0 1 auto;
  min-width: 88px;
}

.admin-accounts-access {
  margin: 12px 0 0;
  padding: 12px 12px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-muted) 55%, var(--bg-surface));
}

.admin-accounts-access-legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.admin-accounts-access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-accounts-access-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  cursor: pointer;
}

.admin-accounts-access-item input {
  margin: 0 0 2px;
}

.admin-accounts-access-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.admin-accounts-access-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.admin-access-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.admin-access-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.admin-access-chip--system {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.admin-accounts-factory-access {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-accounts-factory-all {
  margin: 0;
}

.admin-accounts-factory-list-wrap[hidden] {
  display: none !important;
}

.admin-accounts-factory-hint {
  margin: 0 0 8px;
  font-size: 11px;
}

.admin-accounts-factory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 160px;
  overflow: auto;
  padding-right: 4px;
}

.admin-accounts-factory-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 12px;
}

.admin-accounts-factory-item input {
  margin: 0;
  flex-shrink: 0;
}

.admin-accounts-factory-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-factory-access {
  font-size: 12px;
  color: var(--text-secondary);
}

.admin-factory-access.is-limited {
  font-weight: 600;
  color: var(--text);
}

.admin-factory-access.is-na {
  color: var(--text-muted);
}

.admin-accounts-factory-access[hidden] {
  display: none !important;
}

.admin-accounts-line-access {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-accounts-line-all {
  margin: 0;
}

.admin-accounts-line-list-wrap[hidden] {
  display: none !important;
}

.admin-accounts-line-hint {
  margin: 0 0 8px;
  font-size: 11px;
}

.admin-accounts-line-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 200px;
  overflow: auto;
  padding-right: 4px;
}

.admin-accounts-line-group-label {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.admin-accounts-line-group-label:first-child {
  margin-top: 0;
}

.admin-accounts-line-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 12px;
}

.admin-accounts-line-item input {
  margin: 0;
  flex-shrink: 0;
}

.admin-accounts-line-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-accounts-line-access[hidden] {
  display: none !important;
}

.admin-org-access {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.admin-org-access-row.is-limited {
  font-weight: 600;
  color: var(--text);
}

.admin-org-access-label {
  display: inline-block;
  min-width: 2.2em;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.admin-org-access.is-na {
  color: var(--text-muted);
}

.admin-accounts-tab-access {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-accounts-tab-all {
  margin: 0;
}

.admin-accounts-tab-list-wrap[hidden] {
  display: none !important;
}

.admin-accounts-tab-hint {
  margin: 0 0 8px;
  font-size: 11px;
}

.admin-accounts-tab-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.admin-accounts-tab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 12px;
}

.admin-accounts-tab-item input {
  margin: 0;
  flex-shrink: 0;
}

.admin-tab-access {
  font-size: 12px;
  color: var(--text-secondary);
}

.admin-tab-access.is-limited {
  font-weight: 600;
  color: var(--text);
}

.admin-tab-access.is-na {
  color: var(--text-muted);
}

.admin-accounts-tab-access[hidden] {
  display: none !important;
}

.admin-access-chip--admin {
  border-color: #c4b5fd;
  background: #f5f3ff;
  color: #6d28d9;
}

.admin-access-chip--developer {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}

html[data-theme="dark"] .admin-access-chip--system {
  background: #1e3a8a;
  color: #bfdbfe;
  border-color: #3b82f6;
}

html[data-theme="dark"] .admin-access-chip--admin {
  background: #4c1d95;
  color: #e9d5ff;
  border-color: #7c3aed;
}

html[data-theme="dark"] .admin-access-chip--developer {
  background: #14532d;
  color: #bbf7d0;
  border-color: #22c55e;
}

.btn-admin-secondary {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn-admin-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-admin-secondary:disabled:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.btn-admin-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.admin-accounts-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.admin-accounts-toolbar .admin-system-title {
  margin: 0;
}

.admin-accounts-summary {
  font-size: 12px;
  color: var(--text-muted);
}

.admin-accounts-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-admin-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-admin-add::before {
  content: "+";
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.btn-admin-add:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 153, 232, 0.22);
}

.btn-admin-add:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

html[data-theme="dark"] .btn-admin-add:hover {
  color: #fff;
}

.admin-accounts-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
}

.admin-accounts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-accounts-table th,
.admin-accounts-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--table-row-border);
  text-align: left;
  vertical-align: middle;
}

.admin-accounts-table thead tr {
  background: var(--table-header);
}

.admin-accounts-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.admin-accounts-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-accounts-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}

.admin-accounts-col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.admin-accounts-dev {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
}

.admin-accounts-dev.is-empty {
  color: var(--text-muted);
  background: var(--bg-muted);
  font-weight: 500;
}

.admin-accounts-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.admin-accounts-actions .btn-account-edit,
.admin-accounts-actions .btn-account-delete {
  font-size: 12px;
  padding: 5px 10px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.admin-accounts-actions .btn-account-edit:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.admin-accounts-actions .btn-account-delete:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.admin-accounts-empty {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.admin-accounts-table-wrap.is-empty .admin-accounts-table {
  display: none;
}

.admin-accounts-username {
  font-weight: 700;
  color: var(--text);
}

.admin-accounts-list-message {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-muted) 80%, var(--bg-surface));
  border: 1px solid var(--border);
  white-space: pre-line;
}

.admin-accounts-list-message.is-error {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
  background: color-mix(in srgb, #b91c1c 8%, var(--bg-surface));
}

.admin-accounts-list-message.is-success {
  color: #047857;
  border-color: rgba(4, 120, 87, 0.35);
  background: color-mix(in srgb, #047857 8%, var(--bg-surface));
}

.admin-accounts-table tbody tr[data-user-id],
.admin-accounts-table tbody tr[data-template-id],
.admin-accounts-table tbody tr[data-profile-id] {
  cursor: pointer;
}

.admin-accounts-table tbody tr.is-selected {
  background: color-mix(in srgb, var(--accent-soft) 75%, var(--bg-surface));
  box-shadow: inset 3px 0 0 var(--accent);
}

.admin-accounts-table tbody tr.is-selected:hover {
  background: color-mix(in srgb, var(--accent-soft) 85%, var(--bg-surface));
}

.admin-accounts-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.admin-accounts-drawer-root.is-open {
  pointer-events: auto;
}

.admin-accounts-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
}

html[data-theme="dark"] .admin-accounts-drawer-backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.admin-accounts-drawer-root.is-open .admin-accounts-drawer-backdrop {
  opacity: 1;
}

.admin-accounts-drawer {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.admin-accounts-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-accounts-drawer-head .admin-accounts-form-mode {
  margin: 0;
  font-size: 15px;
}

.admin-accounts-drawer-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.admin-accounts-drawer-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-accounts-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px 14px;
}

.admin-accounts-drawer .admin-accounts-form-panel {
  padding: 12px 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

@media (max-width: 859px) {
  .admin-accounts-drawer {
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(88vh, 640px);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .admin-accounts-drawer-root.is-open .admin-accounts-drawer {
    transform: translateY(0);
  }
}

@media (min-width: 860px) {
  .admin-accounts-drawer {
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 92vw);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
  }

  .admin-accounts-drawer--wide {
    width: min(640px, 94vw);
  }

  .admin-accounts-drawer-root.is-open .admin-accounts-drawer {
    transform: translateX(0);
  }
}

@media (max-width: 860px) {
  .admin-accounts-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-accounts-access-grid {
    grid-template-columns: 1fr;
  }

  .admin-accounts-factory-list {
    grid-template-columns: 1fr;
  }

  .admin-accounts-line-list {
    grid-template-columns: 1fr;
  }

  .admin-accounts-tab-list {
    grid-template-columns: 1fr;
  }

  .admin-accounts-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .admin-accounts-stats {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  width: var(--sidebar-width, 300px);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 12px 10px 20px;
  overflow-y: auto;
}

.sidebar--filters {
  --sidebar-control-h: 30px;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  padding: 14px 10px 20px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-page) 72%, var(--bg-surface)) 0%,
    var(--bg-surface) 100%
  );
  border-right: 1px solid var(--border);
  box-shadow: inset -1px 0 0 color-mix(in srgb, var(--bg-surface) 80%, #fff);
}

.sidebar--filters .sidebar-section {
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}
.sidebar--filters .sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar--filters .sidebar-section h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}
.sidebar--filters .sidebar-section h2::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #00b4ff, var(--accent));
  flex-shrink: 0;
}

.sidebar--filters .control-group {
  margin-bottom: 10px;
}
.sidebar--filters .control-group:last-child {
  margin-bottom: 0;
}
.sidebar--filters .control-group label,
.sidebar--filters .date-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.sidebar--filters .label-meta {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.sidebar--filters .control-group select:not([multiple]),
.sidebar--filters .control-group input[type="date"],
.sidebar--filters .control-group input[type="text"],
.sidebar--filters .date-field input[type="date"] {
  width: 100%;
  box-sizing: border-box;
  min-height: var(--sidebar-control-h);
  height: var(--sidebar-control-h);
  padding: 0 10px;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.2;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sidebar--filters .control-group select:not([multiple]) {
  padding-right: 32px;
  cursor: pointer;
}
.sidebar--filters .control-group select:not([multiple]):focus-visible,
.sidebar--filters .control-group input[type="date"]:focus-visible,
.sidebar--filters .control-group input[type="text"]:focus-visible,
.sidebar--filters .date-field input[type="date"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.sidebar--filters .control-group select[multiple] {
  width: 100%;
  min-height: 128px;
  padding: 6px;
  font-size: 12px;
  line-height: 1.45;
  font-family: inherit;
  background: var(--bg-surface-2);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sidebar--filters .control-group select[multiple]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.sidebar--filters .control-group select[multiple] option {
  padding: 6px 8px;
  margin: 1px 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
}
.sidebar--filters .control-group select[multiple] option:checked {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent));
  color: #fff;
  font-weight: 600;
}

.sidebar--filters .sidebar-hint--multiselect {
  margin: 0 0 12px;
}
.sidebar--filters .sidebar-hint {
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 65%, var(--bg-surface));
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.sidebar--filters .sidebar-hint:not(.sidebar-hint--multiselect) {
  margin-top: 8px;
}

.sidebar--filters .btn-row {
  gap: 8px;
}
.sidebar--filters .btn-row button {
  min-height: var(--sidebar-control-h);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.sidebar--filters .btn-row button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.sidebar--filters .sidebar-period-stack {
  gap: 8px;
}
.sidebar--filters .btn-row-presets--grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.sidebar--filters .btn-row-presets--grid + .btn-row-presets--grid {
  margin-top: 3px;
}
.sidebar--filters .btn-row-presets--grid button {
  flex: none;
  width: 100%;
  min-width: 0;
  padding: 0 4px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar--filters .btn-row-presets button {
  flex: 1;
}
.sidebar--filters .btn-row-query {
  margin-top: 2px;
}
.sidebar--filters #btnQuery {
  width: 100%;
  min-height: 36px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 153, 232, 0.22);
}
.sidebar--filters #btnQuery:hover {
  box-shadow: 0 8px 18px rgba(0, 153, 232, 0.28);
}

html[data-theme="dark"] .sidebar--filters {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-page) 80%, var(--bg-surface)) 0%,
    var(--bg-surface) 100%
  );
}
html[data-theme="dark"] .sidebar--filters .control-group select[multiple] option:checked {
  color: #fff;
}

.sidebar--filters .sidebar-subsection {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sidebar--filters .sidebar-subsection-title {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}

.sidebar-section {
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface-2);
  box-shadow: var(--shadow);
}
.sidebar-section:last-child {
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar h2 {
  font-size: 0.8125rem;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 12px 0;
  font-weight: 700;
}
.label-meta {
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 11px;
}
.label-required {
  color: #dc2626;
  font-weight: 700;
  margin-left: 2px;
}
.sidebar-hint {
  margin: 6px 0 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}
.sidebar-hint a {
  color: var(--accent);
  text-decoration: none;
}
.sidebar-hint a:hover {
  text-decoration: underline;
}

.admin-mobile-link {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-surface);
}
.admin-mobile-link:hover {
  background: var(--bg-surface-2);
}

.admin-data-status {
  margin-top: 0;
}
.admin-data-status-title {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.admin-data-status-meta {
  margin: 0 0 10px 0;
  display: grid;
  gap: 6px;
}
.admin-data-status-meta div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.admin-data-status-meta dt {
  margin: 0;
  color: var(--text-muted);
}
.admin-data-status-meta dd {
  margin: 0;
  color: var(--text);
  text-align: right;
  word-break: break-all;
}
.btn-admin-clear {
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-admin-clear:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}
.admin-data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-data-actions--manage {
  margin-top: 12px;
}
.admin-data-clear-hint {
  margin-top: 6px;
}
.admin-data-actions .btn-admin-backup,
.admin-data-actions .btn-admin-clear {
  flex: 1 1 140px;
  min-width: 0;
}
.btn-admin-backup {
  font-size: 12px;
}

.session-monitor-toolbar {
  margin-bottom: 0;
}
.session-monitor-summary {
  font-size: 12px;
  color: var(--text-muted);
}
.session-monitor-status.is-error {
  color: #dc2626;
}
.session-monitor-status:not([hidden]) {
  min-height: 1.45em;
}
.session-monitor-table-wrap {
  margin-top: 0;
}
.session-monitor-table th:first-child,
.session-monitor-table .session-col-activity {
  min-width: 4.5rem;
  width: 4.5rem;
  white-space: nowrap;
}
.session-monitor-table .session-ua {
  max-width: 220px;
  word-break: break-word;
}
.session-ip {
  font-size: 11px;
}
.session-scope {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.18);
}
.session-scope--external {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.14);
}
.session-scope--local {
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
}
.session-scope--pending {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.14);
}
.session-activity-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--text-muted);
  vertical-align: middle;
}
.session-activity-dot.is-active {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}
.session-activity-dot.is-idle {
  background: #f59e0b;
}
.session-activity-dot.is-error {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}
.session-monitor-actions {
  white-space: nowrap;
  text-align: right;
}
.btn-session-revoke {
  font-size: 12px;
  padding: 5px 10px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.btn-session-revoke:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}
.session-monitor-empty {
  margin: 0;
}

.access-log-toolbar {
  margin-bottom: 10px;
}

.access-log-summary {
  font-size: 12px;
  color: var(--text-muted);
}

.access-log-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin-bottom: 12px;
}

.access-log-filter {
  margin-bottom: 0;
  min-width: 140px;
}

.access-log-filter label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.access-log-filter select {
  width: 100%;
  min-height: 36px;
  padding: 7px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  box-sizing: border-box;
}

.access-log-filter-action {
  min-width: auto;
}

.access-log-filter-action-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1;
  visibility: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.access-log-refresh-btn {
  min-height: 36px;
  padding: 7px 14px;
  white-space: nowrap;
}

.access-log-status.is-error {
  color: #b91c1c;
}

.access-log-table-wrap {
  margin-top: 4px;
}

.access-log-table .access-log-message {
  max-width: 220px;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
}

.access-log-event {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-secondary);
  white-space: nowrap;
}

.access-log-event.is-success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}

.access-log-event.is-error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.access-log-event.is-warn {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #b45309;
}

html[data-theme="dark"] .access-log-event.is-success {
  background: #14532d;
  color: #bbf7d0;
  border-color: #22c55e;
}

html[data-theme="dark"] .access-log-event.is-error {
  background: #450a0a;
  color: #fecaca;
  border-color: #ef4444;
}

html[data-theme="dark"] .access-log-event.is-warn {
  background: #451a03;
  color: #fde68a;
  border-color: #f59e0b;
}

.access-log-actions {
  margin-top: 10px;
}

.access-log-empty {
  margin: 0;
}

.sidebar-section--server {
  border-bottom-color: var(--border-strong);
}

.server-status-panel {
  margin-top: 0;
}

.server-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.server-status-refresh-btn {
  width: 28px;
  height: 28px;
  margin-left: auto;
  border-radius: 8px;
}

.server-status-refresh-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.server-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}

.server-status-dot[data-state="online"] {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.server-status-dot[data-state="launcher"] {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.server-status-dot[data-state="offline"] {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.server-status-dot[data-state="checking"] {
  background: var(--text-muted);
  animation: server-pulse 1s ease-in-out infinite;
}

@keyframes server-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.server-status-message {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.server-status-message.is-error {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}

.server-status-message.is-success {
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
}

.server-action-progress {
  margin-top: 10px;
}

.server-action-progress-track {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.server-action-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #0099e8, #38bdf8);
  transition: width 0.35s ease;
}

.server-action-progress-label {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.btn-admin-primary.is-loading,
.btn-admin-secondary.is-loading {
  cursor: wait;
  opacity: 0.9;
}

.btn-admin-primary.is-loading:disabled,
.btn-admin-secondary.is-loading:disabled {
  opacity: 0.9;
}

.btn-admin-primary.is-loading::before,
.btn-admin-secondary.is-loading::before {
  content: '';
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.65s linear infinite;
  vertical-align: -2px;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.btn-server-launch:hover {
  filter: brightness(1.06);
}

.btn-server-launch:disabled {
  opacity: 0.65;
  cursor: wait;
}

.sidebar-hint code {
  font-size: 10px;
  word-break: break-all;
}

body.server-offline .control-group input[type="file"]#csvFile {
  opacity: 0.55;
  cursor: not-allowed;
}

.control-group {
  margin-bottom: 14px;
}
.control-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.control-group select,
.control-group input[type="file"],
.control-group input[type="date"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 8px;
}
.control-group select:focus-visible,
.control-group input[type="file"]:focus-visible,
.control-group input[type="date"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.control-group-line-select select {
  font-size: 12px;
}

/** 다중 선택 목록: 테마별 --control-muted-* (라이트: 밝은 회색 / 다크: 진한 회색). 파일 선택 버튼은 상단 .control-group input[type="file"] 기본값 유지 */
.control-group select[multiple] {
  background: var(--control-muted-fill);
  color: var(--control-muted-text);
  border-color: var(--control-muted-border);
}
.control-group select[multiple] option {
  background: var(--control-muted-fill);
  color: var(--control-muted-text);
}

.date-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/** flex + basis 0: date 입력 기본 min-width 로 우측이 밀려 버튼 열과 안 맞는 문제 방지 */
.date-row-dual {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.date-field {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
}
.date-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.date-field input[type="date"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.sidebar-period-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
  align-items: stretch;
  box-sizing: border-box;
}
.sidebar-period-stack > .control-group {
  margin-bottom: 0;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-row button {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-muted);
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease, filter 0.15s ease;
}
.btn-row button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-row button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-row-presets {
  margin-top: 4px;
}
.btn-row-presets button {
  min-height: 40px;
}
.btn-row-query {
  margin-top: 10px;
  flex-direction: column;
}
.btn-row-query button {
  flex: none;
  width: 100%;
  min-height: 42px;
  font-weight: 600;
  font-size: 14px;
}
#btnQuery {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
#btnQuery:hover {
  filter: brightness(1.08);
  color: #fff;
  border-color: var(--accent);
}
html[data-theme="dark"] #btnQuery { color: #1e1e1e; }

.main-content {
  flex: 1;
  min-width: 0;
  padding: 14px 16px 20px;
  overflow-y: auto;
}

.chart-card {
  background: var(--bg-surface);
  padding: 18px 20px;
  border-radius: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.line-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.line-chart-block h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--text);
}
.line-chart-canvas-wrap {
  position: relative;
  height: 240px;
}

.developer-timeline-chart-title {
  margin: 0 0 6px 0;
  font-size: 15px;
  color: var(--text);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.query-period-range {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  letter-spacing: -0.01em;
}

.admin-hr-dev-status-title,
.m-hr-dev-status-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.m-hr-dev-status-title {
  margin: 4px 0 10px;
}

.developer-timeline-chart-hint {
  margin: 0 0 8px 0;
}

.developer-timeline-chart-meta {
  margin: 0 0 10px 0;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.dev-util-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.dev-util-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px 12px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.dev-util-card--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.dev-util-card--clickable:hover {
  border-color: var(--m-accent-border, #93c5fd);
  box-shadow: var(--m-shadow-md, 0 8px 24px rgba(15, 23, 42, 0.08));
}

.dev-util-card--clickable:focus-visible {
  outline: 2px solid var(--m-accent, #2563eb);
  outline-offset: 2px;
}

.dev-util-card-name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.dev-util-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 88px;
}

.dev-util-card-org {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dev-util-card-team,
.dev-util-card-category {
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  word-break: keep-all;
}

.dev-util-card-team {
  color: var(--text-secondary, #475569);
  font-weight: 600;
}

.dev-util-card-category {
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.dev-util-card-chart {
  position: relative;
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  container-type: size;
}

.dev-util-card-chart canvas {
  display: block;
  position: relative;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
}

.dev-util-card-chart-value {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  max-width: 58%;
  font-size: clamp(16px, 24cqmin, 26px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  color: var(--chart-center-text, #0f172a);
}

.dev-util-card-chart--low .dev-util-card-chart-value {
  color: #d97706;
}

.dev-util-card-chart--balanced .dev-util-card-chart-value {
  color: #16a34a;
}

.dev-util-card-chart--high .dev-util-card-chart-value {
  color: #2563eb;
}

.dev-util-card-chart--overloaded .dev-util-card-chart-value {
  color: #dc2626;
}

html[data-theme="dark"] .dev-util-card-chart--low .dev-util-card-chart-value {
  color: #fbbf24;
}

html[data-theme="dark"] .dev-util-card-chart--balanced .dev-util-card-chart-value {
  color: #4ade80;
}

html[data-theme="dark"] .dev-util-card-chart--high .dev-util-card-chart-value {
  color: #60a5fa;
}

html[data-theme="dark"] .dev-util-card-chart--overloaded .dev-util-card-chart-value {
  color: #f87171;
}

.dev-util-card-rate {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.4;
  color: var(--text);
}

.dev-util-card-rate strong {
  font-size: 12px;
  font-weight: 700;
}

.dev-util-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}

.dev-util-badge--low {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
}

.dev-util-badge--balanced {
  color: #15803d;
  background: rgba(34, 197, 94, 0.14);
}

.dev-util-badge--high {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.14);
}

.dev-util-badge--overloaded {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.14);
}

.dev-util-card--overloaded {
  border-color: rgba(239, 68, 68, 0.35);
}

.dev-util-card-counts {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.dev-util-card-holidays {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

html[data-theme="dark"] .dev-util-card {
  background: var(--bg-surface);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

html[data-theme="dark"] .dev-util-card-name {
  color: var(--text);
}

html[data-theme="dark"] .dev-util-card-team {
  color: var(--text-secondary, #cbd5e1);
}

html[data-theme="dark"] .dev-util-card-category,
html[data-theme="dark"] .dev-util-card-counts,
html[data-theme="dark"] .dev-util-card-holidays,
html[data-theme="dark"] .developer-timeline-chart-meta {
  color: var(--text-muted);
}

html[data-theme="dark"] .dev-util-card-rate {
  color: var(--text);
  border-top-color: var(--border);
}

html[data-theme="dark"] .dev-util-badge--low {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
}

html[data-theme="dark"] .dev-util-badge--balanced {
  color: #86efac;
  background: rgba(34, 197, 94, 0.18);
}

html[data-theme="dark"] .dev-util-badge--high {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.2);
}

html[data-theme="dark"] .dev-util-badge--overloaded {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.2);
}

html[data-theme="dark"] .dev-util-card--overloaded {
  border-color: rgba(248, 113, 113, 0.45);
}

@media (max-width: 1400px) {
  .dev-util-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .dev-util-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .dev-util-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .dev-util-grid { grid-template-columns: 1fr; }
}

.dev-util-grid--mobile {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 360px) {
  .dev-util-grid--mobile { grid-template-columns: 1fr; }
}

.dev-util-detail-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-surface);
  color: var(--text);
  box-shadow: var(--m-shadow-lg, 0 24px 48px rgba(15, 23, 42, 0.18));
}

.dev-util-detail-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.dev-util-detail {
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 720px);
}

.dev-util-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.dev-util-detail-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--m-accent);
}

.dev-util-detail-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.dev-util-detail-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.dev-util-detail-summary {
  margin: 0;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
}

.dev-util-detail-body {
  overflow: auto;
  padding: 12px 18px 18px;
}

.dev-util-detail-empty {
  margin: 0;
  padding: 24px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.dev-util-detail-product + .dev-util-detail-product {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.dev-util-detail-product-head,
.dev-util-detail-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dev-util-detail-product-head {
  margin-bottom: 8px;
}

.dev-util-detail-product-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.dev-util-detail-product-hours {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--m-accent);
}

.dev-util-detail-task-hours {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--m-accent);
}

.dev-util-detail-task-hours--empty {
  color: var(--text-muted);
  font-weight: 600;
}

.dev-util-detail-task-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dev-util-detail-task {
  padding: 7px 0;
}

.dev-util-detail-task + .dev-util-detail-task {
  border-top: 1px dashed var(--border);
}

.dev-util-detail-task-name {
  min-width: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.dev-util-detail-task-source {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-muted);
  vertical-align: middle;
}

html[data-theme="dark"] .dev-util-detail-dialog {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .dev-util-detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.m-dev-util-section {
  padding: 4px 0 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.m-content .m-dev-util-section {
  flex-shrink: 0;
}

.m-dev-util-title {
  margin: 0 0 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.m-dev-util-meta {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.m-dev-util-hint {
  margin: 0 0 8px;
}

html[data-theme="dark"] .m-dev-util-section {
  border-bottom-color: var(--border-subtle, #334155);
}

html[data-theme="dark"] .m-dev-util-title {
  color: var(--text-primary, #f1f5f9);
}

.admin-holidays-page {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.admin-holidays-stats {
  margin-bottom: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-holidays-form {
  margin: 0 0 16px;
}

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

.admin-holidays-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-holidays-year-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.admin-holidays-year-select {
  min-width: 112px;
  min-height: 36px;
  padding: 7px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  box-sizing: border-box;
}

.admin-holidays-year-select:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 1px;
  border-color: var(--accent);
}

.admin-holidays-message {
  margin: 12px 0 0;
}

.admin-holidays-page .admin-accounts-table {
  font-size: 12px;
  line-height: 1.3;
}

.admin-holidays-page .admin-accounts-table th,
.admin-holidays-page .admin-accounts-table td {
  padding: 6px 10px;
}

.admin-holidays-page .admin-accounts-table th {
  font-size: 11px;
  line-height: 1.25;
  padding-top: 7px;
  padding-bottom: 7px;
}

.admin-holidays-page .admin-accounts-table td .sidebar-hint {
  margin: 0;
  line-height: 1.3;
}

.admin-holidays-page .admin-accounts-table .btn-admin-secondary {
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.admin-holidays-page .holiday-kind-chip {
  padding: 2px 7px;
  font-size: 10px;
  line-height: 1.25;
}

.admin-holidays-page .admin-accounts-empty {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.35;
}

.holiday-kind-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
}

.holiday-kind-chip--national {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.holiday-kind-chip--public {
  border-color: #fcd34d;
  background: #fef3c7;
  color: #b45309;
}

html[data-theme="dark"] .admin-holidays-year-select {
  background: var(--input-bg);
  border-color: var(--input-border);
  color: var(--text);
}

html[data-theme="dark"] .holiday-kind-chip--national {
  background: #1e3a8a;
  color: #bfdbfe;
  border-color: #3b82f6;
}

html[data-theme="dark"] .holiday-kind-chip--public {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: #f59e0b;
}

@media (max-width: 860px) {
  .admin-holidays-stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .admin-holidays-stats {
    grid-template-columns: 1fr;
  }

  .admin-holidays-form-grid {
    grid-template-columns: 1fr;
  }
}

.product-table-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px 0;
}
.product-table-card-toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.product-table-card-title {
  margin: 0;
  flex: 0 0 auto;
  min-width: 0;
  font-size: 1.125rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text);
}
.product-table-status-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 0;
  min-width: 0;
  flex: 1;
}
.product-table-status-filter-label {
  flex-shrink: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}
.product-table-status-checkboxes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}
.status-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  opacity: 0.72;
  transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.status-filter-chip input {
  margin: 0;
  cursor: pointer;
}
.status-filter-chip:has(input:checked) {
  opacity: 1;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.status-filter-chip--undecided { border-color: #cbd5e1; }
.status-filter-chip--undecided input { accent-color: #64748b; }
.status-filter-chip--undecided:has(input:checked) {
  background: #f1f5f9;
  color: #64748b;
  border-color: #94a3b8;
}
.status-filter-chip--planned { border-color: #c4b5fd; }
.status-filter-chip--planned input { accent-color: #6d28d9; }
.status-filter-chip--planned:has(input:checked) {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #a78bfa;
}
.status-filter-chip--progress { border-color: #7dd3fc; }
.status-filter-chip--progress input { accent-color: #0369a1; }
.status-filter-chip--progress:has(input:checked) {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #38bdf8;
}
.status-filter-chip--complete { border-color: #86efac; }
.status-filter-chip--complete input { accent-color: #15803d; }
.status-filter-chip--complete:has(input:checked) {
  background: #dcfce7;
  color: #15803d;
  border-color: #4ade80;
}
.status-filter-chip--closed { border-color: #cbd5e1; }
.status-filter-chip--closed input { accent-color: #475569; }
.status-filter-chip--closed:has(input:checked) {
  background: #e2e8f0;
  color: #475569;
  border-color: #94a3b8;
}
.status-filter-chip--hold { border-color: #fdba74; }
.status-filter-chip--hold input { accent-color: #c2410c; }
.status-filter-chip--hold:has(input:checked) {
  background: #ffedd5;
  color: #c2410c;
  border-color: #fb923c;
}
html[data-theme="dark"] .status-filter-chip {
  background: var(--bg-surface-2);
}
html[data-theme="dark"] .status-filter-chip--undecided:has(input:checked) {
  background: #3a3a3a;
  color: #cbd5e1;
  border-color: #64748b;
}
html[data-theme="dark"] .status-filter-chip--planned:has(input:checked) {
  background: #4c1d95;
  color: #e9d5ff;
  border-color: #7c3aed;
}
html[data-theme="dark"] .status-filter-chip--progress:has(input:checked) {
  background: #0c4a6e;
  color: #bae6fd;
  border-color: #0284c7;
}
html[data-theme="dark"] .status-filter-chip--complete:has(input:checked) {
  background: #14532d;
  color: #bbf7d0;
  border-color: #16a34a;
}
html[data-theme="dark"] .status-filter-chip--closed:has(input:checked) {
  background: #334155;
  color: #e2e8f0;
  border-color: #64748b;
}
html[data-theme="dark"] .status-filter-chip--hold:has(input:checked) {
  background: #7c2d12;
  color: #fed7aa;
  border-color: #ea580c;
}
.product-table-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 2px;
}
.btn-product-table-fs {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-muted);
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
}
.btn-product-table-fs:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-product-table-fs:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chart-card.chart-card--product-table.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  margin: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--bg-surface);
}
/* 파스텔(c1–c4): 목록 영역(.product-table-scroll)만 배경·글자 대비 적용, 툴바는 앱 테마 유지 */
#productTableCard.is-fullscreen[data-fs-theme^="c"] .product-table-scroll {
  background: var(--product-table-fs-bg);
  color: #000000;
  --text: #000000;
  --text-secondary: #1a1a1a;
  --text-muted: #333333;
  --border: rgba(0, 0, 0, 0.14);
  --border-strong: rgba(0, 0, 0, 0.26);
  --table-header: rgba(0, 0, 0, 0.055);
  --table-row-border: rgba(0, 0, 0, 0.11);
}
.product-table-fs-theme {
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chart-card.chart-card--product-table.is-fullscreen .product-table-fs-theme {
  display: inline-flex;
}
.btn-product-table-fs-swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid rgba(15, 23, 42, 0.2);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  font-size: 0;
  line-height: 0;
  color: transparent;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
html[data-theme="dark"] .btn-product-table-fs-swatch {
  border-color: rgba(255, 255, 255, 0.35);
}
.btn-product-table-fs-swatch--default {
  background: linear-gradient(135deg, var(--bg-surface) 45%, var(--bg-muted) 45%);
}
.btn-product-table-fs-swatch[data-fs-theme="c1"] { background-color: #F4F7FB; }
.btn-product-table-fs-swatch[data-fs-theme="c2"] { background-color: #D9EBFF; }
.btn-product-table-fs-swatch[data-fs-theme="c3"] { background-color: #D7F5F0; }
.btn-product-table-fs-swatch[data-fs-theme="c4"] { background-color: #F9FAD9; }
.btn-product-table-fs-swatch[data-fs-theme="c5"] { background-color: #F0E6FA; }
.btn-product-table-fs-swatch:hover {
  border-color: var(--accent);
}
.btn-product-table-fs-swatch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-product-table-fs-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--accent);
}
.chart-card.chart-card--product-table.is-fullscreen .product-table-card-toolbar {
  flex-shrink: 0;
}
.chart-card.chart-card--product-table.is-fullscreen .product-table-scroll {
  flex: 1;
  min-height: 0;
  max-height: none !important;
}
body.product-table-fs-open {
  overflow: hidden;
}

/* 인쇄용 메타(작성자·작성일): 화면에서는 숨김 */
.product-table-print-meta {
  display: none;
}

.product-table-wrap { overflow-x: auto; }
.product-table-limit-hint {
  font-size: 12px;
  font-weight: normal;
  color: var(--text-muted);
  margin-left: 4px;
}
.product-table-scroll {
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-height: 0;
}
.product-table-scroll table.product-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--table-header);
  color: var(--text);
  box-shadow: 0 1px 0 var(--border);
}
table.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.product-table thead tr { background: var(--table-header); }
table.product-table th,
table.product-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--table-row-border);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}
table.product-table thead th {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}
table.product-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}
@media (min-width: 769px) {
  table.product-table {
    table-layout: fixed;
  }
  table.product-table th[data-key="category"],
  table.product-table th[data-key="machines"],
  table.product-table th[data-key="start_date"],
  table.product-table th[data-key="end_date"] {
    width: 8%;
  }
  table.product-table th[data-key="status"] {
    width: 6%;
  }
  table.product-table th[data-key="factories"] {
    width: 8%;
  }
  table.product-table th[data-key="product_name"] {
    width: 12%;
  }
  table.product-table th[data-key="task"] {
    width: 24%;
  }
  table.product-table th[data-key="lines"] {
    width: 8%;
  }
  table.product-table th.product-table-col-actions {
    width: 10%;
  }
  table.product-table td.product-table-col-task {
    white-space: normal;
    word-break: break-word;
  }
}

.sort-icon { font-size: 11px; margin-left: 4px; color: var(--text-muted); }
th { cursor: pointer; -webkit-user-select: none; user-select: none; }

/* PRODUCT 개발 목록 — 모바일·좁은 화면 */
@media (max-width: 768px) {
  .admin-page-content {
    padding: 12px 12px 20px;
  }

  #productTableCard.chart-card {
    padding: 12px;
    border-radius: 12px;
  }

  .product-table-card-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  .product-table-card-toolbar-left {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .product-table-card-title {
    font-size: 1rem;
  }

  .product-table-status-filter {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .product-table-status-checkboxes {
    gap: 6px;
  }

  .status-filter-chip {
    font-size: 10px;
    padding: 5px 9px;
  }

  .product-table-card-actions {
    justify-content: flex-start;
    width: 100%;
    gap: 6px;
  }

  .product-table-card-actions .btn-product-table-fs {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 13px;
    text-align: center;
  }

  #productTableScroll.product-table-scroll,
  .product-table-wrap.product-table-scroll {
    max-height: none !important;
    overflow-x: visible;
  }

  table.product-table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  table.product-table thead {
    display: none;
  }

  table.product-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  table.product-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-surface);
    box-shadow: var(--shadow);
  }

  table.product-table tbody tr:hover {
    background: var(--bg-surface);
    border-color: var(--border-strong);
  }

  table.product-table th,
  table.product-table td {
    display: grid;
    grid-template-columns: minmax(84px, 36%) 1fr;
    gap: 8px 10px;
    align-items: start;
    padding: 7px 0;
    border: none;
    white-space: normal;
    word-break: break-word;
    text-align: left;
    font-size: 13px;
  }

  table.product-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.45;
  }

  table.product-table td.product-table-col-name {
    display: block;
    order: -2;
    padding: 0 0 8px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
  }

  table.product-table td.product-table-col-name::before {
    display: none;
  }

  table.product-table td.product-table-col-status {
    order: -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 0;
    padding-bottom: 10px;
    margin-bottom: 2px;
    border-bottom: 1px dashed var(--border);
  }

  table.product-table td.product-table-col-status::before {
    flex: 0 0 auto;
    margin-right: 2px;
  }

  table.product-table td.product-table-col-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px dashed var(--border);
    width: 100%;
  }

  table.product-table td.product-table-col-actions::before {
    display: none;
  }

  table.product-table td.product-table-col-actions .btn-product-edit,
  table.product-table td.product-table-col-actions .btn-product-delete {
    flex: 1 1 calc(50% - 4px);
    min-height: 40px;
    margin: 0;
    padding: 8px 12px;
    font-size: 13px;
  }

  .chart-card.chart-card--product-table.is-fullscreen {
    padding: 10px;
  }

  .chart-card.chart-card--product-table.is-fullscreen .product-table-card-toolbar {
    margin-bottom: 8px;
  }
}

@media (max-width: 480px) {
  .product-table-card-actions .btn-product-table-fs {
    flex: 1 1 100%;
  }
}

/* PRODUCT 개발 목록 — A4 인쇄 (열이 많아 가로가 유리; 세로만 쓰려면 @page size를 A4 portrait로 변경) */
@media print {
  @page {
    size: A4 landscape;
    margin: 10mm 12mm;
  }
  html, body {
    background: #fff !important;
    color: #000 !important;
    -webkit-print-color-adjust: economy;
    print-color-adjust: economy;
  }
  .app-top-bar,
  .admin-stats-grid,
  .admin-tabs,
  .admin-tab-panel:not(.is-active),
  .sidebar,
  .main-content > .chart-card:not(#productTableCard) {
    display: none !important;
  }
  body.product-table-fs-open {
    overflow: visible !important;
  }
  .app-body {
    display: block !important;
  }
  .main-content {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    max-width: none !important;
  }
  #productTableCard {
    display: block !important;
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
    width: 100% !important;
  }
  #productTableCard.is-fullscreen {
    position: static !important;
  }
  .product-table-card-actions {
    display: none !important;
  }
  .product-table-card-toolbar {
    margin: 0 0 6mm 0 !important;
  }
  .product-table-card-title {
    color: #000 !important;
    font-size: 12pt !important;
  }
  .product-table-limit-hint,
  #productTableLimitHint {
    display: none !important;
  }
  .product-table-print-meta {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    margin: 0 0 4mm 0 !important;
    padding: 0 !important;
    font-size: 10pt !important;
    line-height: 1.4 !important;
    color: #000 !important;
  }
  .product-table-print-meta-left {
    text-align: left;
    flex: 1;
    min-width: 0;
  }
  .product-table-print-meta-right {
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .sort-icon {
    display: none !important;
  }
  #productTableScroll,
  .product-table-wrap.product-table-scroll {
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
    border-radius: 0 !important;
  }
  /* 외곽선은 래퍼가 아니라 테이블에만 — 인쇄 시 오른쪽 잘림 방지 */
  table.product-table {
    font-size: 8.5pt !important;
    width: 100% !important;
    background: #fff !important;
    border-collapse: collapse !important;
    border: 1px solid #333 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  table.product-table thead {
    display: table-header-group;
  }
  table.product-table tbody {
    display: table-row-group !important;
  }
  table.product-table thead th {
    position: static !important;
    background: #e8e8e8 !important;
    color: #000 !important;
    box-shadow: none !important;
    border-bottom: 1px solid #333 !important;
  }
  table.product-table th,
  table.product-table td {
    display: table-cell !important;
    padding: 3px 5px !important;
    color: #000 !important;
    background: #fff !important;
    border-bottom: 1px solid #bbb !important;
  }
  table.product-table td::before {
    display: none !important;
    content: none !important;
  }
  table.product-table tbody tr {
    display: table-row !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  /* 마지막 열에 오른쪽 외곽선 명시 — 인쇄 엔진에서 테이블 오른쪽이 잘리는 경우 대비 */
  table.product-table th:last-child,
  table.product-table td:last-child {
    border-right: 1px solid #333 !important;
  }
  th { cursor: default !important; }
  /* 전체화면 인쇄: Line 열 — thead·tbody 모두 제거(display:none은 헤더만 남을 때 열 밀림 유발) */
  body.product-table-print-hide-lines table.product-table th.product-table-col-lines,
  body.product-table-print-hide-lines table.product-table td.product-table-col-lines {
    visibility: collapse !important;
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
  }
  table.product-table th.product-table-col-actions,
  table.product-table td.product-table-col-actions {
    display: none !important;
  }
}

.collapsible-head {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

/* Gantt — 컬럼 순서: Product | Task | Status | Line | Developer | Timeline */
.gantt-wrap {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--gantt-wrap-bg);
  --gantt-w-product: 150px;
  --gantt-w-task: 300px;
  --gantt-w-status: 50px;
  --gantt-w-line: 100px;
  --gantt-w-machine: 100px;
  --gantt-w-timeline-pct: 50%;
  --gantt-w-timeline-min: 500px;
  --gantt-cell-product-bg: var(--bg-surface-2);
  --gantt-cell-task-bg: var(--bg-surface);
}
.gantt-inner {
  min-width: calc(
    var(--gantt-w-product) + var(--gantt-w-task) + var(--gantt-w-status) +
    var(--gantt-w-line) + var(--gantt-w-machine) + var(--gantt-w-timeline-min)
  );
  padding: 0;
}
table.gantt-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--bg-surface);
}
table.gantt-table thead th {
  background: var(--table-header);
  color: var(--text);
  border-bottom: 2px solid var(--border-strong);
  padding: 6px 8px;
  text-align: left;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 2;
  box-sizing: border-box;
}
.gantt-th-product {
  width: var(--gantt-w-product);
  min-width: var(--gantt-w-product);
  max-width: var(--gantt-w-product);
}
.gantt-th-task {
  width: var(--gantt-w-task);
  min-width: var(--gantt-w-task);
}
.gantt-th-status {
  width: var(--gantt-w-status);
  min-width: var(--gantt-w-status);
}
.gantt-th-line {
  width: var(--gantt-w-line);
  min-width: var(--gantt-w-line);
  max-width: var(--gantt-w-line);
}
.gantt-th-machine {
  width: var(--gantt-w-machine);
  min-width: var(--gantt-w-machine);
  border-right: 1px solid var(--border-strong);
}
.gantt-th-timeline {
  width: var(--gantt-w-timeline-pct);
  min-width: var(--gantt-w-timeline-min);
  vertical-align: bottom;
}
.gantt-timeline-header-inner {
  position: relative;
  min-height: 36px;
}
.gantt-timeline-header-inner--month {
  min-height: 52px;
}
.gantt-tier {
  position: relative;
  width: 100%;
}
.gantt-tier-month {
  height: 22px;
  border-bottom: 1px solid var(--border-strong);
}
.gantt-month-span {
  position: absolute;
  top: 0;
  bottom: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: var(--text-secondary);
  border-left: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}
.gantt-tier-days {
  height: 28px;
  margin-top: 2px;
}
.gantt-day-tick {
  position: absolute;
  top: 0;
  border-left: 1px solid var(--border);
  font-size: 10px;
  line-height: 1;
  color: var(--text-muted);
  padding: 4px 1px 0 3px;
  white-space: nowrap;
}
.gantt-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 2px;
  white-space: nowrap;
}
table.gantt-table tbody td {
  border-bottom: 1px solid var(--table-row-border);
  padding: 6px 8px;
  vertical-align: middle;
  background: var(--bg-surface);
  color: var(--text);
  word-break: keep-all;
  overflow-wrap: break-word;
  min-width: 0;
  box-sizing: border-box;
}
table.gantt-table tbody td:last-child {
  overflow: hidden;
  position: relative;
  word-break: normal;
}
table.gantt-table tbody td[rowspan] {
  border-right: 1px solid var(--border);
  font-weight: 500;
}
table.gantt-table tbody td.gantt-td-product {
  background: var(--gantt-cell-product-bg);
}
table.gantt-table tbody td.gantt-td-status {
  background: var(--gantt-cell-product-bg);
}
table.gantt-table tbody td.gantt-td-task {
  background: var(--gantt-cell-task-bg);
}
table.gantt-table tbody td.gantt-td-line {
  background: var(--gantt-cell-task-bg);
}
table.gantt-table tbody td.gantt-td-machine {
  border-right: 1px solid var(--border-strong);
}
.gantt-row-track {
  position: relative;
  min-height: 20px;
  height: 20px;
  overflow: hidden;
  border-radius: 2px;
}
.gantt-row-track--nodate {
  background: var(--bg-muted);
}
.gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 18px;
  border-radius: 4px;
  min-width: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.gantt-bar--progress {
  background: var(--gantt-bar-progress);
}
.gantt-bar--planned {
  background: var(--gantt-bar-planned);
}
.gantt-bar--done {
  background: var(--gantt-bar-done);
}
.gantt-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── mobile.html: 모바일 앱 UI ── */
body.mobile-app {
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: var(--font-ui);
  --m-accent: #4f46e5;
  --m-accent-hover: #4338ca;
  --m-accent-soft: rgba(79, 70, 229, 0.1);
  --m-accent-border: rgba(79, 70, 229, 0.22);
  --m-success: #059669;
  --m-success-soft: rgba(5, 150, 105, 0.12);
  --m-warning: #d97706;
  --m-warning-soft: rgba(217, 119, 6, 0.12);
  --m-muted: #64748b;
  --m-muted-soft: rgba(100, 116, 139, 0.12);
  --m-planned: #7c3aed;
  --m-planned-soft: rgba(124, 58, 237, 0.12);
  --m-header-bg: rgba(255, 255, 255, 0.82);
  --m-header-blur: blur(16px);
  --m-card-radius: 16px;
  --m-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --m-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --m-shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.1);
  --m-touch: 48px;
  --m-success-border: rgba(5, 150, 105, 0.25);
  --m-warning-border: rgba(217, 119, 6, 0.25);
  --bg-page: #f4f6fb;
}

html[data-theme="dark"] body.mobile-app {
  --m-accent: #818cf8;
  --m-accent-hover: #a5b4fc;
  --m-accent-soft: rgba(129, 140, 248, 0.15);
  --m-accent-border: rgba(129, 140, 248, 0.28);
  --m-header-bg: rgba(30, 30, 46, 0.88);
  --m-header-blur: blur(16px);
  --bg-page: #14141f;
  --m-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --m-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --m-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
}

body.mobile-app.m-sheet-open {
  overflow: hidden;
}

body.mobile-app.m-detail-open {
  overflow: hidden;
}

body.mobile-app .m-view--auth[hidden],
body.mobile-app .m-view--app[hidden] {
  display: none !important;
}

.m-view--app {
  flex: 1;
  min-height: 0;
  position: relative;
}

.m-shell--hub {
  display: flex;
  flex-direction: column;
}

.m-shell--hub > .m-view--auth {
  position: relative;
  inset: auto;
  flex: 1;
  min-height: 0;
}

.m-shell--hub > .m-view--app > .m-view--list,
.m-shell--hub > .m-view--app > .m-view--detail {
  position: absolute;
}

.m-shell {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-page);
}

.m-connection-banner {
  position: relative;
  z-index: 30;
  padding: 10px 16px;
  background: rgba(239, 68, 68, 0.1);
  border-bottom: 1px solid rgba(239, 68, 68, 0.3);
}

.m-connection-banner-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #b91c1c;
}

html[data-theme="dark"] .m-connection-banner {
  background: rgba(239, 68, 68, 0.15);
}

html[data-theme="dark"] .m-connection-banner-text {
  color: #fca5a5;
}

.m-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.m-view--detail {
  z-index: 20;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  background: var(--bg-page);
}

.m-view--detail.is-active {
  transform: translateX(0);
}

/* Workspace header */
.m-workspace-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  background: var(--m-header-bg);
  -webkit-backdrop-filter: var(--m-header-blur);
  backdrop-filter: var(--m-header-blur);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.m-workspace-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.m-workspace-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--m-accent) 0%, color-mix(in srgb, var(--m-accent) 70%, #6366f1) 100%);
  color: #fff;
  box-shadow: 0 4px 12px var(--m-accent-border);
  flex-shrink: 0;
}

html[data-theme="dark"] .m-workspace-logo {
  color: #0f172a;
}

.m-workspace-text {
  min-width: 0;
}

.m-workspace-label {
  margin: 0 0 2px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--m-accent);
}

.m-workspace-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

.m-topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.m-topbar-actions > .m-icon-btn[hidden],
.m-topbar-actions > .tm-header-main-only[hidden] {
  display: none !important;
}

.m-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  box-shadow: var(--m-shadow-sm);
}

.m-icon-btn:active {
  transform: scale(0.94);
  background: var(--bg-muted);
}

.m-icon-btn:focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: 2px;
}

.m-back-btn {
  flex-shrink: 0;
  color: var(--m-accent);
  border-color: var(--m-accent-border);
  background: var(--m-accent-soft);
}

html[data-theme="light"] #btnThemeToggle .m-icon-moon,
html[data-theme="light"] #btnThemeToggleMain .m-icon-moon,
html[data-theme="dark"] #btnThemeToggle .m-icon-sun,
html[data-theme="dark"] #btnThemeToggleMain .m-icon-sun {
  display: none;
}

/* Toolbar + board header */
.m-toolbar {
  flex-shrink: 0;
  padding: 0 16px 8px;
  background: var(--bg-page);
}

.m-search-bar {
  position: relative;
  margin-bottom: 12px;
}

.m-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.m-search-input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--m-shadow-sm);
  -webkit-appearance: none;
  appearance: none;
}

.m-search-input::placeholder {
  color: var(--text-muted);
}

.m-search-input:focus {
  outline: none;
  border-color: var(--m-accent);
  box-shadow: 0 0 0 3px var(--m-accent-soft);
}

.m-search-bar--compact {
  margin-bottom: 8px;
}

.m-search-bar--compact .m-search-input {
  height: 38px;
  font-size: 0.8125rem;
}

/* Developer tree filter */
.m-dev-filter {
  margin-bottom: 10px;
  padding: 0;
  overflow: hidden;
}

.m-dev-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  font-family: inherit;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
}

.m-dev-filter-head-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.m-dev-filter-head .m-label {
  margin: 0;
}

.m-dev-filter-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.m-dev-filter.is-open .m-dev-filter-chevron {
  transform: rotate(90deg);
}

.m-dev-filter-summary--head {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--m-accent);
}

.m-dev-filter-body {
  display: none;
  padding: 0 14px 14px;
}

.m-dev-filter.is-open .m-dev-filter-body {
  display: block;
}

.m-dev-filter-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 8px;
}

.m-dev-filter-actions {
  display: flex;
  gap: 6px;
}

.m-dev-filter-action {
  margin: 0;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--m-accent);
  background: var(--m-accent-soft);
  border: 1px solid var(--m-accent-border);
  border-radius: 6px;
  cursor: pointer;
}

.m-dev-filter-action:active {
  filter: brightness(0.95);
}

/* Status filter chips */
.m-status-filter {
  padding: 12px 14px;
}

.m-status-filter-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.m-status-filter-head .m-label {
  margin: 0;
  flex-shrink: 0;
}

.m-status-filter-summary {
  flex: 1;
  min-width: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--m-accent);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-status-filter-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.m-status-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.m-status-chip {
  margin: 0;
  padding: 7px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.m-status-chip:focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: 2px;
}

.m-status-chip.is-active.m-status-chip--planned {
  background: var(--m-planned-soft);
  color: var(--m-planned);
  border-color: transparent;
}

.m-status-chip.is-active.m-status-chip--undecided {
  background: var(--bg-muted);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.m-status-chip.is-active.m-status-chip--progress {
  background: var(--m-accent-soft);
  color: var(--m-accent);
  border-color: transparent;
}

.m-status-chip.is-active.m-status-chip--done {
  background: var(--m-muted-soft);
  color: var(--m-muted);
  border-color: transparent;
}

.m-dev-tree-wrap {
  max-height: min(36vh, 280px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
}

.m-dev-tree {
  padding: 6px 0;
}

.m-dev-tree-empty {
  margin: 0;
  padding: 20px 12px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.m-dev-tree-team-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 6px 4px;
}

.m-dev-tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.m-dev-tree-team.is-open .m-dev-tree-toggle {
  transform: rotate(90deg);
}

.m-dev-tree-toggle:active {
  background: var(--bg-muted);
}

.m-dev-tree-team-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.m-dev-tree-team-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-dev-tree-team-count {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  color: var(--m-accent);
  background: var(--m-accent-soft);
  border-radius: 999px;
}

.m-dev-tree-members {
  list-style: none;
  margin: 0;
  padding: 0 8px 4px 36px;
  display: none;
}

.m-dev-tree-team.is-open .m-dev-tree-members {
  display: block;
}

.m-dev-tree-member {
  margin: 0;
}

.m-dev-tree-member-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: background 0.12s ease;
}

.m-dev-tree-member-label:active {
  background: var(--bg-muted);
}

.m-dev-tree-member-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-dev-tree-team-label input[type="checkbox"],
.m-dev-tree-member-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--m-accent);
}

.m-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 8px;
}

.m-board-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-board-icon {
  display: flex;
  color: var(--m-accent);
}

.m-board-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.m-board-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--m-accent);
  background: var(--m-accent-soft);
  border-radius: 999px;
}

/* Detail header */
.m-detail-header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px 14px;
  background: var(--m-header-bg);
  border-bottom: 1px solid var(--border);
}

.m-detail-header-text {
  min-width: 0;
  flex: 1;
  padding-top: 2px;
}

.m-detail-breadcrumb {
  margin: 0 0 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--m-accent);
}

.m-topbar-title--detail {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-topbar-sub {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  padding: 0 16px 28px;
}

.m-content--detail {
  padding-top: 8px;
}

.m-section-label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.m-section-label-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.m-section-count {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--m-accent);
  background: var(--m-accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
}

/* Project cards */
.m-product-list,
.m-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m-product-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: left;
  font-family: inherit;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--m-card-radius);
  box-shadow: var(--m-shadow-sm);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.m-product-card:active {
  transform: scale(0.99);
  box-shadow: var(--m-shadow-md);
}

.m-product-card:focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: 2px;
}

.m-product-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--border-strong);
}

.m-product-card--progress .m-product-card-accent {
  background: var(--m-accent);
}

.m-product-card--planned .m-product-card-accent {
  background: var(--m-planned);
}

.m-product-card--done .m-product-card-accent {
  background: var(--m-muted);
}

.m-product-card-body {
  padding: 14px 14px 14px 16px;
}

.m-product-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.m-product-card-title {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.02em;
}

.m-product-card-chevron {
  flex-shrink: 0;
  display: flex;
  color: var(--text-muted);
  opacity: 0.6;
}

.m-product-card-badges {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
}

.m-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 6px;
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.m-badge--progress {
  background: var(--m-accent-soft);
  color: var(--m-accent);
}

.m-badge--done {
  background: var(--m-muted-soft);
  color: var(--m-muted);
}

.m-badge--planned {
  background: var(--m-planned-soft);
  color: var(--m-planned);
}

.m-badge--undecided {
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.m-badge--custom {
  background: color-mix(in srgb, var(--m-accent) 12%, var(--bg-muted));
  color: var(--m-accent);
}

html[data-theme="dark"] .m-badge--planned {
  color: #c4b5fd;
}

.m-product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.m-avatar-stack {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.m-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: -6px;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
  background: hsl(var(--m-avatar-hue, 230), 55%, 48%);
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
}

.m-avatar:first-child {
  margin-left: 0;
}

.m-avatar--more {
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 0.5625rem;
}

.m-product-card-devs-label {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-product-card-dates {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.m-product-card-dates svg {
  opacity: 0.55;
}

/* Task cards */
.m-task-card {
  position: relative;
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--m-card-radius);
  overflow: hidden;
  box-shadow: var(--m-shadow-sm);
}

.m-task-card-accent {
  width: 3px;
  flex-shrink: 0;
  background: var(--border-strong);
}

.m-task-card--progress .m-task-card-accent {
  background: var(--m-accent);
}

.m-task-card--planned .m-task-card-accent {
  background: var(--m-planned);
}

.m-task-card--done .m-task-card-accent {
  background: var(--m-muted);
}

.m-task-card-body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
}

.m-task-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.m-task-card-title-wrap {
  flex: 1;
  min-width: 0;
}

.m-task-card-id {
  display: block;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.m-task-card-name {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.m-task-card-dev {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.m-task-card--loading .m-task-card-body {
  padding: 20px 16px;
  text-align: center;
}

.m-task-card--custom .m-task-card-accent {
  background: var(--m-accent);
}

.m-task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
  padding: 10px 0 0;
  border-top: 1px dashed var(--border);
}

.m-task-grid-item {
  min-width: 0;
}

.m-task-grid-item dt {
  margin: 0 0 3px;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.m-task-grid-item dd {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.m-task-grid-item--time dd {
  color: var(--m-accent);
  font-weight: 700;
}

/* Empty state */
.m-empty-state[hidden],
.m-product-list[hidden] {
  display: none !important;
}

.m-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px 32px;
  min-height: 45vh;
}

.m-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: var(--m-accent-soft);
  color: var(--m-accent);
}

.m-empty-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.m-empty-desc {
  margin: 0 0 24px;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 280px;
}

.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.12s ease, background 0.15s ease;
}

.m-btn:active {
  transform: scale(0.98);
}

.m-btn--primary {
  background: var(--m-accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--m-accent-border);
}

html[data-theme="dark"] .m-btn--primary {
  color: #0f172a;
}

.m-btn--primary:active {
  filter: brightness(1.08);
}

.m-btn--block {
  width: 100%;
}

.m-btn--ghost {
  margin-top: 8px;
  background: transparent;
  color: var(--m-accent);
  border: 1px solid var(--m-accent-border);
}

.m-btn--ghost:active {
  background: var(--m-accent-soft);
}

.m-data-info-text {
  margin: 6px 0 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.m-data-info .m-hint a {
  color: var(--m-accent);
  text-decoration: none;
}

.m-data-info .m-hint a:hover {
  text-decoration: underline;
}

.m-data-info .m-hint code {
  font-size: 11px;
}

.m-panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--m-card-radius);
  background: var(--bg-surface);
  box-shadow: var(--m-shadow-sm);
}

.m-card {
  background: var(--bg-surface);
  border-color: var(--border);
}

.m-btn:focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: 2px;
}

.m-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.m-sheet-root.is-open {
  pointer-events: auto;
}

.m-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  opacity: 0;
  transition: opacity 0.28s ease;
}

html[data-theme="dark"] .m-sheet-backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.m-sheet-root.is-open .m-sheet-backdrop {
  opacity: 1;
}

.m-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.2);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.m-sheet-root.is-open .m-sheet {
  transform: translateY(0);
}

.m-sheet-handle {
  width: 36px;
  height: 4px;
  margin: 10px auto 4px;
  border-radius: 999px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.m-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 12px 12px 20px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.m-sheet-kicker {
  margin: 0 0 2px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--m-accent);
}

.m-sheet-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.m-sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px;
}

.m-sheet-footer {
  flex-shrink: 0;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface-2);
}

.m-field {
  margin-bottom: 16px;
}

.m-field:last-child {
  margin-bottom: 0;
}

.m-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.m-hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.m-segment {
  display: flex;
  gap: 0;
  padding: 3px;
  margin-bottom: 12px;
  background: var(--bg-muted);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.m-segment--row {
  display: flex;
  flex-direction: row;
  gap: 3px;
}

.m-segment--row .m-segment-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  padding: 0 4px;
  font-size: 0.6875rem;
}

.m-label--sub {
  margin-top: 4px;
}

.m-segment-btn {
  flex: 1;
  min-height: 36px;
  margin: 0;
  padding: 0 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.m-segment-btn.is-active {
  background: var(--bg-surface);
  color: var(--m-accent);
  box-shadow: var(--m-shadow-sm);
}

.m-segment-btn:focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: 1px;
}

.m-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.m-date-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.m-date-field input[type="date"] {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
}

.m-date-field input[type="date"]:focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: 1px;
  border-color: var(--m-accent);
}

@media (prefers-reduced-motion: reduce) {
  .m-view--detail,
  .m-sheet,
  .m-sheet-backdrop {
    transition: none;
  }
}

/* ── index.html: Developer 계정 관리 (legacy aliases) ── */
.user-admin-form {
  margin: 0;
}
.user-admin-message.is-error {
  color: #b91c1c;
}
.user-admin-message.is-success {
  color: #047857;
}
.user-admin-table-wrap {
  margin: 0;
}
.user-admin-empty[hidden] {
  display: none;
}

/* Product 개발 목록 — 추가·편집·삭제 */
.product-table-col-actions {
  white-space: nowrap;
  width: 1%;
}
.product-table-col-actions .btn-product-edit,
.product-table-col-actions .btn-product-delete {
  font-size: 12px;
  padding: 5px 10px;
  margin: 0 3px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.product-table-col-actions .btn-product-edit:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.product-table-col-actions .btn-product-delete:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}
.product-form-dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  max-width: min(780px, calc(100vw - 32px));
  background: var(--bg-surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
}
.product-form-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.product-form-dialog--dynamic {
  margin-top: calc(var(--product-form-stack-offset, 0px));
  margin-left: calc(var(--product-form-stack-offset, 0px));
}
.product-form-dialog--dynamic[data-edit-index="2"] {
  --product-form-stack-offset: 12px;
}
.product-form-dialog--dynamic[data-edit-index="3"] {
  --product-form-stack-offset: 24px;
}
.product-form-dialog--dynamic[data-edit-index="4"] {
  --product-form-stack-offset: 36px;
}
.product-form-dialog--dynamic[data-edit-index="5"] {
  --product-form-stack-offset: 48px;
}
.product-form {
  padding: 0;
}
.product-form-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-surface-2), var(--bg-surface));
}
.product-form-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.product-form-subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.product-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 20px 24px 0;
  --product-form-control-h: 29px;
}
.product-form-grid .control-group {
  margin-bottom: 0;
}
.product-form-grid .control-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.product-form-grid .control-group--full {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}
.product-form-grid .control-group input[type="text"],
.product-form-grid .control-group input[type="date"],
.product-form-grid .control-group select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--product-form-control-h);
  height: var(--product-form-control-h);
  padding: 0 12px;
  font-size: 13px;
  line-height: 1.2;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 8px;
}
.product-form-grid .control-group select {
  padding-right: 32px;
  cursor: pointer;
}
.product-form-grid .control-group input[type="date"] {
  padding-right: 10px;
}
.product-form-grid .control-group input[type="text"]:focus-visible,
.product-form-grid .control-group input[type="date"]:focus-visible,
.product-form-grid .control-group select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.product-form-grid #productFormId[readonly] {
  background: color-mix(in srgb, var(--bg-surface) 88%, var(--text) 4%);
  cursor: default;
}
.product-form-message.is-error {
  color: var(--danger, #c0392b);
}
.product-form-message.is-success {
  color: var(--success, #2e7d32);
}
.product-form-actions {
  margin-top: 16px;
  padding: 0 24px 22px;
}
.product-form-message {
  margin: 12px 24px 0;
}
.btn-sample-csv-download {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.btn-sample-csv-download:hover {
  background: var(--bg-surface);
}
.collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 4px 2px 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.collapsible-head span:last-child {
  color: var(--accent);
  font-size: 12px;
}

@media (max-width: 1200px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-top-bar {
    flex-direction: column;
    min-height: 0;
  }
  .app-top-bar-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .app-top-bar-main {
    flex-direction: column;
  }
  .app-header-actions {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 10px 16px;
    justify-content: flex-end;
  }
  .app-body { flex-direction: column; }
  .admin-tab-panel.is-active { flex-direction: column; }
  .admin-tabs {
    overflow-x: auto;
    padding: 0 12px;
    width: 100%;
  }
  .admin-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    min-height: 34px;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: min(52vh, 480px);
  }
  .date-row-dual {
    flex-direction: column;
  }
  .date-field {
    flex: none;
    width: 100%;
  }
  .line-chart-canvas-wrap { height: 220px; }
}

@media (max-width: 560px) {
  .product-form-grid {
    grid-template-columns: 1fr;
  }
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
}

#userAdminSection.is-highlight {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ── taskmgr.html: Developer Task Manager ── */
body.tm-app {
  overflow: hidden;
}

.m-shell--taskmgr {
  display: flex;
  flex-direction: column;
}

.m-shell--taskmgr > .m-workspace-header {
  position: relative;
  flex-shrink: 0;
}

.m-shell--taskmgr > .tm-view {
  position: relative;
  inset: auto;
  flex: 1;
  min-height: 0;
}

body.tm-app .tm-view[hidden] {
  display: none !important;
}

.tm-login-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.tm-login-form {
  max-width: 420px;
  margin: 0 auto;
  padding: 20px 16px;
}

.tm-login-title {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 700;
}

.tm-login-desc {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.tm-login-error {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: #b91c1c;
}

.tm-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.tm-tab {
  flex: 1;
  margin: 0;
  padding: 10px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}

.tm-tab.is-active {
  color: var(--m-accent);
  background: var(--m-accent-soft);
  border-color: var(--m-accent-border);
}

.tm-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 24px;
}

.tm-section {
  margin-bottom: 12px;
}

.tm-section-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

.tm-section-subtitle {
  margin: 0 0 10px;
  font-size: 0.875rem;
  font-weight: 600;
}

.tm-section-desc {
  margin: -6px 0 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.tm-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.tm-calendar-section {
  padding: 10px 10px 8px;
}

.tm-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.tm-calendar-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
}

.tm-calendar-nav {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
}

.tm-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 2px;
}

.tm-calendar-weekdays span {
  text-align: center;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0;
  line-height: 1.4;
}

.tm-calendar-weekdays span:first-child {
  color: #dc2626;
}

.tm-calendar-weekdays span:last-child {
  color: #2563eb;
}

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

.tm-calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 36px;
  margin: 0;
  padding: 2px 1px 3px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tm-calendar-day.is-holiday-national:not(.is-selected) {
  background: #eff6ff;
  border-color: #93c5fd;
}

.tm-calendar-day.is-holiday-public:not(.is-selected) {
  background: #fef3c7;
  border-color: #fcd34d;
}

html[data-theme="dark"] .tm-calendar-day.is-holiday-national:not(.is-selected) {
  background: rgba(30, 58, 138, 0.35);
  border-color: #3b82f6;
}

html[data-theme="dark"] .tm-calendar-day.is-holiday-public:not(.is-selected) {
  background: rgba(245, 158, 11, 0.16);
  border-color: #f59e0b;
}

.tm-calendar-day.is-other-month {
  color: var(--text-muted);
  opacity: 0.45;
}

.tm-calendar-day.is-today:not(.is-selected) {
  border-color: var(--m-accent-border);
  background: var(--m-accent-soft);
}

.tm-calendar-day.is-selected {
  color: #fff;
  background: var(--m-accent);
  border-color: var(--m-accent);
  box-shadow: 0 1px 4px var(--m-accent-border);
}

.tm-calendar-day.is-selected .tm-calendar-day-hours {
  color: rgba(255, 255, 255, 0.92);
}

.tm-calendar-day.has-log:not(.is-selected) {
  font-weight: 700;
}

.tm-calendar-day-num {
  line-height: 1;
}

.tm-calendar-day-hours {
  font-size: 0.5625rem;
  font-weight: 600;
  line-height: 1;
  color: var(--m-accent);
}

.tm-calendar-day-holiday {
  display: block;
  max-width: 100%;
  padding: 0 1px;
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-calendar-day.is-holiday-national:not(.is-selected) .tm-calendar-day-holiday {
  color: #1d4ed8;
}

.tm-calendar-day.is-holiday-public:not(.is-selected) .tm-calendar-day-holiday {
  color: #b45309;
}

.tm-calendar-day.is-selected .tm-calendar-day-holiday {
  color: rgba(255, 255, 255, 0.92);
}

.tm-calendar-day.is-other-month .tm-calendar-day-hours,
.tm-calendar-day.is-other-month .tm-calendar-day-holiday {
  opacity: 0.75;
}

.tm-calendar-day:focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: 1px;
}

.tm-calendar-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.tm-calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--text-muted);
}

.tm-calendar-legend-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tm-calendar-legend-item--logged::before {
  background: var(--m-accent);
}

.tm-calendar-legend-item--empty::before {
  background: var(--border-strong);
}

.tm-calendar-legend-item--national::before {
  background: #93c5fd;
}

.tm-calendar-legend-item--public::before {
  background: #fcd34d;
}

.tm-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;
}

.tm-planner-table-wrap {
  --tm-planner-row-height: calc(32px * 1.2);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  overflow-x: hidden;
}

.tm-planner-table thead th {
  padding: 6px 8px;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
}

.tm-planner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.tm-planner-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.tm-planner-row td {
  height: var(--tm-planner-row-height, calc(32px * 1.2));
  max-height: var(--tm-planner-row-height, calc(32px * 1.2));
  padding: 0 8px;
  line-height: 1.2;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  box-sizing: border-box;
}

.tm-planner-row.is-empty .tm-planner-icon-btn,
.tm-planner-row.has-log .tm-planner-icon-btn {
  width: 28px;
  height: 28px;
  min-height: 28px;
}

.tm-planner-row.is-empty .tm-planner-col-check input,
.tm-planner-row.has-log .tm-planner-col-check input {
  width: 16px;
  height: 16px;
}

.tm-planner-row:active {
  background: var(--bg-muted);
}

.tm-planner-row.is-selected {
  background: var(--m-accent-soft);
}

.tm-planner-row.has-log .tm-planner-col-summary {
  color: var(--text);
  font-weight: 500;
}

.tm-planner-row.is-lunch td {
  background: color-mix(in srgb, var(--m-warning) 12%, var(--bg-surface));
}

.tm-planner-row.is-lunch.is-selected td {
  background: color-mix(in srgb, var(--m-warning) 18%, var(--m-accent-soft));
}

.tm-planner-row.is-lunch .tm-planner-time-main {
  color: var(--m-warning);
}

.tm-planner-row:last-child td {
  border-bottom: none;
}

.tm-planner-col-check {
  width: 40px;
  text-align: center;
  vertical-align: middle;
}

.tm-planner-col-time {
  width: 88px;
  white-space: nowrap;
  vertical-align: middle;
}

.tm-planner-col-actions {
  width: 76px;
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

.tm-planner-time-main {
  display: inline;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--m-accent);
}

.tm-planner-col-summary {
  color: var(--text-muted);
  line-height: 1.2;
  vertical-align: middle;
  overflow: hidden;
}

.tm-planner-product-text {
  display: block;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-planner-empty {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.tm-planner-row-actions {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
  align-items: center;
}

.tm-planner-icon-btn {
  width: 28px;
  height: 28px;
  min-height: 28px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.tm-planner-icon-btn.tm-planner-edit {
  color: var(--m-accent);
}

.tm-planner-icon-btn.tm-planner-delete {
  color: #b91c1c;
}

html[data-theme="dark"] .tm-planner-icon-btn.tm-planner-delete {
  color: #fca5a5;
}

.tm-planner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.tm-planner-delete-selected {
  color: #dc2626;
}

.tm-planner-delete-selected:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

html[data-theme="dark"] .tm-planner-delete-selected {
  color: #fca5a5;
}

.tm-percent-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 0.8125rem;
}

.tm-percent-bar[data-state="ok"] {
  border-color: rgba(5, 150, 105, 0.35);
  background: var(--m-success-soft);
}

.tm-percent-bar[data-state="ok"] .tm-percent-bar-value {
  color: var(--m-success);
}

.tm-percent-bar[data-state="warn"] {
  border-color: rgba(217, 119, 6, 0.35);
  background: var(--m-warning-soft);
}

.tm-percent-bar[data-state="warn"] .tm-percent-bar-value {
  color: var(--m-warning);
}

.tm-percent-bar-label {
  color: var(--text-muted);
  font-weight: 600;
}

.tm-percent-bar-value strong {
  font-size: 1.125rem;
}

.tm-select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
}

.tm-select:focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: 1px;
  border-color: var(--m-accent);
}

.tm-task-group {
  margin-bottom: 12px;
}

.tm-task-group-title {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--m-accent);
}

.tm-task-pick-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tm-task-pick-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  margin-bottom: 8px;
  overflow: hidden;
}

.tm-task-pick-item.is-selected {
  border-color: var(--m-accent-border);
  box-shadow: var(--m-shadow-sm);
}

.tm-task-pick-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
}

.tm-task-pick-name {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
}

.tm-task-badge {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--m-muted-soft);
  color: var(--m-muted);
}

.tm-task-badge--custom {
  background: var(--m-accent-soft);
  color: var(--m-accent);
}

.tm-percent-fixed {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--m-success);
}

.tm-task-percent--fixed {
  opacity: 0.95;
}

.tm-task-percent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 12px 36px;
}

.tm-task-percent label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tm-percent-input {
  width: 72px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.875rem;
  text-align: right;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
}

.tm-task-minutes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 12px 36px;
}

.tm-task-minutes label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tm-minutes-input {
  width: 88px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.875rem;
  text-align: right;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
}

.tm-save-btn {
  margin-top: 12px;
}

.tm-empty {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tm-timeline {
  display: grid;
  gap: 10px;
}

.tm-timeline-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  padding: 12px;
  box-shadow: var(--m-shadow-sm);
}

.tm-timeline-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tm-timeline-slot {
  font-size: 1rem;
  font-weight: 700;
  color: var(--m-accent);
}

.tm-timeline-actions {
  display: flex;
  gap: 8px;
}

.tm-link-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--m-accent);
  cursor: pointer;
}

.tm-timeline-tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.tm-timeline-task {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-muted);
}

.tm-timeline-task-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}

.tm-timeline-task-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tm-inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.tm-inline-field {
  margin: 0;
}

.tm-custom-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tm-custom-field {
  margin-bottom: 12px;
}

.tm-custom-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.tm-custom-select,
.tm-custom-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  box-sizing: border-box;
}

.tm-custom-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.tm-custom-input:focus-visible,
.tm-custom-select:focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: 1px;
  border-color: var(--m-accent);
}

.tm-custom-task-lists {
  display: grid;
  gap: 16px;
  margin: 8px 0 16px;
}

.tm-custom-task-group {
  display: grid;
  gap: 8px;
}

.tm-custom-group-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--m-accent);
}

.tm-custom-empty {
  margin: 0;
}

.tm-custom-form {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tm-custom-submit {
  min-height: 48px;
  font-size: 1rem;
}

.tm-custom-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.tm-custom-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  min-height: 48px;
  box-sizing: border-box;
}

.tm-custom-task-item--system {
  background: var(--bg-muted);
}

.tm-custom-task-name {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

.tm-delete-custom {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

/* ── Mobile & Taskmgr: Collaboration UI refresh ── */
body.m-collab .m-shell {
  background: var(--bg-page);
}

body.m-collab .m-content {
  padding: 8px 16px 32px;
}

.m-toolbar--sticky {
  position: sticky;
  top: 0;
  z-index: 15;
  padding-top: 8px;
  background: linear-gradient(to bottom, var(--bg-page) 75%, transparent);
}

.m-board-header-text {
  min-width: 0;
}

.m-board-subtitle {
  margin: 2px 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
}

.m-board-header--sticky {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 0 -2px;
  padding: 10px 4px 12px;
  background: var(--m-header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.m-search-input {
  height: var(--m-touch);
  padding: 0 14px 0 40px;
  font-size: 0.9375rem;
  border-radius: 12px;
}

.m-search-bar--compact .m-search-input {
  height: 42px;
  font-size: 0.875rem;
}

.m-product-list,
.m-task-list {
  gap: 10px;
}

.m-product-card {
  border-radius: var(--m-card-radius);
  box-shadow: var(--m-shadow-sm);
  border-color: var(--border);
}

.m-product-card-body {
  padding: 16px 16px 16px 18px;
}

.m-product-card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.m-product-card-accent {
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.m-task-card {
  border-radius: var(--m-card-radius);
  border-color: var(--border);
}

.m-task-card-body {
  padding: 14px 16px;
}

.m-task-card-name {
  font-size: 0.9375rem;
}

.m-detail-header {
  -webkit-backdrop-filter: var(--m-header-blur);
  backdrop-filter: var(--m-header-blur);
  background: var(--m-header-bg);
}

.m-section-label {
  padding: 10px 20px 12px;
}

.m-empty-state {
  padding: 56px 24px 40px;
}

.m-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  box-shadow: var(--m-shadow-sm);
}

.m-sheet {
  border-radius: 20px 20px 0 0;
  box-shadow: var(--m-shadow-lg);
}

.m-sheet-body .m-panel {
  background: var(--bg-surface-2);
}

.m-segment {
  border-radius: 12px;
  padding: 4px;
}

.m-segment-btn {
  min-height: 40px;
  border-radius: 9px;
}

.m-segment-btn.is-active {
  background: var(--bg-surface);
  box-shadow: var(--m-shadow-sm);
  color: var(--m-accent);
}

.m-status-chip {
  min-height: 36px;
  padding: 8px 16px;
  font-size: 0.8125rem;
}

.m-badge {
  padding: 4px 10px;
  font-size: 0.6875rem;
  border-radius: 999px;
}

.m-btn {
  min-height: var(--m-touch);
  border-radius: 12px;
  font-size: 0.9375rem;
}

.m-btn--ghost {
  margin-top: 0;
  min-height: 44px;
}

/* Shared form controls (mobile-app) */
body.mobile-app .m-field label,
body.mobile-app .tm-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
}

body.mobile-app .m-field input:not([type="checkbox"]):not([type="radio"]):not([type="date"]),
body.mobile-app .tm-input,
body.mobile-app .tm-custom-input {
  width: 100%;
  min-height: var(--m-touch);
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.mobile-app .m-field input:focus-visible,
body.mobile-app .tm-input:focus-visible {
  outline: none;
  border-color: var(--m-accent);
  box-shadow: 0 0 0 3px var(--m-accent-soft);
}

/* Taskmgr */
body.tm-app .tm-view {
  display: flex;
  flex-direction: column;
}

.tm-login-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 16px 32px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--m-accent-soft), transparent 60%),
    var(--bg-page);
}

.tm-login-card {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 24px;
  border-radius: 20px;
  box-shadow: var(--m-shadow-md);
  text-align: center;
}

.tm-login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--m-accent-soft);
  color: var(--m-accent);
}

.tm-login-card .tm-field {
  text-align: left;
}

.tm-login-title {
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.tm-login-desc {
  margin-bottom: 20px;
}

.tm-tabs--pill {
  gap: 8px;
  padding: 10px 16px 12px;
  background: var(--bg-page);
  border-bottom: none;
  flex-shrink: 0;
}

.tm-tabs--pill .tm-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.875rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tm-tabs--pill .tm-tab svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.tm-tabs--pill .tm-tab[hidden] {
  display: none !important;
}

.tm-tabs--pill .tm-tab.is-active {
  background: var(--bg-surface);
  border-color: var(--m-accent-border);
  box-shadow: var(--m-shadow-sm);
  color: var(--m-accent);
}

.tm-content {
  padding: 12px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tm-section {
  margin-bottom: 12px;
}

.tm-section-title {
  font-size: 1.0625rem;
  letter-spacing: -0.025em;
}

.tm-planner-section {
  padding: 12px;
}

.tm-planner-table-wrap {
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--border);
}

.tm-planner-row.is-selected {
  box-shadow: inset 3px 0 0 var(--m-accent);
}

.tm-planner-actions .m-btn--ghost {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
}

.tm-percent-bar {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.tm-percent-bar[data-state="ok"] {
  background: var(--m-success-soft);
  border-color: var(--m-success-border);
}

.tm-percent-bar[data-state="warn"] {
  background: var(--m-warning-soft);
  border-color: var(--m-warning-border);
}

.tm-task-pick-item {
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: var(--m-shadow-sm);
}

.tm-save-btn {
  margin-top: 4px;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 4px 14px var(--m-accent-border);
}

.tm-custom-panel {
  padding: 18px 16px;
}

.tm-custom-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
}

.tm-custom-group-title::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: var(--m-accent);
}

.tm-custom-task-item {
  border-radius: 14px;
  box-shadow: var(--m-shadow-sm);
}

.tm-custom-task-item--custom {
  border-color: var(--m-accent-border);
}

.tm-custom-form {
  padding-top: 18px;
  margin-top: 4px;
}

@media (min-width: 480px) {
  body.m-collab .m-content,
  body.tm-app .tm-content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .tm-login-card {
    padding: 32px 28px 28px;
  }
}

/* HR admin page — match accounts/holidays layout */
.admin-hr-page {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.admin-hr-page.admin-page-content {
  padding: 14px 20px 24px;
  gap: 16px;
}

.admin-hr-stats {
  margin-bottom: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-hr-form {
  margin: 0 0 16px;
}

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

.admin-hr-message {
  margin: 12px 0 0;
}

.admin-accounts-list-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.admin-hr-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-hr-insight-card {
  overflow: hidden;
}

.admin-hr-insight-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-hr-insight-toolbar .admin-system-title {
  margin: 0;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.admin-hr-insight-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-hr-insight-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-hr-segment {
  flex: 0 0 auto;
  margin-bottom: 0;
  padding: 3px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.admin-hr-segment .m-segment-btn {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-hr-segment .m-segment-btn.is-active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.admin-hr-insight-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.admin-hr-date-sep {
  flex-shrink: 0;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-hr-date-input {
  min-width: 128px;
  min-height: 36px;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.admin-hr-date-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.admin-hr-query-btn {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-hr-absence-dates {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.admin-hr-absence-form-grid .admin-hr-absence-dev-group,
.admin-hr-absence-form-grid .admin-hr-absence-period-group {
  grid-column: 1 / -1;
}

.admin-hr-absence-dates .admin-toolbar-date-input {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

.admin-hr-absence-period-group .admin-hr-date-sep {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-hr-insight-card .admin-accounts-table-wrap {
  margin-top: 4px;
}

.admin-hr-insight-card .admin-accounts-table th:nth-child(5),
.admin-hr-insight-card .admin-accounts-table th:nth-child(6) {
  min-width: 72px;
}

.admin-hr-insight-card .admin-accounts-table th:last-child {
  min-width: 220px;
}

.hr-insight-util-cell {
  white-space: nowrap;
  text-align: right;
}

.hr-insight-util {
  display: inline-block;
  min-width: 44px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hr-insight-status-cell {
  min-width: 200px;
  max-width: 420px;
}

.hr-insight-status {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hr-insight-status-text--bad {
  color: var(--color-danger, #dc2626);
}

.hr-insight-status-text--warn {
  color: var(--color-warning, #d97706);
}

.hr-insight-status--none {
  color: var(--text-muted);
}

.hr-insight-status-sep {
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .admin-hr-insight-controls {
    gap: 8px;
  }

  .admin-hr-insight-presets,
  .admin-hr-insight-dates,
  .admin-hr-query-btn {
    flex: 1 1 auto;
  }

  .admin-hr-query-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .admin-hr-segment .m-segment-btn {
    padding: 0 9px;
    font-size: 11px;
  }

  .admin-hr-date-input {
    min-width: 0;
    width: 100%;
  }

  .admin-hr-insight-dates {
    width: 100%;
  }
}

.admin-hr-weeks-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.admin-toolbar-date-input,
.admin-toolbar-number-input,
.admin-form-select {
  min-width: 112px;
  min-height: 36px;
  padding: 7px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  box-sizing: border-box;
}

.admin-toolbar-number-input {
  min-width: 72px;
  width: 72px;
}

.admin-toolbar-date-input:focus-visible,
.admin-toolbar-number-input:focus-visible,
.admin-form-select:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 1px;
  border-color: var(--accent);
}

.admin-accounts-form-grid--full {
  grid-column: 1 / -1;
}

.admin-accounts-form-grid .control-group textarea,
.admin-accounts-form-grid .control-group select,
.admin-accounts-form-grid .control-group input[type="number"],
.admin-accounts-form-grid .control-group input[type="date"],
.admin-hr-page select {
  width: 100%;
  min-height: 36px;
  padding: 7px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  box-sizing: border-box;
}

.admin-accounts-form-grid .control-group textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

.admin-hr-page .admin-accounts-table {
  font-size: 12px;
  line-height: 1.3;
}

.admin-hr-page .admin-accounts-table th,
.admin-hr-page .admin-accounts-table td {
  padding: 6px 10px;
}

.admin-hr-page .admin-accounts-table th {
  font-size: 11px;
  line-height: 1.25;
  padding-top: 7px;
  padding-bottom: 7px;
}

.admin-hr-page .admin-accounts-table .btn-admin-secondary,
.admin-hr-page .admin-accounts-actions .btn-account-delete {
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.admin-hr-page .admin-accounts-empty {
  margin: 0;
  padding: 10px 12px;
}

@media (max-width: 720px) {
  .admin-hr-stats {
    grid-template-columns: 1fr;
  }

  .admin-hr-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .admin-hr-stats {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] .admin-toolbar-date-input,
html[data-theme="dark"] .admin-toolbar-number-input,
html[data-theme="dark"] .admin-form-select {
  background: var(--input-bg);
  border-color: var(--input-border);
  color: var(--text);
}

.eval-score--good { color: var(--color-success, #16a34a); }
.eval-score--mid { color: var(--color-warning, #d97706); }
.eval-score--low { color: var(--color-danger, #dc2626); }

.hr-alerts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.hr-alert-item {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
  background: color-mix(in srgb, var(--bg-muted) 72%, var(--bg-surface));
  border: 1px solid var(--border);
}

.hr-alert-item--overloaded,
.hr-alert-item--overload {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.hr-alert-item--underutilized,
.hr-alert-item--underload {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.m-bench-ok { color: var(--color-success, #16a34a); font-weight: 600; }
.m-bench-warn { color: var(--color-warning, #d97706); font-weight: 600; }
.m-bench-bad { color: var(--color-danger, #dc2626); font-weight: 600; }

.m-hub-tabs {
  margin-top: 8px;
}

.m-hub-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.m-hub-panel[hidden] {
  display: none !important;
}

.m-hub-panel > .m-board-header--sticky {
  flex-shrink: 0;
  margin: 0 14px;
}

.m-eval-loading {
  margin: 8px 0 0;
}

.m-hr-summary {
  margin-bottom: 12px;
}

.m-hr-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.m-hr-summary-card {
  position: relative;
  padding: 14px 14px 12px 18px;
  border-radius: var(--m-card-radius, 14px);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--m-shadow-sm);
  overflow: hidden;
}

.m-hr-summary-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.m-hr-summary-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.m-hr-summary-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.m-hr-summary-card--bad {
  background: var(--bg-surface);
}

.m-hr-summary-card--bad::before {
  background: #dc2626;
}

.m-hr-summary-card--bad .m-hr-summary-label {
  color: var(--text-secondary);
}

.m-hr-summary-card--bad .m-hr-summary-value {
  color: #dc2626;
}

.m-hr-summary-card--warn {
  background: var(--bg-surface);
}

.m-hr-summary-card--warn::before {
  background: #d97706;
}

.m-hr-summary-card--warn .m-hr-summary-label {
  color: var(--text-secondary);
}

.m-hr-summary-card--warn .m-hr-summary-value {
  color: #d97706;
}

.m-hr-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 360px) {
  .m-hr-list {
    grid-template-columns: 1fr;
  }
}

.m-hr-card {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 0;
  border-radius: var(--m-card-radius, 14px);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--m-shadow-sm);
  overflow: hidden;
}

.m-hr-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--text-muted);
  transition: background 0.35s ease;
}

.m-hr-card-body {
  flex: 1;
  min-width: 0;
  padding: 12px 12px 10px 14px;
}

.m-hr-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.m-hr-card-identity {
  flex: 1;
  min-width: 0;
}

.m-hr-card-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.m-hr-load-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
}

.m-hr-load-value {
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-secondary);
}

.m-hr-load-value.eval-score--good {
  color: var(--color-success, #16a34a);
}

.m-hr-load-value.eval-score--mid {
  color: var(--color-warning, #d97706);
}

.m-hr-load-value.eval-score--low {
  color: var(--color-danger, #dc2626);
}

.m-hr-load-label {
  margin-top: 2px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.m-hr-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
  margin: 0;
}

.m-hr-metrics > div {
  min-width: 0;
}

.m-hr-metrics dt {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.m-hr-metrics dd {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.m-hr-metrics dd.is-bad {
  color: #b91c1c;
}

.m-hr-metrics dd.is-warn {
  color: #b45309;
}

.m-hr-status {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.m-hr-status.is-bad {
  color: #b91c1c;
}

.m-hr-status.is-warn {
  color: #b45309;
}

.m-hr-status.is-empty {
  color: var(--text-muted);
}

.m-eval-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  font-size: 0.875rem;
}

