:root {
  --bg: #f2f5ff;
  --ink: #1b2140;
  --muted: #626a88;
  --card: #ffffff;
  --line: #e5e9fb;
  --accent: #ef2f5a;
  --ring: rgba(91, 111, 245, 0.28);
  --shadow: 0 16px 36px rgba(35, 43, 86, 0.1);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Avenir Next', 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 2%, #ffe0e8 0%, rgba(255, 224, 232, 0) 35%),
    radial-gradient(circle at 95% 4%, #dce6ff 0%, rgba(220, 230, 255, 0) 32%),
    linear-gradient(160deg, #f8faff 0%, #f2f5ff 50%, #eef3ff 100%);
}

.brand-kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: #2675f0;
  margin: 0;
  font-weight: 700;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid #d7dceb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6d89ff;
  outline: 2px solid var(--ring);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #4154f1 0%, #6179ff 100%);
}

button:hover {
  filter: brightness(0.96);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  filter: none;
}

form {
  display: grid;
  gap: 12px;
}

.message {
  min-height: 20px;
  font-size: 13px;
  margin: 0;
}

/* login */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.brand-box,
.login-card,
.soft-card,
.metric-card,
.sidebar {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand-box {
  padding: 30px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 45%, #1d4ed8 100%);
  color: #ecfeff;
  position: relative;
  overflow: hidden;
}

.brand-box::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 91, 106, 0.5), rgba(255, 91, 106, 0));
}

.brand-logo-login {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  margin-bottom: 10px;
  box-shadow: 0 8px 22px rgba(9, 12, 32, 0.35);
}

.brand-box h1 {
  margin: 8px 0 12px;
  line-height: 1.15;
}

.brand-box ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

.brand-box .brand-kicker {
  color: #67e8f9;
}

.login-card {
  padding: 26px;
}

.login-card h2 {
  margin: 0 0 6px;
}

/* dashboard */
.dashboard-body {
  min-height: 100vh;
  padding: 18px;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  min-height: calc(100vh - 36px);
}

.sidebar {
  padding: 18px 14px;
  background: linear-gradient(180deg, #ffffffeb 0%, #f6f8ffeb 100%);
  backdrop-filter: blur(10px);
  border: 1px solid #ffffff;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.side-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #ff3d5f 0%, #ff6c5c 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(239, 47, 90, 0.34);
}

.side-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-title {
  margin: 0;
  font-weight: 700;
}

.side-brand small {
  color: var(--muted);
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  text-decoration: none;
  color: #4e546a;
  font-weight: 600;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}

.nav-item:hover {
  background: #f4f6ff;
  filter: none;
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, #7f5af0 0%, #6f5bff 100%);
}

.nav-parent {
  justify-content: flex-start;
}

.nav-caret {
  margin-left: auto;
  font-size: 12px;
}

.nav-submenu {
  display: grid;
  gap: 6px;
  padding-left: 14px;
  max-height: 280px;
  overflow: auto;
}

.nav-subitem {
  border: 0;
  background: #f6f7ff;
  color: #596081;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.nav-subitem:hover {
  filter: none;
  background: #eef1ff;
}

.nav-subitem.active {
  color: #ffffff;
  background: linear-gradient(135deg, #7f5af0 0%, #6f5bff 100%);
}

.nav-ico {
  width: 18px;
  text-align: center;
  font-size: 13px;
}

.disabled-item {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-logout {
  margin-top: 10px;
  color: #e11d48;
}

.main-area {
  display: grid;
  gap: 14px;
}

.soft-card {
  background: #ffffffd9;
  border: 1px solid #ffffff;
}

.topbar {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #ffffffec 0%, #f8faffec 100%);
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  background: linear-gradient(135deg, #3347cc 0%, #5a6fff 100%);
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 2.3vw, 40px);
  line-height: 1.14;
}

.topbar-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.notif-count.has-unread {
  background: #ef4444;
  color: #ffffff;
}

.notifications-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, 92vw);
  border: 1px solid #d6def8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  z-index: 60;
  overflow: hidden;
}

.notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f4;
}

.notifications-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.notif-item {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid #dbe4ff;
  background: #f8faff;
  color: #1e293b;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.notif-item strong {
  font-size: 13px;
}

.notif-item span {
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

.notif-item small {
  font-size: 11px;
  color: #64748b;
}

.notif-item.is-unread {
  border-color: #c7d2fe;
  background: #eef2ff;
}

.notif-item.is-read {
  opacity: 0.86;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e9f7f8;
  color: #135c67;
  font-size: 13px;
  font-weight: 700;
}

.btn-secondary {
  background: #34415f;
}

.hero-strip {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(255, 99, 132, 0.1) 0%, rgba(99, 130, 255, 0.11) 100%),
    #ffffff;
}

.hero-strip h2 {
  margin: 0;
  font-size: 36px;
  line-height: 1.1;
  color: #f04d76;
}

.hero-strip p {
  margin: 7px 0 0;
  color: #5f667f;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.mini-chip {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  text-align: center;
}

.chip-pink {
  background: linear-gradient(135deg, #ff6c88 0%, #ff7d6a 100%);
}

.chip-blue {
  background: linear-gradient(135deg, #66b8ff 0%, #6386ff 100%);
}

.chip-violet {
  background: linear-gradient(135deg, #b073ff 0%, #d278ff 100%);
}

.layout {
  display: grid;
  gap: 14px;
}

.view-panel {
  display: grid;
  gap: 14px;
}

.hidden {
  display: none;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px;
  border: 1px solid #ffffff;
  display: grid;
  gap: 10px;
  animation: fade-up 400ms ease-out;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(41, 54, 112, 0.12);
}

.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-title {
  font-size: 15px;
  color: #4e546c;
  margin: 0;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.metric-value {
  margin: 0;
  font-size: clamp(26px, 2.7vw, 44px);
  font-weight: 800;
  line-height: 1.05;
}

.metric-note {
  margin: 0;
  font-size: 13px;
  color: #626985;
}

.metric-card.tone-pink {
  background: #ffeef3;
}

.metric-card.tone-blue {
  background: #edf2ff;
}

.metric-card.tone-violet {
  background: #f2ecff;
}

.metric-card.tone-green {
  background: #eaf8f1;
}

.metric-card.tone-gray {
  background: #f4f6fb;
}

.tone-pink .metric-icon {
  background: #ff5f87;
  color: #fff;
}

.tone-blue .metric-icon {
  background: #4d86ff;
  color: #fff;
}

.tone-violet .metric-icon {
  background: #8656ff;
  color: #fff;
}

.tone-green .metric-icon {
  background: #41b883;
  color: #fff;
}

.tone-gray .metric-icon {
  background: #8a93a8;
  color: #fff;
}

.panel {
  padding: 16px;
  background: linear-gradient(180deg, #ffffffef 0%, #f9fbffef 100%);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 26px;
}

.panel-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ece9ff;
  color: #5b45c8;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr;
  gap: 12px;
}

.chart-card {
  background: #f8f9ff;
  border: 1px solid #edf0ff;
  border-radius: 14px;
  padding: 12px;
}

.chart-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #4f5877;
}

.chart-canvas {
  height: 190px;
}

.line-svg {
  width: 100%;
  height: 100%;
}

.line-area {
  fill: url(#lineGradient);
  opacity: 0.22;
  animation: chart-fade 900ms ease-out;
}

.line-path {
  fill: none;
  stroke: #5e72ff;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: line-draw 1100ms cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
}

.line-dot {
  fill: #5e72ff;
  opacity: 0;
  animation: dot-pop 500ms ease-out forwards;
  animation-delay: 650ms;
}

.line-path-net {
  fill: none;
  stroke: #17a37f;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: line-draw 1300ms cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
}

.line-dot-net {
  fill: #17a37f;
  opacity: 0;
  animation: dot-pop 520ms ease-out forwards;
  animation-delay: 760ms;
}

.axis-label {
  font-size: 10px;
  fill: #7f89aa;
}

.bar-canvas {
  display: flex;
  align-items: flex-end;
}

.bars {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bar-col {
  display: grid;
  grid-template-rows: 20px 1fr 20px;
  align-items: end;
  gap: 8px;
}

.bar-label-top,
.bar-label-bottom {
  text-align: center;
  font-size: 11px;
  color: #69708a;
  font-weight: 700;
}

.bar-wrap {
  background: #e8ecff;
  border-radius: 10px;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: auto 0 0 0;
  height: var(--h, 30%);
  background: linear-gradient(180deg, #7f8fff 0%, #5e72ff 100%);
  border-radius: 10px 10px 6px 6px;
  transform: scaleY(0);
  transform-origin: bottom;
  animation: bar-grow 900ms cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
}

.donut-card {
  display: grid;
}

.donut-wrap {
  display: grid;
  place-items: center;
  height: 190px;
  position: relative;
}

.donut-svg {
  width: 150px;
  height: 150px;
  transform: rotate(-90deg);
}

.donut-track {
  fill: none;
  stroke: #e7ebff;
  stroke-width: 12;
}

.donut-progress {
  fill: none;
  stroke: #7a61ff;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1200ms cubic-bezier(0.2, 0.7, 0.1, 1);
}

.donut-center {
  position: absolute;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 28px;
}

.donut-center small {
  color: #707998;
  font-size: 12px;
}

.empty-chart {
  color: #7f89aa;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  z-index: 65;
}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4d5673;
}

.page-size-control select {
  width: 80px;
}

.pagination-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-list {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #ccd6ff;
  background: #ffffff;
  color: #4353a8;
  font-weight: 700;
  cursor: pointer;
}

.page-btn.active {
  background: #5f67ff;
  color: #ffffff;
  border-color: #5f67ff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 8px;
  border-bottom: 1px solid #e4e8f4;
  text-align: left;
  font-size: 13px;
}

th {
  color: #515a73;
  font-weight: 700;
}

.split {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.account-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#accountSearchInput {
  min-width: 230px;
}

.pricing-input {
  min-width: 110px;
  width: 100%;
}

.account-edit-btn {
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 11px;
}

.account-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.account-status-text {
  font-size: 11px;
  font-weight: 700;
  color: #1f2950;
}

.radar-indicator {
  position: relative;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
}

.radar-indicator::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.55;
  animation: radarPulse 1.5s ease-out infinite;
}

.radar-green {
  background: #22c55e;
  color: #16a34a;
}

.radar-red {
  background: #ef4444;
  color: #dc2626;
}

.account-admin-note {
  display: block;
  margin-top: 4px;
  color: #475569;
  max-width: 360px;
  white-space: pre-wrap;
  word-break: break-word;
}

.btn-add-warranty-customer {
  margin-top: 4px;
  padding: 3px 8px;
  font-size: 11px;
}

.due-note {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.due-ok {
  background: #dcfce7;
  color: #166534;
}

.due-soon {
  background: #fef3c7;
  color: #92400e;
}

.due-expired {
  background: #fee2e2;
  color: #991b1b;
}

.customer-expired-check-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.customer-expired-check-wrap input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.customer-expired-copy-btn,
.customer-expired-submit-btn {
  white-space: nowrap;
}

.account-kpi-card {
  border: 1px solid #dce4fb;
  border-radius: 14px;
  background: #f6f8ff;
  padding: 10px 12px;
}

.account-kpi-card p {
  margin: 0;
  font-size: 12px;
  color: #616d94;
}

.account-kpi-card strong {
  display: block;
  margin-top: 6px;
  font-size: 25px;
  color: #1f2950;
}

.account-kpi-card small {
  display: block;
  margin-top: 4px;
  color: #69708a;
  font-size: 12px;
}

@keyframes radarPulse {
  0% {
    transform: scale(0.7);
    opacity: 0.6;
  }
  70% {
    transform: scale(1.2);
    opacity: 0.12;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.checkbox-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
}

.full-row {
  grid-column: 1 / -1;
}

.form-grid button,
.form-grid .message {
  grid-column: 1 / -1;
}

.checker-row {
  display: grid;
  gap: 8px;
}

.check-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn-outline {
  background: #eef2ff;
  color: #4254cf;
  border: 1px solid #cdd6ff;
}

.btn-outline:hover {
  filter: brightness(0.98);
}

.btn-move {
  padding: 6px 9px;
  font-size: 12px;
}

.btn-edit-db {
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 11px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, 0.52);
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 240ms ease, visibility 0ms linear;
  will-change: opacity;
}

.modal-overlay.hidden {
  display: grid !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 0ms linear 180ms;
}

.modal-card {
  width: min(560px, 100%);
  background: #ffffff;
  border: 1px solid #d9e2ff;
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
  padding: 16px 18px;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition: transform 280ms cubic-bezier(0.22, 0.78, 0.18, 1), opacity 220ms ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.modal-overlay.hidden .modal-card {
  opacity: 0;
  transform: translate3d(0, 12px, 0) scale(0.98);
}

.modal-sm {
  width: min(460px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-head h3 {
  margin: 0;
  font-size: 24px;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #cfd9ff;
  background: #f5f7ff;
  color: #4152a3;
  font-size: 16px;
  font-weight: 700;
  padding: 0;
}

.modal-form {
  display: grid;
  gap: 10px;
}

.edit-db-transfer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.edit-db-template-box {
  margin-top: 0;
}

#editDbWarrantyTemplatePreview {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  font-family: Consolas, 'Courier New', monospace;
  line-height: 1.45;
}

.modal-divider {
  height: 1px;
  background: #e6ebff;
  margin: 4px 0;
}

.check-cell {
  width: 36px;
}

.account-select,
#accountsSelectAll {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 210px;
  overflow: auto;
  border: 1px solid #cfd9ff;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.14);
}

.autocomplete-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eef2ff;
  border-radius: 0;
  background: #ffffff;
  color: #1f2950;
  text-align: left;
  padding: 9px 12px;
  font-weight: 600;
}

.autocomplete-item:last-child {
  border-bottom: 0;
}

.autocomplete-item:hover {
  background: #f2f5ff;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.btn-danger-outline {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.btn-danger-outline.active-remove {
  background: #be123c;
  color: #ffffff;
  border-color: #be123c;
}

.import-form {
  display: grid;
  gap: 10px;
}

.hint {
  margin: 0 0 10px;
  color: #69708a;
  font-size: 13px;
}

.detail-drop summary {
  cursor: pointer;
  font-weight: 700;
  color: #4d5fff;
  font-size: 12px;
}

.detail-body {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.detail-item {
  padding: 6px 8px;
  border-radius: 8px;
  background: #f3f6ff;
  font-size: 12px;
}

.sim-cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.sim-card {
  border: 1px solid #d6e0ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8ff 100%);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.sim-card h3 {
  margin: 0;
  font-size: 16px;
  color: #1e293b;
}

.sim-rank {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #4f46e5;
}

.sim-meta {
  margin: 0;
  font-size: 12px;
  color: #334155;
}

.sim-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: #475569;
}

.template-link {
  display: inline-block;
  margin-bottom: 10px;
  color: #4d5fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.template-link:hover {
  text-decoration: underline;
}

.status-pill {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-active {
  color: #166534;
  background: #dcfce7;
}

.status-paused {
  color: #9a3412;
  background: #ffedd5;
}

.status-expired {
  color: #991b1b;
  background: #fee2e2;
}

.btn-theme-toggle {
  min-width: 112px;
}

.subscription-template-box {
  margin-top: 12px;
  border: 1px dashed #d7def8;
  border-radius: 12px;
  padding: 12px;
  background: #f8faff;
  display: grid;
  gap: 10px;
}

.subscription-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subscription-template-head h3 {
  margin: 0;
  font-size: 15px;
  color: #334155;
}

.template-mode-row {
  display: grid;
  grid-template-columns: 150px 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.template-mode-label {
  margin: 0;
  font-size: 13px;
  color: #475569;
  font-weight: 700;
}

#subscriptionTemplatePreview {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  font-family: Consolas, 'Courier New', monospace;
  line-height: 1.5;
}

#subscriptionAvailableAccounts,
#templateCatalogPreview {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  font-family: Consolas, 'Courier New', monospace;
  line-height: 1.45;
}

#templateCatalogContent {
  min-height: 260px;
  resize: vertical;
}

.btn-template-select.active-template-btn {
  background: #5f67ff;
  color: #fff;
  border-color: #5f67ff;
}

body.theme-dark {
  color: #e2e8f0;
  background:
    radial-gradient(circle at 5% 2%, rgba(56, 189, 248, 0.14) 0%, rgba(56, 189, 248, 0) 36%),
    radial-gradient(circle at 95% 4%, rgba(129, 140, 248, 0.12) 0%, rgba(129, 140, 248, 0) 30%),
    linear-gradient(160deg, #0b1220 0%, #0f172a 55%, #111827 100%);
}

body.theme-dark .sidebar,
body.theme-dark .soft-card,
body.theme-dark .panel,
body.theme-dark .topbar,
body.theme-dark .metric-card,
body.theme-dark .chart-card,
body.theme-dark .account-kpi-card,
body.theme-dark .modal-card,
body.theme-dark .notifications-panel {
  background: #111827;
  border-color: #273449;
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.45);
}

body.theme-dark .sidebar {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

body.theme-dark .topbar {
  background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
}

body.theme-dark .topbar h1,
body.theme-dark .panel h2,
body.theme-dark .side-title,
body.theme-dark .metric-title,
body.theme-dark .metric-value,
body.theme-dark .metric-note,
body.theme-dark .chart-card h3,
body.theme-dark .account-kpi-card strong,
body.theme-dark .subscription-template-head h3 {
  color: #e2e8f0;
}

body.theme-dark .side-brand small,
body.theme-dark .hint,
body.theme-dark th,
body.theme-dark td,
body.theme-dark .account-kpi-card p,
body.theme-dark .account-kpi-card small,
body.theme-dark .account-admin-note,
body.theme-dark .donut-center small {
  color: #94a3b8;
}

body.theme-dark .account-status-text {
  color: #e2e8f0;
}

body.theme-dark .nav-item {
  color: #cbd5e1;
}

body.theme-dark .nav-item:hover {
  background: #1f2937;
}

body.theme-dark .nav-subitem {
  background: #1f2937;
  color: #cbd5e1;
}

body.theme-dark .nav-subitem:hover {
  background: #273449;
}

body.theme-dark .badge {
  background: #1e293b;
  color: #93c5fd;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}

body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus {
  border-color: #7c9dff;
  outline-color: rgba(124, 157, 255, 0.35);
}

body.theme-dark .btn-outline {
  background: #1f2937;
  color: #c7d2fe;
  border-color: #475569;
}

body.theme-dark .btn-danger-outline {
  background: #3f1d2e;
  border-color: #7f1d3a;
  color: #fecdd3;
}

body.theme-dark .btn-template-select.active-template-btn {
  background: #7c9dff;
  color: #0b1220;
  border-color: #7c9dff;
}

body.theme-dark .subscription-template-box {
  background: #0f172a;
  border-color: #334155;
}

body.theme-dark .template-mode-label {
  color: #94a3b8;
}

body.theme-dark .table-wrap {
  border-color: #273449;
}

body.theme-dark th,
body.theme-dark td {
  border-bottom-color: #273449;
}

body.theme-dark .detail-item {
  background: #1f2937;
}

body.theme-dark .notifications-head {
  border-bottom-color: #273449;
}

body.theme-dark .notif-item {
  background: #1e293b;
  border-color: #334155;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes line-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes dot-pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bar-grow {
  to {
    transform: scaleY(1);
  }
}

@keyframes chart-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.22;
  }
}

@media (prefers-reduced-motion: reduce) {
  .metric-card,
  .line-area,
  .line-path,
  .line-path-net,
  .line-dot,
  .line-dot-net,
  .bar-fill,
  .donut-progress {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1220px) {
  .hero-strip h2,
  .panel h2 {
    font-size: 24px;
  }

  .hero-actions {
    grid-template-columns: 1fr;
    width: 220px;
  }
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 10px;
    bottom: 10px;
    left: -290px;
    width: 270px;
    z-index: 80;
    overflow-y: auto;
    transition: left 260ms ease;
    padding: 14px;
  }

  body.mobile-nav-open .sidebar {
    left: 10px;
  }

  body.mobile-nav-open .mobile-backdrop {
    display: block !important;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .split,
  .account-kpis,
  .grid-cards,
  .chart-grid,
  .form-grid,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .hero-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .topbar > div:first-of-type {
    flex: 1;
  }

  .mobile-menu-btn {
    display: inline-grid;
    place-items: center;
  }

  .hero-actions {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .account-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .template-mode-row {
    grid-template-columns: 1fr;
  }

  .edit-db-transfer-grid {
    grid-template-columns: 1fr;
  }

  #accountSearchInput {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 680px) {
  .notifications-panel {
    right: -8px;
    width: min(360px, calc(100vw - 16px));
  }

  .notifications-head {
    padding: 10px;
  }
  .dashboard-body {
    padding: 8px;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .hero-strip h2,
  .panel h2 {
    font-size: 20px;
  }

  th,
  td {
    padding: 9px 6px;
    font-size: 12px;
    white-space: nowrap;
  }
}




