:root {
  --ink: #142033;
  --muted: #5b6675;
  --line: #d7dde6;
  --bg: #eef2f6;
  --panel: #fff;
  --accent: #0b5fff;
  --ok: #0f7a4c;
  --bad: #b42318;
  --font: "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); }
.crm-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
aside { background: #0f1b2d; color: #f5f7fb; padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .75rem; font-weight: 700; font-size: 1.1rem; }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand small { display: block; color: rgba(245,247,251,.55); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; margin-top: .1rem; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: .72rem; letter-spacing: -0.04em;
  color: #fff;
  background: linear-gradient(145deg, #F97316, #EA580C 55%, #C2410C);
  box-shadow: 0 8px 20px rgba(234, 88, 12, .35);
  border: 1.5px solid rgba(255,255,255,.35);
  flex-shrink: 0;
}
aside nav { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
aside a { color: #d7e6ff; text-decoration: none; padding: .7rem .8rem; border-radius: 10px; }
aside a:hover { background: rgba(255,255,255,.08); }
.user { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1rem; font-size: .9rem; }
.user button { display: block; margin-top: .5rem; background: transparent; border: 0; color: #9ec1ff; cursor: pointer; }
main { padding: 1.75rem; }
.head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 1rem; }
h1 { margin: 0 0 .25rem; }
p { color: var(--muted); }
table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px rgba(20,32,51,.06); }
th, td { text-align: left; padding: .85rem .9rem; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: middle; }
.pill { padding: .25rem .55rem; border-radius: 999px; background: #e8eef8; font-size: .78rem; font-weight: 700; }
.pill.PendingCrmApproval { background: #fff4db; }
.pill.Trial { background: #e5f7ee; }
.pill.Rejected { background: #fde8e6; }
.actions { display: flex; gap: .4rem; }
.okbtn, .nobtn, .ghost, .login button {
  border: 0; border-radius: 999px; padding: .55rem .9rem; cursor: pointer; font-weight: 600;
}
.okbtn { background: var(--ok); color: white; }
.nobtn { background: var(--bad); color: white; }
.ghost { background: #e4ebf5; }
.login { max-width: 420px; margin: 10vh auto; background: white; padding: 2rem; border-radius: 18px; box-shadow: 0 18px 40px rgba(20,32,51,.08); }
.auth-brand { text-align: center; margin-bottom: 1.35rem; }
.auth-brand .brand-mark { margin: 0 auto .85rem; width: 56px; height: 56px; font-size: .95rem; border-radius: 16px; }
.auth-brand h1 { margin: 0 0 .35rem; font-size: 1.45rem; }
.auth-brand p { margin: 0; color: var(--muted); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.field input { width: 100%; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 10px; }
.login button { width: 100%; background: var(--accent); color: white; padding: .85rem; }
.err { background: #fde8e6; color: var(--bad); padding: .7rem; border-radius: 10px; margin-bottom: 1rem; }
.ok { background: #e5f7ee; padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.hint { font-size: .85rem; color: var(--muted); }
.modal {
  position: fixed; inset: 0; background: rgba(15,27,45,.45);
  display: grid; place-items: center; z-index: 50; padding: 1rem;
}
.modal-card {
  width: min(420px, 100%); background: white; border-radius: 16px;
  padding: 1.25rem; box-shadow: 0 24px 60px rgba(15,27,45,.25);
  display: flex; flex-direction: column; gap: .55rem;
}
.modal-card h2 { margin: 0; }
.modal-card label { font-size: .82rem; color: var(--muted); }
.modal-card input, .modal-card select {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px;
}
select {
  -webkit-appearance: none;
  appearance: none;
  min-height: 2.6rem;
  padding-right: 2.4rem;
  color: var(--ink);
  background-color: #fff;
  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'%3E%3Cpath d='M6.5 9.5L12 15l5.5-5.5' stroke='%230b5fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  background-size: 16px 16px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
select:hover:not(:disabled) { border-color: #9bb7ef; }
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 95, 255, .15);
}
select:disabled { opacity: .55; cursor: not-allowed; }
.modal-card .actions { margin-top: .5rem; }
@media (max-width: 900px) { .crm-shell { grid-template-columns: 1fr; } }
