* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-card: #020617;
  --border-subtle: rgba(148, 163, 184, 0.35);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-strong: rgba(56, 189, 248, 0.4);
  --text-primary: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #f97373;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #020617, #000);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 1.2rem 2rem;
  background: radial-gradient(circle at top left, #0f172a, #020617);
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: conic-gradient(from 160deg, #38bdf8, #a855f7, #f97316, #38bdf8);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.8);
}

.brand-logo-inner {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 0, #1f2937, #020617);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e5e7eb;
  font-size: 1.05rem;
  font-weight: 700;
}

.brand-text-main {
  font-size: 1.1rem;
  font-weight: 600;
}

.brand-text-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-user {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.header-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0b1220;
}

.pill {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.8);
}

.pill strong {
  color: #e5e7eb;
}

main {
  flex: 1;
  display: flex;
  padding: 1.4rem 1.7rem 1.7rem;
  gap: 1.2rem;
  align-items: stretch;
}

.shell {
  flex: 1;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 1rem;
  background: radial-gradient(circle at top left, #020617, #020617);
  border-radius: 1.1rem;
  border: 1px solid rgba(15, 23, 42, 0.95);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.95);
  overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  background: radial-gradient(circle at top, #020617, #020617);
  border-right: 1px solid rgba(31, 41, 55, 0.8);
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.sidebar-title {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0.1rem 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.nav-item {
  display: flex;
}

.nav-button {
  border: 0;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-radius: 0.6rem;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 80ms ease,
    box-shadow 120ms ease, border 140ms ease;
  border: 1px solid transparent;
}

.nav-button span.icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.nav-button:hover {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.9);
}

.nav-button.active {
  background: radial-gradient(circle at top left, #0f172a, #020617);
  color: var(--text-primary);
  border-color: var(--accent-strong);
  box-shadow: 0 16px 45px rgba(56, 189, 248, 0.14);
}

.nav-button .badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--text-muted);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-footer small {
  opacity: 0.9;
}

.content {
  background: radial-gradient(circle at top, #0b1120, #020617);
  padding: 1.2rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  margin-bottom: 0.9rem;
}

.content-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.content-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.content-subtitle {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.signout-button {
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.55);
  background: rgba(24, 24, 27, 0.85);
  color: #fecaca;
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 140ms ease, transform 80ms ease, box-shadow 120ms ease,
    border 140ms ease;
}

.signout-button:hover {
  background: rgba(127, 29, 29, 0.9);
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 12px 40px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

.page {
  flex: 1;
  display: none;
  overflow: auto;
}

.page.active {
  display: block;
}

.page-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  border-radius: 0.9rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: radial-gradient(circle at top left, #020617, #020617);
  padding: 0.9rem 1rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.95);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--accent-strong);
  background: var(--accent-soft);
  color: #e0f2fe;
}

.pill-soft {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-muted);
}

label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="email"],
textarea {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.6rem;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease,
    transform 80ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5), 0 12px 35px rgba(15, 23, 42, 0.9);
  transform: translateY(-0.5px);
  background: rgba(15, 23, 42, 1);
}

textarea {
  min-height: 70px;
  resize: vertical;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform 80ms ease, box-shadow 140ms ease, opacity 80ms ease,
    filter 80ms ease;
}

.btn-primary {
  background: radial-gradient(circle at top left, #38bdf8, #0ea5e9);
  color: #0b1220;
  box-shadow: 0 14px 40px rgba(56, 189, 248, 0.55);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 55px rgba(56, 189, 248, 0.8);
  filter: saturate(1.15);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  border-radius: 0.6rem;
  padding-inline: 0.8rem;
}

.btn-ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.9);
  opacity: 0.95;
}

.btn-small {
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
}

.btn-icon-only {
  padding-inline: 0.5rem;
}

.btn-danger {
  background: rgba(127, 29, 29, 0.9);
  color: #fecaca;
  box-shadow: 0 12px 35px rgba(185, 28, 28, 0.6);
}

.muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.list-item {
  padding: 0.55rem 0.65rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(31, 41, 55, 0.9);
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: space-between;
}

.list-main {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.list-title {
  font-size: 0.88rem;
  font-weight: 500;
}

.list-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.7rem;
}

.chip-soft {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
}

.chip-accent {
  background: var(--accent-soft);
  border-color: var(--accent-strong);
  color: #e0f2fe;
}

.cursor-pointer {
  cursor: pointer;
}

.section-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
}

.link {
  color: #7dd3fc;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
  color: #e0f2fe;
}

.empty-state {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem 0.25rem 0.1rem;
}

/* Sign-in layout */

.signin-shell {
  margin: auto;
  max-width: 960px;
  padding: 1.2rem 1.6rem 2rem;
  display: flex;
  flex-direction: row;
  gap: 1.4rem;
}

.signin-hero {
  flex: 1.1;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.95);
  background: radial-gradient(circle at top left, #0b1120, #020617);
  padding: 1.3rem 1.3rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 1);
}

.signin-hero-title {
  font-size: 1.4rem;
  font-weight: 600;
}

.signin-hero-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.signin-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.signin-hero-card {
  border-radius: 0.8rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(15, 23, 42, 0.95);
  padding: 0.7rem 0.75rem;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.signin-hero-card strong {
  font-size: 0.8rem;
}

.signin-hero-card span {
  color: var(--text-muted);
}

.signin-panel {
  flex: 0.95;
  border-radius: 1rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: radial-gradient(circle at top, #020617, #020617);
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.95);
}

.signin-panel-header {
  margin-bottom: 0.7rem;
}

.signin-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.signin-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.signin-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.5rem;
}

.signin-row-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.signin-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.signin-error {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #fecaca;
}

.signin-legal {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.signin-legal strong {
  color: #e5e7eb;
}

.signin-footnote {
  margin-top: 0.5rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.badge-soft {
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
}

.badge-soft strong {
  color: #e5e7eb;
}

/* Task list */

.task-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.task-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.task-title {
  font-size: 0.9rem;
  text-decoration: none;
}

.task-title.completed {
  text-decoration: line-through;
  color: rgba(148, 163, 184, 0.9);
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.task-stats {
  display: flex;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 1);
  cursor: pointer;
}

.checkbox.checked {
  background: radial-gradient(circle at top left, #22c55e, #16a34a);
  border-color: rgba(74, 222, 128, 0.95);
  color: #052e16;
}

/* Contacts */

.avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0b1220;
}

.list-contacts .list-item {
  align-items: center;
}

.list-contacts .list-main {
  flex: 1;
}

.list-contacts .list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Customer tiles */

.customer-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.customer-tile {
  border-radius: 0.9rem;
  border: 1px solid rgba(31, 41, 55, 0.95);
  background: rgba(15, 23, 42, 0.95);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.customer-tile:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.95);
}

.customer-tile-image {
  aspect-ratio: 400 / 260;
  background: #0f172a;
  overflow: hidden;
}

.customer-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.customer-tile-body {
  padding: 0.65rem 0.75rem 0.4rem;
  flex: 1;
  min-width: 0;
}

.customer-tile-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.customer-tile-address {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.customer-tile-map-wrap {
  padding: 0 0.75rem 0.5rem;
}

.customer-tile-map {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: #7dd3fc;
  font-size: 0.78rem;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.customer-tile-map:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent-strong);
  color: #e0f2fe;
}

.customer-tile-map-icon {
  font-size: 0.9rem;
}

.customer-tile-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
}

.customer-tile-actions .btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.customer-tile-actions .btn:hover {
  background: rgba(127, 29, 29, 0.5);
  border-color: rgba(248, 113, 113, 0.5);
}

/* Utility */

.hidden {
  display: none !important;
}

@media (max-width: 960px) {
  main {
    padding: 1.2rem 1.1rem 1.4rem;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding-block: 0.75rem;
  }

  .sidebar-title {
    display: none;
  }

  .nav-list {
    flex-direction: row;
    gap: 0.5rem;
  }

  .nav-button {
    white-space: nowrap;
    font-size: 0.85rem;
  }

  .sidebar-footer {
    display: none;
  }

  .signin-shell {
    flex-direction: column;
    padding-inline: 1.1rem;
  }

  .signin-hero {
    order: -1;
  }
}

@media (max-width: 640px) {
  header {
    padding-inline: 1.2rem;
  }

  .brand-text-sub {
    display: none;
  }

  .signin-shell {
    padding-inline: 1rem;
  }

  .shell {
    border-radius: 0.9rem;
  }

  .content {
    padding-inline: 1rem;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

