/* ============================================================
   lp-kit.css — 1:1 replica of LoyaltyPlant CRM styles
   Extracted from /projects/ember (addons/ui, addons/lp-base).
   Reusable prototype kit. Values are the real rendered tokens.
   ============================================================ */

:root {
  /* colors */
  --lp-dark: #1e1b1b;          /* dark bar / sidebar bg (header.scss) */
  --lp-text: #232829;          /* $dark — text/headings */
  --lp-white: #ffffff;
  --lp-primary: #457ce7;       /* $primary */
  --lp-primary-active: #3764ba;
  --lp-primary-disabled: #81afe7;
  --lp-primary-tint: rgba(69,124,231,0.1);
  --lp-link: #457ce7;
  --lp-gray-medium: #72747a;   /* secondary text */
  --lp-gray-light: #d7d9d9;    /* borders */
  --lp-gray-verylight: #f1f1f1;
  --lp-gray-lightest: #fafafa;
  --lp-success: #31ca88;
  --lp-danger: #b72d2a;
  --lp-danger-solid: #fe5000;
  --lp-warning: #ffb300;
  --lp-sidebar-hover: rgba(216,216,216,0.12);

  /* spacing (6px base) */
  --lp-xxxs: 3px; --lp-xxs: 6px; --lp-xs: 12px; --lp-s: 18px;
  --lp-m: 24px; --lp-l: 30px; --lp-xl: 36px;

  --lp-radius: 3px;
  --lp-shadow-float: rgba(149,157,165,0.2) 0 8px 24px;
  --lp-shadow-popover: 0 2px 26px 8px rgba(0,0,0,0.07), 0 3px 9px 5px rgba(0,0,0,0.07);
  --lp-sidebar-w: 255px;
}

* { box-sizing: border-box; }
@keyframes lp-spin { to { transform: rotate(360deg); } }

body {
  margin: 0;
  font-family: 'Montserrat', 'Roboto', Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  color: var(--lp-text);
  background: var(--lp-white);
}

/* ---------- typography ---------- */
.lp-h1 { font-size: 24px; line-height: 36px; font-weight: 900; margin: 0; }
.lp-h2 { font-size: 20px; line-height: 24px; font-weight: 900; margin: 0; }
.lp-h3 { font-size: 16px; line-height: 18px; font-weight: 900; margin: 0; }
.lp-large { font-size: 16px; line-height: 22px; }
.lp-basic { font-size: 14px; line-height: 18px; }
.lp-tiny  { font-size: 12px; line-height: 18px; color: var(--lp-gray-medium); }
.lp-muted { color: var(--lp-gray-medium); }
.lp-label-field { font-weight: 600; font-size: 14px; margin-bottom: var(--lp-xxs); display:block; }

/* ---------- app shell (sidebar redesign) ---------- */
.lp-app { display: flex; min-height: 100vh; }

.lp-sidebar {
  width: var(--lp-sidebar-w);
  flex: 0 0 var(--lp-sidebar-w);
  background: var(--lp-dark);
  display: flex;
  flex-direction: column;
  color: #cfd0d2;
}
.lp-sidebar__logo {
  display: flex; align-items: center; gap: 8px;
  padding: 22px 16px 18px 24px; color: #fff; font-weight: 700; font-size: 18px;
}
.lp-logo-mark { width: 24px; height: 24px; flex: 0 0 24px; }
.lp-sidebar__collapse { margin-left:auto; width:28px;height:28px;border-radius:6px;
  background:#2c2929; color:#9a9a9a; display:flex;align-items:center;justify-content:center; border:none; cursor:pointer;}
.lp-nav { display: flex; flex-direction: column; padding-top: 6px; flex: 1 1 auto; }
.lp-nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px 11px 24px; color: #9a9b9e; cursor: pointer;
  border-left: 3px solid transparent; text-decoration: none; font-size: 14px;
  position: relative; user-select: none;
}
.lp-nav__item .ico { width: 18px; height: 18px; opacity: .85; flex: 0 0 18px; fill: currentColor; }
.lp-nav__item .caret { margin-left: auto; opacity: .55; width: 10px; height: 10px; fill: currentColor; flex: 0 0 10px; }
.lp-nav__item:hover { background: var(--lp-sidebar-hover); color: #dfe0e2; }
.lp-nav__item.is-active { color: #7ea6ef; }
.lp-nav__item.is-active--parent { color: #7ea6ef; }
.lp-nav__item.is-active::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--lp-primary);
}
.lp-nav__sub .lp-nav__item { padding-left: 40px; font-size: 13px; }
.lp-sidebar__user {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px 14px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.lp-sidebar__user .ava { width: 34px; height: 34px; border-radius: 50%; background: #d9d9d9; flex:0 0 34px;}
.lp-sidebar__user .name { color: #fff; font-size: 14px; font-weight: 700; line-height: 1.2; }
.lp-sidebar__user .org { color: #9a9b9e; font-size: 12px; }

/* ---------- content ---------- */
.lp-content { flex: 1 1 auto; padding: 32px; max-width: 100%; overflow-x: hidden; }
.lp-crumb { color: var(--lp-gray-medium); font-size: 12px; margin-bottom: 4px; }
.lp-page-title { margin-bottom: 24px; }
.lp-stack { display: flex; flex-direction: column; gap: 24px; }
.lp-row { display: flex; align-items: center; gap: 16px; }
.lp-spacer { flex: 1 1 auto; }

/* ---------- tabs ---------- */
.lp-tabs { display: flex; border-bottom: 1px solid var(--lp-gray-light); }
.lp-tab {
  padding: 12px 18px; color: var(--lp-link); font-size: 16px; line-height: 22px;
  cursor: pointer; position: relative; background: none; border: none;
}
.lp-tab.is-active { color: var(--lp-text); }
.lp-tab.is-active::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 4px; width: 100%;
  background: var(--lp-primary);
}

/* ---------- buttons ---------- */
.lp-btn {
  border-radius: var(--lp-radius); padding: 12px 24px; font-family: inherit;
  font-size: 16px; border: none; background: transparent; color: var(--lp-primary);
  cursor: pointer; font-weight: 500;
}
.lp-btn--primary { background: var(--lp-primary); color: #fff; }
.lp-btn--primary:hover { background: var(--lp-primary); }
.lp-btn--primary:active { background: var(--lp-primary-active); }
.lp-btn--primary:disabled { background: var(--lp-primary-disabled); cursor: not-allowed; }
.lp-btn--sm { padding: 8px 18px; font-size: 14px; line-height: 14px; }
.lp-btn--danger { background: var(--lp-danger-solid); color: #fff; }
.lp-btn--danger:active { background: #89221f; }
.lp-link { color: var(--lp-link); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }

/* ---------- inputs & selects ---------- */
.lp-input, .lp-select {
  width: 100%; min-height: 34px; line-height: 22px; border-radius: var(--lp-radius);
  border: 1px solid var(--lp-gray-light); color: rgba(49,53,63,.87); background: #fff;
  padding: 8px; font-family: inherit; font-size: 14px;
}
.lp-input:focus, .lp-select:focus { outline: none; border-color: var(--lp-primary); }
.lp-input.is-error, .lp-select.is-error { border-color: var(--lp-danger-solid); background: #fdf3f0; }
.lp-select {
  min-height: 36px; padding-right: 32px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%23457ce7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.lp-field { display: flex; flex-direction: column; }
.lp-field-error { color: var(--lp-danger); font-size: 12px; margin-top: 4px; }

/* ---------- card ---------- */
.lp-card { background: #fff; border: 1px solid var(--lp-gray-light); border-radius: var(--lp-radius); }
.lp-card__pad { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.lp-card__toolbar { display: flex; align-items: center; padding: 16px 20px; gap: 16px; }
.lp-card__section-title { font-weight: 600; font-size: 15px; }

/* ---------- table ---------- */
.lp-table { width: 100%; border-collapse: collapse; background: #fff; }
.lp-table thead th {
  text-align: left; font-weight: 600; font-size: 12px; line-height: 14px; color: var(--lp-gray-medium);
  padding: 10px 16px; border-top: 1px solid var(--lp-gray-light); border-bottom: 1px solid var(--lp-gray-light);
}
.lp-table tbody td { padding: 16px; border-bottom: 1px solid var(--lp-gray-light); vertical-align: middle; }
.lp-table tbody tr:last-child td { border-bottom: none; }
.lp-table .cell-name { color: var(--lp-link); }
.lp-table .row-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.lp-icon-btn { border: none; background: none; cursor: pointer; color: var(--lp-gray-medium); padding: 2px; display:inline-flex; }
.lp-icon-btn:hover { color: var(--lp-text); }
.lp-icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- tag / label ---------- */
.lp-tag {
  display: inline-flex; align-items: center; font-weight: 700; padding: 3px 6px;
  border-radius: var(--lp-radius); font-size: 12px; line-height: 16px; white-space: nowrap;
}
.lp-tag--neutral { background: var(--lp-gray-light); color: var(--lp-text); font-weight: 500; }
.lp-tag--success { background: var(--lp-success); color: #fff; }
.lp-tag--danger  { background: var(--lp-danger); color: #fff; font-weight: 500; }
.lp-tag--warning { background: var(--lp-warning); color: var(--lp-text); font-weight: 500; }
.lp-tag--primary { background: var(--lp-primary); color: #fff; }

/* ---------- checkbox ---------- */
.lp-check { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 16px; }
.lp-check input { display: none; }
.lp-check .box {
  width: 24px; height: 24px; border: 1px solid var(--lp-gray-light); border-radius: var(--lp-radius);
  background: #fff; display: flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 24px;
}
.lp-check input:checked + .box { background: var(--lp-primary); border-color: var(--lp-primary); }
.lp-check input:checked + .box::after { content: "✓"; font-size: 15px; }

/* ---------- vendor tiles ---------- */
.lp-tiles { display: flex; gap: 12px; }
.lp-tile {
  flex: 1; border: 1px solid var(--lp-gray-light); border-radius: var(--lp-radius);
  padding: 20px 16px; text-align: center; font-weight: 600; font-size: 15px; cursor: pointer; background: #fff;
}
.lp-tile.is-selected { border: 2px solid var(--lp-primary); color: var(--lp-primary); }
.lp-tile--dashed { border-style: dashed; }

/* ---------- checklist (activation) ---------- */
.lp-checklist .item { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--lp-gray-light); }
.lp-checklist .item:last-child { border-bottom: none; }
.lp-checklist .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--lp-gray-light); flex:0 0 22px; }
.lp-checklist .dot.done { border: none; background: var(--lp-success); display:flex;align-items:center;justify-content:center;color:#fff; }
.lp-checklist .dot.done svg { width: 13px; height: 13px; fill: #fff; }
.lp-checklist .lbl { font-weight: 600; font-size: 15px; }

/* ---------- empty / block states ---------- */
.lp-empty { padding: 64px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---------- component gallery (shadcn-style) ---------- */
.gx { display: flex; flex-direction: column; gap: 28px; max-width: 900px; }
.gx section { }
.gx h3 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.gx .gx-note { color: var(--lp-gray-medium); font-size: 12px; margin: 0 0 10px; }
.gx .demo { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 20px; border: 1px solid var(--lp-gray-light); border-radius: var(--lp-radius); background: #fff; }
.gx .demo--col { flex-direction: column; align-items: stretch; }
.gx .icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px,1fr)); gap: 8px; width: 100%; }
.gx .icons .ic-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border: 1px solid var(--lp-gray-light); border-radius: var(--lp-radius); font-size: 11px; color: var(--lp-gray-medium); }
.gx .icons .ic-cell svg { width: 22px; height: 22px; fill: var(--lp-text); }

/* ---------- modal overlay ---------- */
.lp-overlay {
  position: fixed; inset: 0; background: rgba(30,27,27,.4); display: none;
  align-items: center; justify-content: center; z-index: 200;
}
.lp-overlay.is-open { display: flex; }
.lp-modal { background: #fff; border-radius: var(--lp-radius); padding: 28px; width: 460px; max-width: 92vw; box-shadow: var(--lp-shadow-popover); }
.lp-modal h3 { margin: 0 0 12px; }
