/* Worker cabinet — left nav like aloha journal */
body.is-worker,
body.main-page.is-worker {
  background: #f2f2f7 !important;
}
body.is-worker .auth-main,
body.main-page.is-worker .auth-main {
  max-width: none !important;
  width: 100%;
  padding: 0 !important;
  margin: 0 !important;
}
body.is-worker .bg-nav.auth-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.12);
}

.worker-app {
  min-height: calc(100vh - 64px);
}

.worker-layout {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 64px);
}

.worker-sidebar {
  box-sizing: border-box;
  flex: 0 0 260px;
  width: 260px;
  background: #fff;
  border-right: 0.5px solid rgba(60, 60, 67, 0.12);
  padding: 12px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  z-index: 30;
}

.worker-sidebar-brand {
  padding: 10px 12px 16px;
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.1);
  margin-bottom: 10px;
}
.worker-sidebar-brand strong {
  display: block;
  font-size: 0.95rem;
  color: #111827;
}
.worker-sidebar-brand span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: #9ca3af;
}

.worker-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.worker-nav-section {
  margin: 14px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
}

.worker-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.worker-nav-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #111827;
}
.worker-nav-link.is-active {
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
  font-weight: 600;
}
.worker-nav-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.worker-nav-ico img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.75;
}
.worker-nav-link.is-active .worker-nav-ico img {
  opacity: 1;
  filter: invert(36%) sepia(98%) saturate(2477%) hue-rotate(196deg) brightness(101%) contrast(101%);
}

.worker-sidebar-foot {
  padding: 12px;
  border-top: 0.5px solid rgba(60, 60, 67, 0.1);
  font-size: 0.75rem;
  color: #9ca3af;
  word-break: break-all;
}

.worker-main {
  flex: 1;
  min-width: 0;
  padding: 18px 22px 40px;
}

.worker-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.worker-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
}
.worker-menu-btn {
  display: none;
  border: 0;
  background: #fff;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  box-shadow: 0 0 0 0.5px rgba(60, 60, 67, 0.12);
  cursor: pointer;
}

.worker-panel {
  background: #fff;
  border-radius: 16px;
  border: 0.5px solid rgba(60, 60, 67, 0.12);
  padding: 18px 18px 20px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}

.worker-h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

.worker-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.worker-kpi-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px 14px;
  border: 0.5px solid rgba(60, 60, 67, 0.08);
}
.worker-kpi-card span {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 4px;
}
.worker-kpi-card strong {
  font-size: 1.15rem;
  color: #0f172a;
}

.worker-comm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.worker-comm-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 0.5px solid rgba(60, 60, 67, 0.08);
}
.worker-comm-item span {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
}
.worker-comm-sum {
  font-weight: 700;
  white-space: nowrap;
  color: #15803d;
}
.worker-comm-sum.is-neg { color: #b91c1c; }
.worker-comm-sum em {
  font-style: normal;
  font-weight: 500;
  color: #94a3b8;
  font-size: 0.78rem;
}

/* Mail */
.worker-mail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.worker-mail-split {
  display: grid;
  gap: 12px;
}
@media (min-width: 960px) {
  .worker-mail-split { grid-template-columns: 1fr 1.2fr; align-items: start; }
}
.worker-mail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow: auto;
}
.worker-mail-row {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0.5px solid rgba(60, 60, 67, 0.1);
  background: #fff;
  cursor: pointer;
}
.worker-mail-row.is-unread {
  background: rgba(0, 122, 255, 0.06);
  border-color: rgba(0, 122, 255, 0.2);
}
.worker-mail-row strong { font-size: 0.9rem; color: #111827; }
.worker-mail-row span, .worker-mail-row em {
  font-size: 0.78rem;
  color: #64748b;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.worker-mail-read {
  border-radius: 12px;
  border: 0.5px solid rgba(60, 60, 67, 0.1);
  padding: 14px;
  background: #f8fafc;
  min-height: 200px;
}
.worker-mail-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.1);
}
.worker-mail-body {
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.worker-compose {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 0.5px solid rgba(60, 60, 67, 0.1);
}
.worker-compose-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* Sheet */
.worker-sheet-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.worker-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.worker-sheet-hint {
  font-size: 0.78rem;
  color: #94a3b8;
}
.worker-sheet-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 0.5px solid rgba(60, 60, 67, 0.12);
  background: #f1f5f9;
  min-height: 70vh;
}
.worker-sheet-frame iframe {
  width: 100%;
  height: 70vh;
  border: 0;
  background: #fff;
}

/* Calculator */
.worker-calc-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}
.worker-calc-type {
  padding: 10px 14px;
  border-radius: 10px;
  border: 0.5px solid rgba(60, 60, 67, 0.14);
  background: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  color: #374151;
}
.worker-calc-type.is-active {
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
  border-color: rgba(0, 122, 255, 0.25);
}
.worker-calc-type.is-disabled,
.worker-calc-type:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
}
.worker-calc-result {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.worker-calc-result > div {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px;
  border: 0.5px solid rgba(60, 60, 67, 0.08);
}
.worker-calc-result span {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 4px;
}
.worker-calc-result strong {
  font-size: 1.25rem;
  color: #0f172a;
}
.worker-calc-note {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

/* Balance */
.worker-balance-card {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  color: #fff;
  border-radius: 16px;
  padding: 20px 18px;
  margin-bottom: 18px;
}
.worker-balance-card span {
  display: block;
  font-size: 0.85rem;
  opacity: 0.8;
}
.worker-balance-card strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  letter-spacing: -0.03em;
}
.worker-balance-card em {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 0.8rem;
  opacity: 0.7;
}
.worker-withdraw {
  margin-bottom: 20px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 0.5px solid rgba(60, 60, 67, 0.08);
}
.worker-withdraw .auth-field { margin-bottom: 10px; }
.worker-withdraw select,
.worker-withdraw input {
  width: 100%;
}

.worker-sidebar-backdrop {
  display: none;
}

@media (max-width: 960px) {
  .worker-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .worker-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.18);
  }
  body.worker-nav-open .worker-sidebar {
    transform: translateX(0);
  }
  .worker-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 25;
  }
  .worker-sidebar-backdrop[hidden] { display: none !important; }
  .worker-main { padding: 14px 14px 32px; }
}
