* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: #f5f6fa;
  color: #1c2333;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.muted { color: #6b7280; }

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  text-align: center;
}

.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card input {
  width: 100%;
  padding: 12px;
  margin: 16px 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 16px;
}

.error-text { color: #e0503c; font-size: 14px; }

.admin-app { max-width: 960px; margin: 0 auto; padding: 0 16px 40px; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}
.admin-header h1 { font-size: 22px; margin: 0; }
.header-actions { display: flex; gap: 8px; }

.admin-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-name-block {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.app-name-sub {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}

.brand-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid #e5e7eb;
}

.login-hero {
  display: block;
  width: calc(100% + 56px);
  margin: -32px -28px 20px;
  height: 180px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
}

.dashboard-footer {
  margin-top: 24px;
}

.footer-hero {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 16px;
}

.link-btn {
  border: none;
  background: none;
  color: #4f8ff7;
  font-weight: 600;
  font-size: 14px;
  margin-top: 14px;
  padding: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 30;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 16px;
  padding: 24px;
  max-width: 380px;
  width: calc(100% - 40px);
  z-index: 31;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal h3 { margin: 0 0 14px; font-size: 18px; }
.modal p { font-size: 14px; margin: 0 0 14px; }
.modal .btn { width: 100%; margin-top: 16px; }

.modal--wide {
  max-width: 460px;
  max-height: 85vh;
  overflow-y: auto;
}

.summary-row {
  font-size: 14px;
  padding: 10px 0;
  border-top: 1px solid #f1f2f5;
}
.summary-row:first-of-type { border-top: none; }
.summary-row ul { margin: 6px 0 0; padding-left: 20px; }
.summary-row li { margin-bottom: 4px; }

.modal input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.modal-actions .btn { width: auto; flex: 1; margin-top: 0; }

.install-steps { margin: 0 0 4px; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.install-steps li { margin-bottom: 6px; }
.install-platform-label { font-weight: 700; font-size: 13px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.03em; margin: 14px 0 6px; }
.install-platform-label:first-child { margin-top: 0; }

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab {
  border: none;
  background: none;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab.active { color: #4f8ff7; border-bottom-color: #4f8ff7; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

.panel-card h2 { margin: 0 0 12px; font-size: 16px; }

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.form-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}

.form-row input, .form-row select {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn--primary { background: #4f8ff7; color: white; }
.btn--secondary { background: #eef0f4; color: #1c2333; }
.btn--small { padding: 9px 14px; font-size: 13px; }
.btn--danger { background: #fdecea; color: #e0503c; }
.btn--danger-solid { background: #e0503c; color: white; }
.btn--danger-solid[disabled] { opacity: 0.5; cursor: not-allowed; }

.cards-list { display: flex; flex-direction: column; gap: 10px; }

.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card-title { font-weight: 700; font-size: 15px; }
.card-meta { font-size: 13px; color: #6b7280; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.badge--active { background: #e6f7ec; color: #2fb865; }
.badge--inactive { background: #f1f2f5; color: #6b7280; }
.badge--warn { background: #fff4e5; color: #b8722f; }

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
}

.link-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12px;
  background: #f5f6fa;
  color: #4b5563;
}

.entry-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.entry-row .entry__icon { font-size: 20px; }
.entry-row .entry__main { flex: 1; min-width: 0; }
.entry-row .entry__title { font-weight: 700; font-size: 14px; }
.entry-row .entry__meta { font-size: 12px; color: #6b7280; }
.entry-row .entry__notes { font-size: 12px; color: #6b7280; margin-top: 2px; }

.shift-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid #f1f2f5;
  font-size: 13px;
}
.shift-row:first-of-type { border-top: none; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding: 8px 0;
  overflow-x: auto;
}

.bar-chart .bar {
  background: #4f8ff7;
  min-width: 10px;
  flex: 1;
  border-radius: 4px 4px 0 0;
  position: relative;
}

.bar-chart-labels {
  display: flex;
  gap: 4px;
  font-size: 10px;
  color: #6b7280;
}
.bar-chart-labels span { flex: 1; text-align: center; min-width: 10px; }

.dist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin: 6px 0;
}
.dist-bar-track {
  flex: 1;
  background: #f1f2f5;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.dist-bar-fill {
  background: #4f8ff7;
  height: 100%;
}
.dist-label { width: 120px; }
.dist-count { width: 30px; text-align: right; color: #6b7280; }

.empty-note { color: #6b7280; font-size: 14px; padding: 12px 0; }

.on-shift-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  border: 1px solid #d6f0de;
  background: #f3fbf5;
}
.on-shift-banner .badge--active { color: #2fb865; background: none; padding: 0; font-size: 13px; }
