* { box-sizing: border-box; }
body { margin: 0; }
:root { --brand-primary: #59478a; }
.crm-auth { max-width: 32rem; margin-inline: auto; }
.local-notice {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 0.75rem;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 500;
}
.local-notice.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.local-notice.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.crm-shell {
  background: #f5f7fb;
  min-height: 100vh;
  color: #14203a;
  font-family: system-ui, -apple-system, sans-serif;
}
.crm-header {
  background: white;
  border-bottom: 1px solid #e4e9f1;
  padding: 1rem 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.crm-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: #14203a;
}
.crm-logo img {
  width: 42px;
}
.crm-layout {
  max-width: 1240px;
  margin: auto;
  padding: 2.5rem 1.5rem;
}
.crm-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.crm-subtitle {
  color: #657188;
  margin-bottom: 1.75rem;
}
.crm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
}
.crm-card {
  background: white;
  border: 1px solid #e4e9f1;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 8px 30px #182a4608;
}
.crm-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.crm-card p {
  color: #657188;
  font-size: 0.92rem;
}
.crm-wide {
  grid-column: 1 / -1;
}
.crm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--brand-primary);
  color: white;
  padding: 0.6rem 1.1rem;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.crm-button:hover {
  opacity: 0.92;
}
.crm-button.secondary {
  background: #e2e8f0;
  color: #1e293b;
}
.crm-button.success {
  background: #059669;
  color: white;
}
.crm-button.danger {
  background: #dc2626;
  color: white;
}
.crm-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1.5rem;
}
.crm-step {
  flex: 1;
  border-top: 4px solid #dbe3f1;
  padding-top: 0.75rem;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}
.crm-step.completed {
  border-color: #10b981;
  color: #065f46;
}
.crm-step.active {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 700;
}
.crm-tag {
  display: inline-block;
  background: #eef4ff;
  color: var(--brand-primary);
  padding: 0.25rem 0.65rem;
  border-radius: 1rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.crm-tag.approved, .crm-tag.submitted {
  background: #d1fae5;
  color: #065f46;
}
.crm-tag.uploaded {
  background: #fef3c7;
  color: #92400e;
}
.crm-tag.rejected {
  background: #fee2e2;
  color: #991b1b;
}
.crm-empty {
  padding: 1.2rem 0;
  color: #748096;
  font-size: 0.9rem;
}
.crm-banner {
  border-radius: 0.8rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.crm-input, .crm-select, .crm-textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.92rem;
  margin-top: 0.3rem;
  background: #fff;
  color: #0f172a;
}
.crm-form-group {
  margin-bottom: 0.85rem;
}
.crm-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.crm-list-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 0.85rem;
  background: #f8fafc;
}
.crm-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .crm-grid {
    grid-template-columns: 1fr;
  }
  .crm-steps {
    flex-direction: column;
  }
  .crm-step {
    border-top: 0;
    border-left: 4px solid #dbe3f1;
    padding: 0 0 0 1rem;
  }
}

.crm-dialog {
  width: min(92vw, 26rem);
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  padding: 1.4rem;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}
.crm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(2px);
}
.crm-dialog h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}
.crm-dialog p {
  margin: 0 0 1.15rem;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.45;
}
.crm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

.crm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.crm-tab {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.crm-tab.is-active {
  background: #312961;
  border-color: #312961;
  color: #ffffff;
}
.crm-grid[hidden] {
  display: none !important;
}
.crm-grid {
  align-items: start;
}
.crm-field-label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.crm-code {
  display: block;
  margin-top: 0.45rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.45rem;
  background: #f1f5f9;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  overflow-x: auto;
  white-space: pre;
}
.crm-code--url {
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .crm-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .crm-header-actions {
    justify-content: space-between;
  }
}
