/* ==========================================================================
   Carteo — product identity layer ("Nouvelle ère du networking")
   Loaded last. Gives the app its own look: Sora/Inter/JetBrains Mono type,
   hairline gradient edges, a card-reader background (dot grid + brand glow),
   NFC wave motifs, a floating glass sidebar and restrained motion.
   ========================================================================== */

:root {
  --c-bg: #040506;
  --c-ink: #f3f5f2;
  --c-ink-2: #b9c0bd;
  --c-ink-3: #7c8580;
  --c-surface: rgba(17, 20, 22, 0.72);
  --c-surface-solid: #0e1113;
  --c-surface-2: rgba(255, 255, 255, 0.035);
  --c-line: rgba(255, 255, 255, 0.07);
  --c-line-2: rgba(255, 255, 255, 0.12);
  --c-edge: linear-gradient(150deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 38%, rgba(255, 255, 255, 0.03) 62%, rgba(95, 201, 168, 0.28) 100%);
  --c-glow: 0 0 0 1px rgba(95, 201, 168, 0.25), 0 12px 40px -12px rgba(95, 201, 168, 0.35);
  --c-radius: 18px;
  --c-radius-sm: 12px;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  /* contactless waves, used as a quiet motif */
  --c-nfc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='%235fc9a8' stroke-width='6' stroke-linecap='round'%3E%3Cpath d='M58 58a32 32 0 0 1 0 44' opacity='.9'/%3E%3Cpath d='M78 40a58 58 0 0 1 0 80' opacity='.6'/%3E%3Cpath d='M98 22a84 84 0 0 1 0 116' opacity='.35'/%3E%3C/svg%3E");
  /* keep the earlier tokens in sync */
  --ui-bg: var(--c-bg);
  --ui-surface: var(--c-surface-solid);
  --ui-text: var(--c-ink);
  --ui-text-2: var(--c-ink-2);
  --ui-muted: var(--c-ink-3);
  --ui-border: var(--c-line);
  --ui-border-strong: var(--c-line-2);
  --ui-radius: var(--c-radius);
  --ui-radius-sm: var(--c-radius-sm);
}

/* ---------- Canvas ------------------------------------------------------- */
html, body { font-family: var(--font-text) !important; font-feature-settings: "cv11", "ss01"; }
body {
  background-color: var(--c-bg) !important;
  color: var(--c-ink);
  letter-spacing: -0.005em;
}
body::before {
  /* card-reader backdrop: brand glow + fine dot grid, fixed behind everything */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(86, 198, 180, 0.13), transparent 62%),
    radial-gradient(700px 480px at -6% 108%, rgba(227, 222, 42, 0.07), transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1.2px) 0 0 / 22px 22px,
    var(--c-bg);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, rgba(0, 0, 0, 0.75) 100%);
}
#app, .main-wrapper, .main-content { background: transparent !important; }
h1, h2, h3, h4, h5, .section .section-header h1, .ui-page-head h1, .modal-title, .card .card-header h4 {
  font-family: var(--font-display) !important; letter-spacing: -0.02em;
}

/* ---------- Surfaces: hairline gradient edge ---------------------------- */
.main-content .card, .ui-kpi, .od-tile, .od-views, .ct-card, .modal-content, .app-menu-panel,
.main-content .pricing, .main-content .contacts-list .contact, .main-content .cstm-profile-list-group-item {
  border: 1px solid transparent !important;
  background:
    linear-gradient(var(--c-surface-solid), var(--c-surface-solid)) padding-box,
    var(--c-edge) border-box !important;
  border-radius: var(--c-radius) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 48px -28px rgba(0, 0, 0, 0.8) !important;
}
.ct-card, .main-content .contacts-list .contact, .main-content .cstm-profile-list-group-item {
  background: linear-gradient(#111517, #111517) padding-box, var(--c-edge) border-box !important;
}
.main-content .card .card-header { border-bottom-color: var(--c-line) !important; padding: 18px 22px; }
.main-content .card .card-body { padding: 20px 22px; }

/* ---------- Floating glass sidebar --------------------------------------- */
:root { --app-sidebar-w: 268px; --app-topbar-h: 68px; }
.app-sidebar {
  top: 12px; bottom: 12px; left: 12px; width: calc(var(--app-sidebar-w) - 24px);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 24, 26, 0.86), rgba(12, 15, 16, 0.9)) padding-box, var(--c-edge) border-box;
  border: 1px solid transparent;
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}
.app-sidebar::after {
  /* NFC waves bottom corner */
  content: ""; position: absolute; right: -36px; bottom: -30px; width: 170px; height: 170px;
  background: var(--c-nfc) no-repeat center / contain; opacity: 0.07; pointer-events: none;
}
.app-sidebar-head { height: 78px; padding: 0 18px 0 20px; border-bottom: 1px solid var(--c-line); }
.app-nav { padding: 10px 12px 28px; }
.app-nav-section {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.16em;
  color: #59625e; margin: 20px 12px 8px;
}
.app-nav-link { min-height: 42px; border-radius: 12px; font-weight: 500; font-size: 13.5px; color: #aeb6b2 !important; gap: 13px; }
.app-nav-link > i:first-child { color: #6d7672; font-size: 14.5px; }
.app-nav-link:hover { background: rgba(255, 255, 255, 0.04) !important; color: #fff !important; }
.app-nav-link.is-active, .app-nav-group.is-active > .app-nav-link {
  color: #fff !important; font-weight: 600;
  background: linear-gradient(90deg, rgba(95, 201, 168, 0.16), rgba(95, 201, 168, 0.04)) !important;
  box-shadow: inset 0 0 0 1px rgba(95, 201, 168, 0.18);
}
.app-nav-link.is-active::before { left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-gradient); box-shadow: 0 0 14px rgba(127, 206, 139, 0.7); }
.app-nav-sublink { font-weight: 500; color: #8a9390 !important; }
.app-nav-sublink.is-active { color: #fff !important; background: rgba(95, 201, 168, 0.1); }
.app-nav-children::before { background: var(--c-line-2); }

/* Top bar floats with the content */
.app-topbar {
  left: var(--app-sidebar-w); height: var(--app-topbar-h); padding: 0 26px 0 28px;
  background: linear-gradient(180deg, rgba(4, 5, 6, 0.92), rgba(4, 5, 6, 0.55));
  border-bottom: 1px solid transparent;
}
.app-user-btn { background: rgba(255, 255, 255, 0.03); border-color: var(--c-line); }
.app-icon-btn:hover, .app-icon-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.05); border-color: var(--c-line); }
.app-topbar ~ .main-content, .app-sidebar ~ .main-content { padding-left: calc(var(--app-sidebar-w) + 20px) !important; padding-right: 36px !important; }

@media (max-width: 991.98px) {
  .app-sidebar { top: 10px; bottom: 10px; left: 10px; width: min(300px, calc(100vw - 40px)); transform: translateX(calc(-100% - 20px)); }
  .app-topbar { left: 0; padding: 0 14px; }
  .app-topbar ~ .main-content, .app-sidebar ~ .main-content { padding-left: 16px !important; padding-right: 16px !important; }
}
@media (max-width: 767.98px) {
  .app-bottombar {
    left: 10px; right: 10px; bottom: 10px; border-radius: 20px; padding: 6px;
    background: linear-gradient(180deg, rgba(22, 26, 28, 0.92), rgba(12, 15, 16, 0.94)) padding-box, var(--c-edge) border-box;
    border: 1px solid transparent; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.9);
  }
  .app-bottombar a { border-radius: 14px; }
  .app-bottombar ~ .main-content { padding-bottom: 110px !important; }
}

/* ---------- Page header: eyebrow + display title ------------------------- */
.ui-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: #8fe3c3;
}
.ui-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--brand-gradient); box-shadow: 0 0 10px rgba(127, 206, 139, 0.8); }
.ui-page-head { margin: 8px 0 26px; align-items: flex-end; }
.ui-page-head h1, .section .section-header h1 { font-size: clamp(26px, 2.4vw, 34px) !important; font-weight: 700 !important; line-height: 1.1; color: #fff; }
.ui-page-head h1::after { display: none; }
.ui-page-head .ui-sub { margin-top: 8px; font-size: 14px; color: var(--c-ink-3); max-width: 640px; }

/* ---------- Metrics ------------------------------------------------------ */
.ui-kpi { padding: 18px 18px 16px; gap: 10px; position: relative; overflow: hidden; }
.ui-kpi::after, .od-tile::after {
  content: ""; position: absolute; right: -26px; top: -22px; width: 96px; height: 96px;
  background: var(--c-nfc) no-repeat center / contain; opacity: 0.05; pointer-events: none; transition: opacity .25s;
}
button.ui-kpi:hover::after, a.ui-kpi:hover::after, a.od-tile:hover::after { opacity: 0.12; }
.ui-kpi .ui-kpi-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-ink-3); }
.ui-kpi .ui-kpi-value, .od-tile-value, .od-views-value, .ct-stat-value, .dash-status-row .num {
  font-family: var(--font-display) !important; font-weight: 700 !important; letter-spacing: -0.03em;
}
.ui-kpi .ui-kpi-value { font-size: 30px; }
.ui-kpi.is-active { box-shadow: var(--c-glow) !important; }
button.ui-kpi:hover, a.ui-kpi:hover, a.od-tile:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 28px 50px -26px rgba(0,0,0,.9), 0 0 0 1px rgba(95,201,168,.14) !important; }

.od-tile { position: relative; overflow: hidden; padding: 24px 16px 20px; }
.od-tile-icon { border-radius: 16px; box-shadow: 0 0 0 6px rgba(95, 201, 168, 0.06), 0 14px 30px -10px rgba(95, 201, 168, 0.5); }
.od-tile-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-ink-3); }
.od-tile-value { font-size: 38px; }
.od-views::before {
  content: ""; position: absolute; right: 18px; top: 60px; width: 200px; height: 200px;
  background: var(--c-nfc) no-repeat center / contain; opacity: 0.05; pointer-events: none;
}
.od-views-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-ink-2); }
.od-views-value { font-size: 46px; }

/* ---------- Controls ----------------------------------------------------- */
.btn { font-family: var(--font-text); font-weight: 600; border-radius: 12px !important; letter-spacing: 0; }
.btn-primary, .btn-primary.disabled {
  position: relative; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 10px 26px -10px rgba(127, 206, 139, 0.7) !important;
}
.btn-primary::after {
  /* soft shine sweep on hover */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent); transform: skewX(-18deg);
  transition: left .6s ease; pointer-events: none;
}
.btn-primary:hover::after { left: 130%; }
.btn-ghost, .btn-secondary, .btn-light {
  background: rgba(255, 255, 255, 0.03) !important; border: 1px solid var(--c-line-2) !important; color: var(--c-ink) !important;
}
.btn-ghost:hover, .btn-ghost:focus { background: rgba(255, 255, 255, 0.07) !important; border-color: rgba(255, 255, 255, 0.2) !important; }

.main-content .form-control, .modal .form-control, .main-content .custom-select, .main-content .cstm-input-feild-profile,
.select2-container--default .select2-selection--single, .select2-container--default .select2-selection--multiple {
  background: rgba(255, 255, 255, 0.025) !important; border: 1px solid var(--c-line-2) !important; border-radius: 12px !important;
  color: var(--c-ink) !important; font-family: var(--font-text);
}
.main-content .form-control:hover, .modal .form-control:hover { border-color: rgba(255, 255, 255, 0.2) !important; }
.main-content .form-control:focus, .modal .form-control:focus, .main-content .cstm-input-feild-profile:focus {
  background: rgba(95, 201, 168, 0.04) !important; border-color: rgba(95, 201, 168, 0.7) !important; box-shadow: 0 0 0 4px rgba(95, 201, 168, 0.12) !important;
}
.main-content label, .modal label { font-family: var(--font-text); font-weight: 600; color: var(--c-ink-2); }

.ui-chip { border-color: var(--c-line-2); font-weight: 500; }
.ui-chip.is-active { background: var(--brand-gradient) !important; border-color: transparent; box-shadow: 0 6px 16px -8px rgba(127, 206, 139, 0.8); }
.ui-seg { background: rgba(255, 255, 255, 0.03); border-color: var(--c-line); border-radius: 14px; }
.ui-seg button.is-active, .ui-seg input:checked + span { background: var(--brand-gradient) !important; box-shadow: 0 6px 16px -8px rgba(127, 206, 139, 0.8); }

.ui-badge { font-family: var(--font-text); font-weight: 600; font-size: 11.5px; border: 1px solid rgba(255, 255, 255, 0.06); }
.ui-badge::before { box-shadow: 0 0 8px currentColor; }

/* ---------- Data lists --------------------------------------------------- */
.ui-list th, .main-content .table thead th {
  font-family: var(--font-mono) !important; font-size: 10.5px !important; font-weight: 600 !important; letter-spacing: 0.12em !important; color: #6f7874 !important;
}
.ui-list th { background: transparent; }
.ui-list tbody tr { position: relative; }
.ui-list tbody tr:hover { background: linear-gradient(90deg, rgba(95, 201, 168, 0.06), transparent 60%); }
.ui-list tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 #7fce8b; }
.ui-user .ui-user-name { font-weight: 600; }
.ui-avatar { font-family: var(--font-display); font-weight: 700; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset; }

/* ---------- Dialogs & menus --------------------------------------------- */
.modal-backdrop.show { opacity: 0.78; backdrop-filter: blur(4px); }
.modal-content { border-radius: 22px !important; }
.dropdown-menu { border-radius: 14px !important; background: linear-gradient(#121618, #121618) padding-box, var(--c-edge) border-box !important; border: 1px solid transparent !important; }

/* ---------- Motion ------------------------------------------------------- */
@keyframes c-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.main-content .section > * { animation: c-rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.main-content .section > *:nth-child(2) { animation-delay: .05s; }
.main-content .section > *:nth-child(3) { animation-delay: .1s; }
.main-content .section > *:nth-child(4) { animation-delay: .15s; }
.ui-kpis > *, .od-tiles > * { animation: c-rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.ui-kpis > *:nth-child(2), .od-tiles > *:nth-child(2) { animation-delay: .04s; }
.ui-kpis > *:nth-child(3), .od-tiles > *:nth-child(3) { animation-delay: .08s; }
.ui-kpis > *:nth-child(4), .od-tiles > *:nth-child(4) { animation-delay: .12s; }
.ui-kpis > *:nth-child(5), .od-tiles > *:nth-child(5) { animation-delay: .16s; }
.ui-kpis > *:nth-child(6) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) {
  .main-content .section > *, .ui-kpis > *, .od-tiles > * { animation: none !important; }
  .btn-primary::after { display: none; }
}

/* ==========================================================================
   Auth pages (login): split layout with a 3D Carteo card
   ========================================================================== */
.c-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr); }
.c-auth-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 56px; border-right: 1px solid var(--c-line);
  background:
    radial-gradient(700px 420px at 20% 10%, rgba(227, 222, 42, 0.10), transparent 60%),
    radial-gradient(800px 520px at 90% 90%, rgba(86, 198, 180, 0.16), transparent 60%);
}
.c-auth-logo { display: inline-flex; align-items: center; gap: 12px; }
.c-auth-logo img:first-child { width: 40px; height: 40px; }
.c-auth-logo img:last-child { height: 30px; width: auto; }
.c-auth-pitch h1 { font-family: var(--font-display); font-size: clamp(32px, 3.4vw, 52px); line-height: 1.04; font-weight: 700; letter-spacing: -0.035em; color: #fff; margin: 0 0 16px; }
.c-auth-pitch h1 span { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.c-auth-pitch p { color: var(--c-ink-2); font-size: 16px; max-width: 460px; margin: 0; }
.c-auth-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #59625e; }

/* the card */
.c-card-stage { perspective: 1200px; margin: 30px 0; }
.c-card {
  position: relative; width: min(420px, 100%); aspect-ratio: 1.586; border-radius: 22px; padding: 26px;
  transform: rotateX(14deg) rotateY(-18deg) rotateZ(2deg); transform-style: preserve-3d;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(227, 222, 42, 0.22), transparent 45%),
    radial-gradient(120% 120% at 100% 100%, rgba(86, 198, 180, 0.32), transparent 50%),
    linear-gradient(145deg, #15191b, #0a0c0d);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 50px 80px -30px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 0 60px -10px rgba(95, 201, 168, 0.35);
  animation: c-float 7s ease-in-out infinite;
}
.c-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.1) 45%, transparent 60%);
}
.c-card-chip { position: absolute; left: 26px; top: 50%; width: 46px; height: 36px; margin-top: -18px; border-radius: 8px;
  background: linear-gradient(135deg, #e3de2a, #b9c95a 50%, #7fce8b); opacity: .9;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.c-card-chip::after { content: ""; position: absolute; inset: 7px 9px; border: 1px solid rgba(0,0,0,.28); border-radius: 4px; }
.c-card-nfc { position: absolute; right: 22px; top: 22px; width: 54px; height: 54px; background: var(--c-nfc) no-repeat center / contain; opacity: .9; }
.c-card-word { position: absolute; left: 26px; bottom: 24px; height: 26px; }
.c-card-id { position: absolute; right: 26px; bottom: 26px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; color: rgba(255,255,255,.55); }
@keyframes c-float { 0%, 100% { transform: rotateX(14deg) rotateY(-18deg) rotateZ(2deg) translateY(0); } 50% { transform: rotateX(10deg) rotateY(-12deg) rotateZ(1deg) translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .c-card { animation: none; } }

.c-auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(24px, 5vw, 72px); position: relative; }
.c-auth-panel .c-auth-lang { position: absolute; top: 22px; right: 26px; }
.c-auth-form { width: 100%; max-width: 400px; margin: 0 auto; }
.c-auth-form h2 { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: #fff; margin: 0 0 6px; }
.c-auth-form .c-auth-sub { color: var(--c-ink-3); margin-bottom: 28px; }
.c-auth-form label { color: var(--c-ink-2); font-weight: 600; font-size: 12.5px; margin-bottom: 6px; display: block; }
.c-auth-form .form-control {
  height: 50px; border-radius: 14px !important; background: rgba(255, 255, 255, 0.03) !important; border: 1px solid var(--c-line-2) !important; color: #fff !important; padding: 0 16px;
}
.c-auth-form .form-control:focus { border-color: rgba(95, 201, 168, 0.75) !important; box-shadow: 0 0 0 4px rgba(95, 201, 168, 0.12) !important; background: rgba(95, 201, 168, 0.04) !important; }
.c-auth-form .btn-primary { width: 100%; height: 50px; font-size: 15px; border-radius: 14px !important; }
.c-auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 22px; font-size: 13px; }
.c-auth-row a { color: #8fe3c3; font-weight: 600; }
.c-auth-foot { margin-top: 28px; color: #59625e; font-size: 12px; text-align: center; }
@media (max-width: 991.98px) {
  .c-auth { grid-template-columns: 1fr; }
  .c-auth-brand { padding: 28px 24px 8px; border-right: 0; }
  .c-auth-pitch, .c-auth-meta { display: none; }
  .c-card-stage { display: none; }
  .c-auth-panel { padding-top: 24px; }
}

/* Save buttons across legacy forms share the brand primary style */
.main-content .savebtn:not(.btn-danger):not(.btn-ghost), .main-content .btn-profile-sbmt {
  background: var(--brand-gradient) !important; color: var(--brand-on) !important; border: 0 !important;
  border-radius: 12px !important; font-weight: 700; padding: 10px 26px !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 10px 26px -10px rgba(127, 206, 139, 0.7) !important;
}
.od-views::before { right: -30px; top: auto; bottom: -40px; width: 180px; height: 180px; opacity: 0.04; }
.ui-kpi .ui-kpi-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 991.98px) { .c-auth-brand { background: none; } }
