:root {
  --dm-navy: #102033;
  --dm-blue: #1769e0;
  --dm-cyan: #18b7c7;
  --dm-green: #13a06f;
  --dm-ink: #1f2937;
  --dm-muted: #667085;
  --dm-line: #dde5ef;
  --dm-bg: #f5f7fb;
  --dm-sidebar: #111827;
  --dm-sidebar-soft: #1f2937;
}

* {
  letter-spacing: 0;
}

body {
  background: var(--dm-bg);
  color: var(--dm-ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  text-decoration: none;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(16, 32, 51, 0.92), rgba(23, 105, 224, 0.74)),
    url("../img/datisoft-bg.svg") center/cover no-repeat;
  padding: 24px;
}

.auth-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 24px 80px rgba(16, 32, 51, 0.22);
  border-radius: 8px;
  overflow: hidden;
}

.auth-brand {
  color: #fff;
  background: linear-gradient(160deg, var(--dm-navy), #1554a7 62%, var(--dm-cyan));
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--dm-blue);
  font-weight: 800;
  font-size: 1.45rem;
}

.auth-form {
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  color: #dbe7ff;
  background: var(--dm-sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.2s ease;
}

.sidebar-header {
  height: 74px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .brand-mark {
  width: 42px;
  height: 42px;
  font-size: 1.05rem;
}

.sidebar-title {
  font-weight: 750;
  color: #fff;
  line-height: 1.1;
}

.sidebar-title span {
  display: block;
  color: #b6c7e6;
  font-size: 0.78rem;
  font-weight: 500;
}

.sidebar-section {
  padding: 18px 14px 4px;
  color: #8ea6cc;
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #dbe7ff;
  min-height: 40px;
  padding: 9px 14px;
  margin: 2px 10px;
  border-radius: 8px;
  font-size: 0.92rem;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: #fff;
  background: var(--dm-sidebar-soft);
}

.sidebar-link i {
  width: 20px;
  text-align: center;
  color: #6fe5ef;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 74px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--dm-line);
  backdrop-filter: blur(12px);
}

.content {
  padding: 24px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.page-title {
  font-weight: 760;
  color: var(--dm-navy);
  margin: 0;
}

.muted {
  color: var(--dm-muted);
}

.panel {
  background: #fff;
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(16, 32, 51, 0.05);
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--dm-line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-body {
  padding: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  background: #fff;
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 16px;
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric strong {
  display: block;
  font-size: 1.8rem;
  color: var(--dm-navy);
  line-height: 1;
}

.metric span {
  color: var(--dm-muted);
  font-size: 0.9rem;
}

.metric i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--dm-blue);
  background: #eef5ff;
  border-radius: 8px;
  font-size: 1.25rem;
}

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

.table {
  vertical-align: middle;
}

.table th {
  color: var(--dm-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  font-size: 0.92rem;
}

.action-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.badge {
  gap: 4px;
  align-items: center;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 14px;
  align-items: start;
}

.kanban-column {
  background: #eef3f9;
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  min-height: 260px;
  padding: 10px;
}

.kanban-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 720;
  color: var(--dm-navy);
  padding: 6px 4px 10px;
}

.kanban-card {
  background: #fff;
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.subscription-plan-summary {
  border: 1px dashed var(--dm-line);
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--dm-muted);
  min-height: 58px;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  color: var(--dm-muted);
  font-size: 0.88rem;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-legend i {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 3px;
}

.fc {
  --fc-border-color: var(--dm-line);
  --fc-button-bg-color: var(--dm-blue);
  --fc-button-border-color: var(--dm-blue);
  --fc-button-hover-bg-color: #0f54b3;
  --fc-button-hover-border-color: #0f54b3;
  font-family: inherit;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--dm-blue), var(--dm-cyan));
  font-weight: 700;
}

.collapsed .app-shell {
  grid-template-columns: 86px minmax(0, 1fr);
}

.collapsed .sidebar {
  width: 86px;
}

.collapsed .sidebar-title,
.collapsed .sidebar-section,
.collapsed .sidebar-link span {
  display: none;
}

.collapsed .sidebar-link {
  justify-content: center;
}

.skeleton {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: rgba(245, 247, 251, 0.7);
  backdrop-filter: blur(2px);
}

.skeleton.show {
  display: block;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 72px;
  left: 50%;
  width: 220px;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #d9e3f2, #f8fafc, #d9e3f2);
  animation: pulse 1.1s infinite;
}

@keyframes pulse {
  0% { opacity: 0.45; transform: translateX(-50%) scaleX(0.8); }
  50% { opacity: 1; transform: translateX(-50%) scaleX(1); }
  100% { opacity: 0.45; transform: translateX(-50%) scaleX(0.8); }
}

.portal-auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(16, 32, 51, 0.94), rgba(19, 160, 111, 0.72)),
    url("../img/datisoft-bg.svg") center/cover no-repeat;
}

.portal-auth-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 32, 51, 0.24);
}

.portal-auth-brand {
  min-height: 520px;
  padding: 42px;
  color: #fff;
  background: linear-gradient(160deg, var(--dm-navy), #134e4a 62%, var(--dm-green));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portal-auth-brand h1 {
  font-weight: 760;
  max-width: 520px;
}

.portal-auth-form {
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.portal-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  color: #d8f8ed;
  background: #0f2f2c;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-sidebar .sidebar-link i {
  color: #7cf0cf;
}

.timeline-item {
  border-left: 3px solid var(--dm-cyan);
  padding-left: 14px;
  margin-bottom: 16px;
}

.copyable {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #eef6ff;
  border: 1px solid #d6e8ff;
  padding: 2px 6px;
  border-radius: 6px;
}

@media (max-width: 1100px) {
  .metric-grid,
  .kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .auth-card,
  .portal-auth-card,
  .app-shell,
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand,
  .portal-auth-brand {
    min-height: auto;
    gap: 32px;
  }

  .sidebar,
  .portal-sidebar {
    position: static;
    height: auto;
  }

  .topbar {
    position: static;
  }

  .metric-grid,
  .form-grid,
  .kanban {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 16px;
  }
}
