:root {
  --mw-bg: var(--sll-admin-bg);
  --mw-surface: var(--sll-admin-card);
  --mw-surface-strong: var(--sll-admin-card-strong);
  --mw-text: var(--sll-admin-text);
  --mw-muted: var(--sll-admin-muted);
  --mw-line: var(--sll-admin-line);
  --mw-primary: var(--sll-admin-primary);
  --mw-primary-dark: #7d60e8;
  --mw-blue: var(--sll-admin-info);
  --mw-green: var(--sll-admin-success);
  --mw-amber: var(--sll-admin-warning);
  --mw-red: var(--sll-admin-danger);
  --mw-shadow: var(--sll-admin-shadow);
  --mw-shadow-soft: var(--sll-admin-shadow-soft);
  --mw-radius: var(--sll-admin-radius);
  --mw-radius-inner: var(--sll-admin-radius-inner);
  --mw-radius-pill: var(--sll-admin-radius-pill);
}

html {
  min-height: 100%;
  background: var(--mw-bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--mw-text);
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 248, 255, 0.98)),
    linear-gradient(135deg, #f6e9ff, #e7f5ff) !important;
}

.mw-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 18px clamp(12px, 2vw, 24px) 28px;
}

.mw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 96px;
  padding: 18px 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.86) !important;
  border-radius: 26px !important;
  background: var(--mw-surface) !important;
  box-shadow: var(--mw-shadow) !important;
  backdrop-filter: blur(18px);
}

.mw-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.mw-logo {
  width: 190px;
  height: 64px;
  flex: 0 0 190px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: transparent;
}

.mw-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.mw-kicker {
  margin: 0 0 4px;
  color: var(--mw-primary);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mw-title {
  margin: 0;
  color: var(--mw-text) !important;
  font-size: 28px !important;
  line-height: 1.18 !important;
  font-weight: 900 !important;
  letter-spacing: 0;
}

.mw-subtitle {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--mw-muted) !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
  letter-spacing: 0;
}

.mw-user {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.mw-user-text {
  min-width: 140px;
  text-align: right;
}

.mw-user-text strong,
.mw-user-text span {
  display: block;
  overflow-wrap: anywhere;
}

.mw-user-text strong {
  font-size: 14px;
  line-height: 1.45;
}

.mw-user-text span {
  margin-top: 2px;
  color: var(--mw-muted);
  font-size: 12px;
}

.mw-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mw-button,
.mw-link,
.mw-filter button,
.mw-status-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  gap: 6px;
  border: 1px solid var(--mw-line);
  border-radius: var(--mw-radius-pill);
  background: #fff;
  color: var(--mw-text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.mw-button {
  padding: 0 14px;
}

.mw-button:hover,
.mw-link:hover,
.mw-filter button:hover,
.mw-status-button:hover {
  transform: translateY(-1px);
  border-color: rgba(156, 120, 255, 0.55);
}

.mw-button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--sll-admin-primary), var(--sll-admin-accent));
  color: #fff;
  box-shadow: 0 14px 26px rgba(156, 120, 255, 0.28);
}

.mw-link {
  min-height: 32px;
  padding: 0 12px;
  color: var(--mw-primary-dark);
}

.mw-message {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #bed6ff;
  border-radius: var(--mw-radius-inner);
  background: rgba(255, 255, 255, 0.9);
  color: #164e83;
  font-size: 13px;
  line-height: 1.6;
}

.mw-message.is-visible {
  display: block;
}

.mw-message.is-error {
  border-color: #f1bbc5;
  background: #fff1f4;
  color: var(--mw-red);
}

.mw-overview {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.mw-day,
.mw-stat,
.mw-panel {
  border: 1px solid var(--mw-line);
  border-radius: var(--mw-radius);
  background: var(--mw-surface);
  box-shadow: var(--mw-shadow);
}

.mw-day {
  min-height: 112px;
  padding: 18px;
  display: grid;
  align-content: center;
}

.mw-day span {
  color: var(--mw-muted);
  font-size: 12px;
  font-weight: 800;
}

.mw-day strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mw-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.mw-stat {
  min-height: 112px;
  padding: 14px;
  display: grid;
  align-content: space-between;
}

.mw-stat span {
  color: var(--mw-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.mw-stat strong {
  margin-top: 8px;
  font-size: 26px;
  line-height: 1;
}

.mw-stat small {
  margin-top: 8px;
  color: var(--mw-muted);
  font-size: 11px;
  line-height: 1.45;
}

.mw-loading {
  min-height: 22px;
  margin: 12px 2px 0;
  color: var(--mw-muted);
  font-size: 12px;
  font-weight: 700;
}

.mw-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
  gap: 14px;
  margin-top: 8px;
  align-items: start;
}

.mw-panel {
  min-width: 0;
  padding: 16px;
}

.mw-panel-main {
  min-height: 0;
}

.mw-panel-wide {
  grid-column: 1 / -1;
}

.mw-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mw-section-label {
  margin: 0 0 4px;
  color: var(--mw-primary);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.mw-panel h2 {
  margin: 0;
  color: var(--mw-text) !important;
  font-size: 17px !important;
  line-height: 1.35 !important;
  font-weight: 900 !important;
  letter-spacing: 0;
}

.mw-list {
  display: grid;
  gap: 10px;
}

.mw-list-compact {
  gap: 8px;
}

.mw-row {
  border: 1px solid var(--mw-line);
  border-radius: var(--mw-radius-inner);
  background: var(--mw-surface-strong);
  padding: 12px;
  min-width: 0;
}

.mw-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mw-row-title {
  margin: 0;
  color: var(--mw-text);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.mw-row-meta {
  margin: 6px 0 0;
  color: var(--mw-muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.mw-row-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.mw-chip {
  flex: 0 0 auto;
  min-height: 24px;
  max-width: 140px;
  padding: 4px 8px;
  border: 1px solid var(--mw-line);
  border-radius: var(--mw-radius-pill);
  background: #f7f9fd;
  color: var(--mw-muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mw-chip-high,
.mw-chip-urgent,
.mw-chip-critical {
  border-color: #f2c0c9;
  background: #fff0f3;
  color: var(--mw-red);
}

.mw-chip-medium,
.mw-chip-waiting,
.mw-chip-review {
  border-color: #f5d6a2;
  background: #fff7e8;
  color: var(--mw-amber);
}

.mw-chip-low,
.mw-chip-done,
.mw-chip-info {
  border-color: #c4e7db;
  background: #eefaf6;
  color: var(--mw-green);
}

.mw-status-button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--mw-muted);
}

.mw-status-button.is-active {
  border-color: rgba(156, 120, 255, 0.55);
  background: #f2efff;
  color: var(--mw-primary-dark);
}

.mw-empty {
  min-height: 84px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed #cbd5e6;
  border-radius: var(--mw-radius-inner);
  color: var(--mw-muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.mw-filter {
  display: inline-flex;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--mw-line);
  border-radius: var(--mw-radius-pill);
  background: #f7f9fd;
}

.mw-filter button {
  min-height: 28px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--mw-muted);
}

.mw-filter button.is-active {
  background: #fff;
  color: var(--mw-primary-dark);
  box-shadow: var(--mw-shadow-soft);
}

.mw-action-grid,
.mw-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mw-shortcuts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mw-action,
.mw-shortcut {
  min-height: 88px;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--mw-line);
  border-radius: var(--mw-radius-inner);
  background: #fff;
  color: var(--mw-text);
  text-decoration: none;
}

.mw-action:hover,
.mw-shortcut:hover {
  border-color: rgba(156, 120, 255, 0.55);
}

.mw-action strong,
.mw-shortcut strong {
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mw-action span,
.mw-shortcut span {
  color: var(--mw-muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.mw-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(156, 120, 255, 0.12), rgba(141, 207, 255, 0.18));
  color: var(--sll-admin-primary);
  font-size: 11px;
  font-weight: 900;
}

.mw-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(150px, 0.75fr));
  gap: 12px;
  align-items: end;
}

.mw-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.mw-form span {
  color: var(--mw-muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.mw-form input,
.mw-form select,
.mw-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--mw-line) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: var(--mw-text) !important;
  font: inherit;
  font-size: 13px !important;
  line-height: 1.4;
  padding: 9px 10px;
  box-shadow: none !important;
}

.mw-form textarea {
  min-height: 78px;
  resize: vertical;
}

.mw-form-wide {
  grid-column: span 3;
}

@media (max-width: 1120px) {
  .mw-overview {
    grid-template-columns: 1fr;
  }

  .mw-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mw-grid {
    grid-template-columns: 1fr;
  }

  .mw-shortcuts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mw-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mw-form-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .mw-shell {
    padding: 12px;
  }

  .mw-header {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .mw-brand {
    align-items: flex-start;
  }

  .mw-logo {
    width: 132px;
    height: 50px;
    flex-basis: 132px;
  }

  .mw-title {
    font-size: 23px !important;
  }

  .mw-subtitle {
    font-size: 12px !important;
  }

  .mw-user {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }

  .mw-user-text {
    text-align: left;
  }

  .mw-toolbar {
    justify-content: flex-start;
  }

  .mw-stats,
  .mw-action-grid,
  .mw-shortcuts,
  .mw-form {
    grid-template-columns: 1fr;
  }

  .mw-panel {
    padding: 13px;
  }

  .mw-panel-head,
  .mw-row-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mw-filter {
    width: 100%;
  }

  .mw-filter button {
    flex: 1;
  }
}
