﻿:root {
  --primary: #12ab8f;
  --primary-hover: #0d957c;
  --primary-soft: #e8f8f4;
  --primary-ink: #0f6b5e;
  --sidebar-dark: #143a5a;
  --sidebar-dark-soft: #0f2d49;
  --sidebar-hover: #e9f7f3;
  --bg-main: #f5faf9;
  --card-bg: rgba(255,255,255,0.9);
  --card-solid: #ffffff;
  --border: #d7e7e3;
  --text-main: #163a46;
  --text-muted: #627c78;
  --success: #0f8b76;
  --warning: #c2410c;
  --danger: #b91c1c;
  --info: #2563eb;
  --font-sans: "Poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; font-family: var(--font-sans); }
body.crm-body {
  margin: 0;
  padding: 0;
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  color: var(--text-main);
  background: radial-gradient(circle at top left, #eefbf7, #f7fbfa 44%, #f3f8fd 100%);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 78px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
  color: var(--primary-ink);
  transition: width 0.26s ease, box-shadow 0.26s ease;
  z-index: 1000;
  overflow: hidden;
  box-shadow: 14px 0 34px rgba(15, 46, 66, 0.08);
  border-right: 1px solid rgba(18, 171, 143, 0.12);
  display: flex;
  flex-direction: column;
}
.sidebar:hover { width: 248px; }
.brand-logo, .menu-item, .user-profile { width: 248px; }
.brand-logo {
  padding: 16px 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(18, 171, 143, 0.14);
  background: linear-gradient(180deg, rgba(18, 171, 143, 0.06), rgba(255,255,255,0));
  height: 90px;
}
.brand-icon, .menu-icon, .user-avatar-container {
  width: 74px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.brand-icon svg,
.menu-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.brand-icon svg {
  width: 24px;
  height: 24px;
}
.shell-logo {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(12, 36, 59, 0.18));
}
.shell-logo-sidebar {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  padding: 6px;
  filter: drop-shadow(0 12px 18px rgba(18, 171, 143, 0.22));
}
.brand-mini-label {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 12px 20px rgba(18, 171, 143, 0.22);
}
.shell-logo-header {
  width: 300px;
  height: auto;
  max-height: 74px;
  border-radius: 0;
  background: transparent;
  padding: 0;
  filter: none;
}
.header-logo.logo-only { gap: 0; }
.header-logo.logo-only .mark {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}
.menu-items {
  flex: 1;
  min-height: 0;
  padding-top: 12px;
  padding-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 171, 143, 0.22) transparent;
}
.menu-items::-webkit-scrollbar {
  width: 7px;
}
.menu-items::-webkit-scrollbar-thumb {
  background: rgba(18, 171, 143, 0.22);
  border-radius: 999px;
}
.menu-items::-webkit-scrollbar-track {
  background: transparent;
}
.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  margin-right: 8px;
  color: var(--primary-ink);
  text-decoration: none;
  cursor: pointer;
  border-left: 3px solid transparent;
  border-radius: 0 16px 16px 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.menu-item:hover {
  background: var(--sidebar-hover);
  color: var(--primary);
  border-left-color: var(--primary);
}
.menu-item.active {
  background: linear-gradient(90deg, rgba(18, 171, 143, 0.16), rgba(18, 171, 143, 0.05));
  color: var(--primary);
  border-left-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(18, 171, 143, 0.08);
}
.sidebar .menu-text,
.sidebar .user-info {
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.sidebar:hover .menu-text,
.sidebar:hover .user-info {
  opacity: 1;
  transform: translateX(0);
}
.menu-text { font-size: 11px; font-weight: 700; white-space: nowrap; letter-spacing: 0.02em; }
.user-profile {
  margin-top: auto;
  padding: 14px 0 16px;
  border-top: 1px solid rgba(18, 171, 143, 0.14);
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(236, 248, 245, 0.92));
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  color: white;
  margin: 0 auto;
  box-shadow: 0 12px 18px rgba(18, 171, 143, 0.18);
}
.user-info { white-space: nowrap; line-height: 1.35; font-size: 11px; color: var(--primary-ink); }
.user-mini-btn {
  margin-top: 6px;
  border: none;
  background: transparent;
  color: var(--primary);
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}
.user-mini-btn:hover {
  color: var(--primary-hover);
  transform: translateX(1px);
}
.user-mini-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.user-mini-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.main-wrapper {
  margin-left: 78px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.top-header {
  background: linear-gradient(104deg, var(--primary) 0%, var(--primary) 17%, var(--sidebar-dark) 17%, var(--sidebar-dark-soft) 100%);
  padding: 0 34px;
  height: 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: hidden;
  box-shadow: 0 18px 34px rgba(15, 34, 58, 0.12);
}
.top-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 24%, rgba(126, 229, 220, 0.24) 0, transparent 16%),
    radial-gradient(circle at 71% 70%, rgba(255, 255, 255, 0.1) 0, transparent 12%),
    radial-gradient(circle at 88% 50%, rgba(61, 155, 255, 0.12) 0, transparent 18%);
  pointer-events: none;
}
.top-header::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 210px;
  background: linear-gradient(180deg, rgba(18, 171, 143, 0.96), rgba(13, 149, 124, 0.94));
  border-right: 1px solid rgba(255,255,255,0.08);
  pointer-events: none;
}
.top-header > * {
  position: relative;
  z-index: 1;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
}
.header-logo .mark { color: white; }
.header-actions,
.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #ebfffb;
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 11px;
  font-weight: 700;
}
.top-btn {
  border: 1px solid rgba(18, 171, 143, 0.18);
  background: white;
  color: var(--primary-ink);
  border-radius: 999px;
  padding: 10px 15px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 10px 18px rgba(10, 47, 75, 0.12);
}
.top-btn:hover {
  border-color: rgba(18, 171, 143, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(10, 47, 75, 0.16);
}
.shell-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 9px 15px 9px 11px;
  min-height: 42px;
  font-size: 12px;
  font-weight: 800;
}
.shell-logout-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 171, 143, 0.12);
  color: var(--primary-ink);
  flex-shrink: 0;
}
.shell-logout-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.page-shell {
  padding: 30px 34px 40px;
  width: min(1380px, 100%);
  margin: 0 auto;
}
.hero-strip {
  background: linear-gradient(135deg, rgba(20, 58, 90, 0.97), rgba(18, 171, 143, 0.92));
  color: white;
  border-radius: 24px;
  padding: 28px 30px;
  margin-bottom: 22px;
  box-shadow: 0 22px 45px rgba(20, 58, 90, 0.18);
}
.hero-strip .eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  margin-bottom: 12px;
}
.hero-strip h1 {
  margin: 0 0 10px;
  font-size: 29px;
  line-height: 1.08;
  letter-spacing: -0.04em;
}
.hero-strip p {
  margin: 0;
  color: rgba(255,255,255,0.86);
  line-height: 1.7;
  max-width: 760px;
  font-size: 13px;
}
.hero-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  border: 1px solid transparent;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: 0 14px 24px rgba(18, 171, 143, 0.2);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); }
.btn-secondary { background: white; color: var(--primary-ink); border-color: rgba(18, 171, 143, 0.18); }
.btn-secondary:hover { border-color: rgba(18, 171, 143, 0.32); color: var(--primary); }
.btn-ghost { background: rgba(255,255,255,0.14); color: white; border-color: rgba(255,255,255,0.2); }
.btn-danger { background: rgba(185, 28, 28, 0.08); color: var(--danger); border-color: rgba(185, 28, 28, 0.18); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}
.metric-card {
  background: var(--card-bg);
  border: 1px solid rgba(216, 227, 239, 0.9);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(8px);
}
.metric-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.metric-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--sidebar-dark);
  margin-bottom: 8px;
}
.metric-foot {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.55;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.card-panel {
  background: var(--card-bg);
  border: 1px solid rgba(216, 227, 239, 0.9);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(8px);
}
.card-accent { background: linear-gradient(180deg, rgba(240, 253, 244, 0.95), rgba(255,255,255,0.95)); }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.card-head h2, .card-head h3, .card-head h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--sidebar-dark);
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.input, .select, .textarea {
  width: 100%;
  border: 1px solid #c9d6e4;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 12px;
  outline: none;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { min-height: 100px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.1);
}
.search-input {
  min-width: 280px;
  max-width: 420px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form-row label {
  font-size: 13px;
  font-weight: 700;
}
.form-row small { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(216, 227, 239, 0.9);
  background: rgba(255,255,255,0.92);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}
th {
  background: #f8fbfd;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 16px;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
  vertical-align: top;
}
tr:hover td { background: rgba(248, 251, 253, 0.8); }

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.list-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #edf2f7;
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}
.list-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-main);
}
.list-item p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: #ecfeff;
  color: #0f766e;
  align-self: flex-start;
}
.pill.warn { background: #fff7ed; color: var(--warning); }
.pill.error { background: #fef2f2; color: var(--danger); }
.pill.success { background: #e6f4ea; color: var(--success); }
.pill.info { background: #dbeafe; color: var(--info); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  background: var(--tag-soft-bg, #eef4fb);
  color: var(--tag-soft-text, var(--sidebar-dark));
  box-shadow: inset 0 0 0 1px var(--tag-border, transparent);
  margin: 0 6px 6px 0;
}
.tag.hot { background: var(--tag-soft-bg, #fef2f2); color: var(--tag-soft-text, var(--danger)); }
.tag.vip { background: var(--tag-soft-bg, #fffbeb); color: var(--tag-soft-text, var(--warning)); }

.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.65;
}
.error-state {
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: 16px;
  padding: 18px;
  background: rgba(185, 28, 28, 0.06);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
}
.inline-note {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: var(--info);
  font-size: 12px;
  line-height: 1.6;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 24px;
}
.modal-card {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: white;
  border-radius: 22px;
  border: 1px solid rgba(216, 227, 239, 0.9);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}
.modal-header, .modal-footer {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.modal-footer {
  border-bottom: none;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}
.modal-body { padding: 24px; }
.close-btn {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}
.account-password-card {
  width: min(560px, 100%);
}
.account-password-grid {
  display: grid;
  gap: 16px;
}
.account-password-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.account-password-field input {
  width: 100%;
  border: 1px solid #cbd8e5;
  border-radius: 14px;
  padding: 14px 15px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}
.account-password-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.12);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 9998;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(760px, 100vw);
  height: 100vh;
  background: white;
  z-index: 9999;
  box-shadow: -18px 0 50px rgba(15, 23, 42, 0.16);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.drawer-header, .drawer-footer {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.drawer-footer {
  border-bottom: none;
  border-top: 1px solid var(--border);
}
.drawer-body {
  padding: 24px;
  overflow: auto;
  flex: 1;
}

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body.crm-body { display: block; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
  .sidebar:hover { width: 100%; }
  .brand-logo, .menu-item, .user-profile { width: 100%; }
  .brand-icon, .menu-icon, .user-avatar-container { width: 58px; }
  .main-wrapper { margin-left: 0; }
  .top-header {
    height: auto;
    padding: 16px 18px;
    flex-direction: column;
    align-items: flex-start;
  }
  .page-shell { padding: 18px 16px 30px; }
  .hero-strip h1 { font-size: 25px; }
  .metric-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .search-input { min-width: 100%; }
}

.sidebar #sidebar-company-name {
  font-size: 15px !important;
}

.user-profile .user-info > div:first-child {
  font-size: 13px !important;
}

.user-profile .user-info > div:last-child {
  font-size: 10px !important;
}
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600;700&family=Poppins:wght@400;500;600;700;800&display=swap');
