:root {
  color-scheme: light;
  --crm-primary: #dc2626;
  --crm-primary-dark: #991b1b;
  --crm-surface: #ffffff;
  --crm-surface-soft: #fff7f7;
  --crm-border: #e5e7eb;
  --crm-text: #111827;
  --crm-muted: #6b7280;
  --crm-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 244, 244, 0.95) 0%, rgba(255, 255, 255, 0.96) 38%, #f8fafc 100%);
  color: var(--crm-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(220, 38, 38, 0.03), transparent 35%, rgba(220, 38, 38, 0.025));
  z-index: -1;
}

a {
  transition: all 0.2s ease;
}

a:hover {
  transform: translateY(-1px);
}

img {
  max-width: 100%;
  display: block;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--crm-border);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  background: #ffffff;
  color: var(--crm-text);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--crm-primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.16);
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  min-height: 44px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  transform: translateY(-1px);
}

.bg-white,
.rounded-2xl,
.rounded-3xl {
  box-shadow: var(--crm-shadow);
  border: 1px solid rgba(229, 231, 235, 0.8);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--crm-shadow);
}

th {
  background: #fef2f2;
  color: var(--crm-primary-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 0.85rem 1rem;
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

tbody tr:hover {
  background: #fff7f7;
}

main,
.container,
.max-w-4xl,
.max-w-6xl {
  position: relative;
}

.crm-shell {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

.crm-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: linear-gradient(180deg, #fff8f8 0%, #ffffff 100%);
  border-right: 1px solid rgba(220, 38, 38, 0.12);
  padding: 1.2rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: auto;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.crm-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.2rem 0.9rem;
  border-bottom: 1px solid #f3e1e1;
}

.crm-sidebar__brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: white;
  font-size: 1rem;
}

.crm-sidebar__eyebrow {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  color: #b91c1c;
  font-weight: 800;
}

.crm-sidebar__brand h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
}

.crm-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.crm-sidebar__link,
.crm-mobile-nav__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  color: #374151;
  text-decoration: none;
  font-weight: 700;
}

.crm-sidebar__link:hover,
.crm-mobile-nav__link:hover,
.crm-sidebar__link.active,
.crm-mobile-nav__link.active {
  background: #fef2f2;
  color: #b91c1c;
}

.crm-mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  justify-content: space-around;
  align-items: center;
  padding: 0.65rem 0.6rem calc(0.65rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px);
  border-top: 1px solid #f1dede;
  pointer-events: auto;
}

.crm-mobile-nav__link {
  flex-direction: column;
  font-size: 0.7rem;
  gap: 0.25rem;
  padding: 0.45rem 0.35rem;
}

@media (max-width: 768px) {
  body {
    background: linear-gradient(180deg, #fff8f8 0%, #f8fafc 100%);
  }

  .px-4,
  .px-2,
  .sm\:px-4 {
    padding-left: 0.8rem !important;
    padding-right: 0.8rem !important;
  }

  table {
    font-size: 0.92rem;
  }

  th,
  td {
    padding: 0.7rem 0.6rem;
  }

  .crm-sidebar {
    display: none;
  }

  .crm-mobile-nav {
    display: flex;
  }

  body {
    padding-bottom: 5rem;
  }
}
