:root {
  --bg-0: #030305;
  --bg-1: #0b0b12;
  --bg-2: #14141c;
  --panel: rgba(20, 20, 25, 0.6);
  --panel-strong: rgba(18, 18, 24, 0.78);
  --border: rgba(255, 255, 255, 0.1);
  --accent: #8859f0;
  --accent-2: #a07bff;
  --accent-3: #ff5fd7;
  --accent-4: #c9a9ff;
  --accent-glow: rgba(136, 89, 240, 0.4);
  --text: #ffffff;
  --muted: #9ca3af;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --glow: 0 0 32px rgba(136, 89, 240, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% 0%, #1a1a2e 0%, var(--bg-0) 60%),
    radial-gradient(circle at 18% 70%, rgba(136, 89, 240, 0.25), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(255, 95, 215, 0.18), transparent 55%);
  background-size: 220% 220%;
  animation: gradientShift 18s ease-in-out infinite;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-weight: 600;
}

p {
  margin: 0 0 12px;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.ambient::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 25%, rgba(136, 89, 240, 0.35), rgba(12, 12, 24, 0.0) 58%),
    radial-gradient(circle at 20% 80%, rgba(88, 70, 160, 0.4), rgba(7, 8, 20, 0.0) 60%),
    radial-gradient(circle at 80% 70%, rgba(255, 95, 215, 0.3), rgba(7, 8, 20, 0.0) 60%);
  filter: blur(20px);
  opacity: 0.9;
  animation: ambientShift 22s ease-in-out infinite;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.5;
  animation: drift 18s ease-in-out infinite;
}

.glow.g1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(136, 89, 240, 0.55), transparent 70%);
  top: -120px;
  left: -80px;
}

.glow.g2 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 95, 215, 0.35), transparent 70%);
  right: -180px;
  top: 10%;
  animation-delay: -6s;
}

.glow.g3 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(201, 169, 255, 0.35), transparent 70%);
  bottom: -200px;
  left: 20%;
  animation-delay: -12s;
}

.grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' seed='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.35;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(30px, -20px, 0) scale(1.05);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 30% 20%;
  }
  50% {
    background-position: 70% 80%;
  }
  100% {
    background-position: 30% 20%;
  }
}

@keyframes ambientShift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(4%, -2%, 0) scale(1.04);
  }
}

.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px;
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-btn {
  border: none;
  background: linear-gradient(145deg, rgba(12, 12, 16, 0.6), rgba(26, 26, 34, 0.8));
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  text-align: left;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-btn:hover,
.nav-btn.active {
  background: linear-gradient(145deg, rgba(136, 89, 240, 0.2), rgba(255, 95, 215, 0.12));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--glow);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.role-badge {
  background: rgba(136, 89, 240, 0.18);
  border: 1px solid rgba(136, 89, 240, 0.45);
  color: #f2ecff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  text-align: center;
}

.content {
  padding: 28px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 6;
}

.mobile-logo img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(12, 12, 20, 0.6);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--glow);
}

.icon-btn span {
  width: 18px;
  height: 2px;
  background: var(--text);
  display: block;
  border-radius: 999px;
}

.icon-btn span + span {
  margin-top: 4px;
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 8;
}

.mobile-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 10, 0.7);
  backdrop-filter: blur(6px);
}

.mobile-drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(320px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.mobile-drawer.open .mobile-drawer-panel {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.mobile-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-user span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mobile-nav .nav-btn {
  width: 100%;
}

.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}

body.menu-open {
  overflow: hidden;
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.user-menu {
  position: relative;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.user-chip span {
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--accent), var(--accent-3));
  display: grid;
  place-items: center;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

.status-avatar {
  position: relative;
  overflow: visible;
}

.status-dot {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-1);
  background: #9ca3af;
}

.status-dot.online {
  background: #22c55e;
}

.status-dot.busy {
  background: #ef4444;
}

.status-dot.away {
  background: #facc15;
}

.status-dot.offline {
  background: #9ca3af;
}

.status-dot.clickable {
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.status-menu {
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(15, 15, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 8px;
  min-width: 160px;
  display: grid;
  gap: 6px;
  z-index: 20;
}

.status-menu button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.status-menu button:hover {
  background: rgba(136, 89, 240, 0.18);
  border-color: rgba(136, 89, 240, 0.4);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-greeting h2 {
  margin: 0 0 6px;
  font-size: 26px;
}

.dashboard-greeting p {
  color: var(--muted);
  margin: 0;
}

.dashboard-section {
  display: grid;
  gap: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fff;
}

.online-users-list {
  display: grid;
  gap: 12px;
}

.online-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.online-user .avatar {
  width: 36px;
  height: 36px;
}

.online-user .status-dot {
  width: 10px;
  height: 10px;
}

.request-list {
  display: grid;
  gap: 12px;
}

.request-item {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 8px;
  width: 100%;
  overflow: hidden;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-row .status-dot {
  position: static;
  border: none;
}

.request-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
  row-gap: 6px;
}

.request-meta strong {
  min-width: 0;
  max-width: 100%;
}

.request-message {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.request-actions .btn {
  flex: 0 1 auto;
  max-width: 100%;
}

.request-actions .btn.icon {
  padding: 6px 10px;
  min-width: auto;
}

.request-actions .btn.dismiss {
  margin-left: auto;
}

@media (max-width: 640px) {
  .request-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .request-actions .btn.dismiss {
    margin-left: 0;
  }
}

.btn.icon {
  padding: 6px 10px;
  min-width: auto;
  line-height: 1;
}

.chip.status-chip {
  padding: 2px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(136, 89, 240, 0.15);
  border: 1px solid rgba(136, 89, 240, 0.3);
}

.chip.priority-chip {
  padding: 2px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.chip.priority-chip.low {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
}

.chip.priority-chip.high {
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.5);
}

.chip.priority-chip.urgent {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
}

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

#view-settings {
  display: none;
  gap: 24px;
}

#view-settings.view.active {
  display: grid;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 12, 0.6);
  backdrop-filter: blur(10px);
  z-index: 30;
}

.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(540px, 92vw);
  height: fit-content;
  background: rgba(20, 20, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px;
  z-index: 40;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.modal.mail-modal {
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.mail-modal-body {
  max-height: none;
  overflow: visible;
  padding-right: 6px;
  padding-bottom: 28px;
  flex: 1;
  min-height: 0;
}

.modal.mail-modal:hover,
.modal.mail-modal:focus-within {
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.modal.mail-modal::-webkit-scrollbar {
  width: 8px;
}

.modal.mail-modal::-webkit-scrollbar-track {
  background: transparent;
}

.modal.mail-modal::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.modal.mail-modal:hover::-webkit-scrollbar-thumb,
.modal.mail-modal:focus-within::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
}

.mail-header {
  margin-bottom: 18px;
}

.mail-reply-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.mail-reply-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
}

.mail-reply-actions .btn.active {
  background: rgba(136, 89, 240, 0.2);
  border-color: rgba(136, 89, 240, 0.5);
  box-shadow: var(--glow);
}

.mail-masonry {
  column-count: 2;
  column-gap: 22px;
  width: 100%;
}

.mail-masonry .card {
  display: inline-block;
  width: 100%;
  margin: 0 0 22px;
  break-inside: avoid;
}

.mail-card-full {
  column-span: all;
  display: block;
  width: 100%;
}

.mail-list {
  display: grid;
  gap: 10px;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.mail-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.mail-pagination .page-size,
.mail-pagination .page-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.mail-pagination select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.mail-compact {
  gap: 8px;
}

.mail-item {
  position: relative;
  width: 100%;
}

.mail-item:not(.with-actions) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.mail-item:not(.with-actions):hover {
  border-color: rgba(155, 120, 255, 0.5);
  background: rgba(155, 120, 255, 0.08);
  transform: translateY(-1px);
}

.mail-item.with-actions {
  --mail-actions-width: clamp(140px, 30%, 220px);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  display: block;
}

.mail-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  width: 100%;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.mail-item.with-actions .mail-hit {
  width: 100%;
  padding-right: calc(var(--mail-actions-width) + 12px);
}

.mail-hit:hover {
  border-color: rgba(155, 120, 255, 0.5);
  background: rgba(155, 120, 255, 0.08);
  transform: translateY(-1px);
}

.mail-item.unread .mail-hit {
  border-color: rgba(155, 120, 255, 0.6);
  background: rgba(155, 120, 255, 0.12);
}

.mail-hit .mail-main {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.mail-hit .mail-subject {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-hit .mail-from {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-hit .mail-date {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  white-space: nowrap;
  margin-left: auto;
  text-align: right;
  flex: 0 0 auto;
  max-width: 120px;
}

.mail-item:not(.with-actions) .mail-main {
  min-width: 0;
  flex: 1;
}

.mail-item:not(.with-actions) .mail-subject,
.mail-item:not(.with-actions) .mail-from {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-actions-zone {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: var(--mail-actions-width);
  min-width: 140px;
  max-width: 220px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.mail-actions-zone::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: -70%;
  border-radius: 16px;
  background: linear-gradient(
    270deg,
    rgba(10, 10, 20, 0.85) 0%,
    rgba(10, 10, 20, 0.7) 35%,
    rgba(10, 10, 20, 0.25) 75%,
    rgba(10, 10, 20, 0) 100%
  );
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 0;
}

.mail-actions {
  position: relative;
  display: flex;
  gap: clamp(6px, 1vw, 10px);
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 1;
}

.mail-actions-zone:hover::before {
  opacity: 1;
}

.mail-actions-zone:hover .mail-actions {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.mail-actions .mail-action {
  width: clamp(28px, 3.2vw, 36px);
  height: clamp(28px, 3.2vw, 36px);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.mail-actions .mail-action:hover {
  background: rgba(155, 120, 255, 0.2);
  border-color: rgba(155, 120, 255, 0.5);
  transform: translateY(-1px);
}

.mail-actions .mail-action svg {
  width: clamp(14px, 1.8vw, 16px);
  height: clamp(14px, 1.8vw, 16px);
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 720px) {
  .mail-item.with-actions {
    --mail-actions-width: clamp(120px, 40%, 180px);
  }

  .mail-actions-zone {
    padding: 0 6px;
  }

  .mail-hit .mail-date {
    max-width: 90px;
    font-size: 10px;
  }

  .mail-actions .mail-action svg {
    width: 20px;
    height: 20px;
  }
}

.mail-original {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.mail-original-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 8px;
}

.mail-original-content {
  min-height: 220px;
  height: 240px;
  max-height: 50vh;
  overflow: auto;
  resize: vertical;
  padding-right: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
}

.mail-original-content,
.mail-original-content * {
  color: rgba(255, 255, 255, 0.85) !important;
  background-color: transparent !important;
}

.mail-original-content a {
  color: #9fc3ff !important;
  text-decoration: underline;
}

.mail-original-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.mail-attachments {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.mail-attachments-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(255, 255, 255, 0.55);
}

.mail-attachments-list {
  display: grid;
  gap: 8px;
}

.mail-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 18, 0.6);
  font-size: 13px;
}

.mail-attachment-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mail-attachment-name {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.mail-attachment-size {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.mail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 18, 0.6);
}

.mail-toolbar .toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mail-toolbar .toolbar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.mail-toolbar select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.mail-editor {
  min-height: 260px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 8, 16, 0.7);
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  width: 100%;
  box-sizing: border-box;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.mail-editor:hover,
.mail-editor:focus-within {
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.mail-editor::-webkit-scrollbar {
  width: 8px;
}

.mail-editor::-webkit-scrollbar-track {
  background: transparent;
}

.mail-editor::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.mail-editor:hover::-webkit-scrollbar-thumb,
.mail-editor:focus-within::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
}

.mail-editor p,
.mail-editor div {
  margin: 0;
}

.mail-reply-body {
  min-height: 200px;
  outline: none;
}

.mail-reply-body:empty::before {
  content: attr(data-placeholder);
  color: rgba(255, 255, 255, 0.45);
}

.mail-signature {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.mail-signature * {
  box-sizing: border-box;
  max-width: 100%;
}

.mail-signature img,
.mail-signature table,
.mail-signature iframe,
.mail-signature svg {
  max-width: 100%;
  height: auto;
}

.mail-summary-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 18, 28, 0.75);
  display: grid;
  gap: 10px;
}

.mail-summary-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(255, 255, 255, 0.6);
}

.mail-summary-content {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.mail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.send-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.send-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.send-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: rgba(20, 20, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 6px;
  display: grid;
  gap: 6px;
  min-width: 170px;
  z-index: 6;
}

.send-dropdown button {
  background: transparent;
  border: none;
  color: #fff;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.send-dropdown button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.schedule-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: rgba(20, 20, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  min-width: 220px;
  z-index: 6;
}

.schedule-panel label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.schedule-panel input {
  width: 100%;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
}

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

.modal-header h3 {
  margin: 0 0 6px;
}

.modal-body {
  display: grid;
  gap: 12px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal .hint {
  margin: 0;
}

body.modal-open {
  overflow: hidden;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid {
  display: grid;
  gap: 20px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

#apps-grid {
  gap: 20px;
  row-gap: 20px;
  column-gap: 20px;
  align-items: stretch;
}

#apps-grid .card {
  margin: 0;
  height: 100%;
}


.stack {
  display: grid;
  gap: 18px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.section-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-item.active {
  border-color: rgba(136, 89, 240, 0.6);
  box-shadow: var(--glow);
}

.history-item {
  display: grid;
  gap: 6px;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.section-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.section-controls {
  display: flex;
  gap: 6px;
}

.mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, rgba(18, 18, 24, 0.8), rgba(30, 30, 40, 0.7));
  color: #ffffff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}

.mini-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.masonry {
  column-count: 3;
  column-gap: 22px;
}

.masonry .card {
  display: inline-block;
  width: 100%;
  margin: 0 0 22px;
  break-inside: avoid;
}

.card {
  padding: 24px 26px;
  border-radius: var(--radius-lg);
}

.card h2,
.card h3 {
  margin: 0 0 12px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pill {
  background: rgba(136, 89, 240, 0.16);
  border: 1px solid rgba(136, 89, 240, 0.32);
  color: #f2ecff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stat:last-child {
  border-bottom: none;
}

.clean-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.clean-list li {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn {
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  color: #ffffff;
  background: linear-gradient(145deg, rgba(20, 20, 25, 0.95), rgba(32, 32, 40, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.btn.primary {
  background: linear-gradient(145deg, rgba(22, 22, 30, 0.98), rgba(28, 28, 38, 0.9));
  color: #ffffff;
  border: 1px solid rgba(136, 89, 240, 0.5);
  box-shadow: 0 0 18px rgba(136, 89, 240, 0.25);
}

.btn.primary:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 0 28px rgba(136, 89, 240, 0.35);
}

.btn.ghost {
  background: linear-gradient(145deg, rgba(14, 14, 18, 0.7), rgba(26, 26, 32, 0.85));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 14px 0 16px;
  justify-items: center;
}

.quick-actions-grid .btn {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  justify-content: center;
}

@media (max-width: 640px) {
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

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

input,
select,
textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(136, 89, 240, 0.6);
  box-shadow: 0 0 0 1px rgba(136, 89, 240, 0.35);
}

select option,
select optgroup {
  color: #0c0c10;
  background: #f4f4fb;
}

textarea {
  resize: vertical;
}

.code-box {
  width: 100%;
  margin-top: 12px;
  background: #0a0c16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #d6d9f0;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.preview-card iframe {
  width: 100%;
  border: none;
  min-height: 520px;
  background: #0b0b0b;
  border-radius: var(--radius-md);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quote-preview {
  position: relative;
  border-radius: var(--radius-md);
  padding: 26px;
  min-height: 720px;
  background: #070812;
  overflow: hidden;
  color: #ffffff;
  overflow: auto;
  --quote-accent: #8859f0;
  --quote-accent-glow: #c9a9ff;
}

.quote-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at top, rgba(136, 89, 240, 0.22) 0%, rgba(7, 8, 18, 0) 55%),
    radial-gradient(ellipse at bottom, rgba(255, 95, 215, 0.12) 0%, rgba(7, 8, 18, 0) 55%),
    repeating-linear-gradient(90deg, rgba(136, 89, 240, 0.06) 0 1px, rgba(0, 0, 0, 0) 1px 42px),
    repeating-linear-gradient(0deg, rgba(255, 95, 215, 0.05) 0 1px, rgba(0, 0, 0, 0) 1px 42px);
  opacity: 0.85;
  pointer-events: none;
}

.quote-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
}

.quote-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.quote-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quote-badge {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(130deg, var(--quote-accent), var(--quote-accent-glow), rgba(255, 255, 255, 0.2));
  box-shadow: 0 0 24px var(--quote-accent-glow);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.quote-title {
  font-size: 22px;
  font-weight: 600;
}

.quote-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.quote-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quote-pill {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

.quote-pill span {
  display: block;
  color: rgba(255, 255, 255, 0.6);
}

.quote-grid {
  display: grid;
  gap: 18px;
}

.quote-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.quote-card {
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.quote-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.quote-muted {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.quote-packages {
  display: grid;
  gap: 16px;
}

.quote-package {
  border-radius: 20px;
  padding: 16px;
  background: rgba(10, 11, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.quote-package.featured {
  border-color: var(--quote-accent);
  box-shadow: 0 0 28px var(--quote-accent-glow);
}

.quote-package-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.quote-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.quote-price {
  text-align: right;
  font-size: 18px;
  font-weight: 600;
}

.quote-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-left: 16px;
  margin-bottom: 0;
}

.quote-list li {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.quote-section-title {
  font-size: 16px;
  margin: 0 0 10px;
}

.quote-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.chip {
  background: rgba(136, 89, 240, 0.18);
  border: 1px solid rgba(136, 89, 240, 0.45);
  color: #f2ecff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
}

.jira-badge {
  background: rgba(136, 89, 240, 0.22);
  border-color: rgba(136, 89, 240, 0.6);
  color: #f6f0ff;
}

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

.jira-task {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.jira-task-title {
  font-size: 13px;
  font-weight: 600;
}

.jira-task-title a {
  color: #ffffff;
  text-decoration: none;
}

.jira-task-title a:hover {
  text-decoration: underline;
}

.jira-task-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.jira-task-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 3, 5, 0.9);
  backdrop-filter: blur(18px);
}

.auth-card {
  width: min(460px, 100%);
  padding: 26px;
  display: grid;
  gap: 18px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand .logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  padding: 8px;
}

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

.tab-btn {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(16, 16, 20, 0.75), rgba(26, 26, 32, 0.9));
  color: #ffffff;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(136, 89, 240, 0.2);
  border-color: rgba(136, 89, 240, 0.5);
}

.auth-form {
  display: grid;
  gap: 12px;
}

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

.apps-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.apps-card .status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.apps-card.locked {
  opacity: 0.5;
}

.apps-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.apps-search {
  position: relative;
  width: min(420px, 100%);
}

.apps-search input {
  width: 100%;
  padding: 12px 46px 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 12, 18, 0.55);
  color: #fff;
  font-size: 14px;
}

.apps-search button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(136, 89, 240, 0.4);
  background: rgba(136, 89, 240, 0.2);
  display: grid;
  place-items: center;
}

.apps-search button svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  opacity: 0.9;
}

.apps-search-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  flex-basis: 100%;
  margin-left: 4px;
  margin-top: 6px;
}

@media (max-width: 720px) {
  .apps-toolbar {
    align-items: flex-start;
  }
  .apps-search {
    width: 100%;
  }
  .apps-search button {
    width: 36px;
    height: 36px;
  }
}

.matrix {
  display: grid;
  gap: 10px;
}

.matrix-row {
  display: grid;
  grid-template-columns: 160px repeat(5, minmax(120px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.matrix-row span {
  font-size: 12px;
  color: var(--muted);
}

.matrix-row strong {
  font-size: 12px;
}

.matrix-row:first-child {
  background: transparent;
  border: none;
  padding: 0 4px 6px;
}

#users-table {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

#users-table .card {
  padding: 16px 18px;
}

#view-settings .grid.two {
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

#view-settings .card h2 {
  margin-bottom: 16px;
}

#view-settings .form-grid {
  gap: 18px;
}

#view-settings #users-table .card {
  padding: 18px 20px;
}

#view-settings .matrix {
  gap: 12px;
}

#view-settings .matrix-row {
  padding: 12px 14px;
}

#view-settings .card {
  padding: 30px 32px;
}

.settings-profile-grid {
  margin-bottom: 28px;
  display: block;
  column-count: 3;
  column-gap: 24px;
}

.settings-profile-grid > .card {
  display: inline-block;
  width: 100%;
  margin: 0 0 24px;
  break-inside: avoid;
}

@media (max-width: 1400px) {
  .settings-profile-grid {
    column-count: 2;
  }
}

@media (max-width: 900px) {
  .settings-profile-grid {
    column-count: 1;
  }
}

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

.span-2 {
  grid-column: span 2;
}

.settings-under-profile {
  grid-column: 1 / 2;
  grid-row: 2;
}

@media (max-width: 1400px) {
  .span-2,
  .settings-under-profile {
    grid-column: auto;
    grid-row: auto;
  }
}

.settings-profile-grid .span-full,
.settings-profile-grid .span-2 {
  column-span: all;
  width: 100%;
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  font-weight: 600;
  overflow: hidden;
  padding: 6px;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.profile-avatar-fields {
  flex: 1;
}

.profile-card .form-grid {
  margin-bottom: 4px;
}

.profile-card .btn {
  align-self: flex-start;
}

.signature-card .section-header {
  align-items: center;
  gap: 12px;
}

.signature-card .btn-row {
  margin-top: 0;
}

.signature-preview,
.signature-editor {
  width: 100%;
  min-height: 160px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 18, 0.55);
  padding: 16px 18px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.signature-preview {
  overflow: auto;
}

.signature-preview a {
  color: var(--accent-2);
  text-decoration: none;
}

.signature-preview a:hover {
  text-decoration: underline;
}

.signature-editor {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  resize: vertical;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-chip:hover {
  color: #fff;
  border-color: rgba(136, 89, 240, 0.5);
}

.tag-chip.active {
  color: #fff;
  border-color: rgba(136, 89, 240, 0.7);
  background: rgba(136, 89, 240, 0.2);
  box-shadow: 0 0 16px rgba(136, 89, 240, 0.25);
}

.day-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.day-chip {
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-chip:hover {
  color: #fff;
  border-color: rgba(136, 89, 240, 0.5);
}

.day-chip.active {
  color: #fff;
  border-color: rgba(136, 89, 240, 0.7);
  background: rgba(136, 89, 240, 0.2);
  box-shadow: 0 0 14px rgba(136, 89, 240, 0.25);
}

.working-hours-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
  overflow: hidden;
}

.working-day-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.working-day-row span {
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}

.working-day-row input[type="time"] {
  width: 100%;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(8, 8, 12, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .signature-card .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .working-day-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .working-day-row span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .working-day-row {
    grid-template-columns: 1fr;
  }
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(20, 22, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1400px) {
  .mail-masonry {
    column-count: 1;
    column-width: auto;
  }
}

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

  .sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  .content {
    padding: 18px;
  }

  .topbar {
    display: none;
  }

  .masonry {
    column-count: 2;
  }

  .mail-masonry {
    column-count: 1;
    column-width: auto;
  }

  .icon-btn span + span {
    margin-top: 2px;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-chip {
    width: 100%;
    justify-content: space-between;
  }

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

  .masonry {
    column-count: 1;
  }

  .modal.mail-modal {
    width: 96vw;
    max-height: 94vh;
  }

  .mail-modal-body {
    max-height: calc(94vh - 170px);
  }

  .mail-original-content {
    min-height: 160px;
    height: 180px;
    max-height: 40vh;
  }
}

.blender-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.blender-alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.blender-alert-chip strong {
  min-width: 20px;
  text-align: center;
  font-size: 0.82rem;
}

.blender-alarm-popup {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: min(420px, calc(100vw - 28px));
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(124, 58, 237, 0.45);
  background: linear-gradient(140deg, rgba(10, 12, 24, 0.96), rgba(30, 18, 56, 0.96));
  box-shadow: 0 20px 46px rgba(5, 3, 15, 0.6);
  z-index: 1200;
  display: grid;
  gap: 12px;
}

.blender-alarm-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.blender-alarm-popup-header h3 {
  margin: 0;
}

.blender-alarm-popup-body {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.blender-alarm-popup .btn-row {
  justify-content: flex-end;
}

.blender-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab-btn {
  border: 1px solid var(--stroke);
  background: rgba(15, 15, 26, 0.65);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: rgba(124, 58, 237, 0.25);
  color: #fff;
  border-color: rgba(124, 58, 237, 0.6);
}

.blender-tab-panel {
  display: none;
}

.blender-tab-panel.active {
  display: block;
}

.blender-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip.active {
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(124, 58, 237, 0.6);
  color: #fff;
}

.blender-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 6px 10px;
}

.blender-search input {
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
  min-width: 200px;
}

.blender-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.blender-queues {
  display: grid;
  gap: 18px;
}

.blender-jobs-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blender-job {
  padding: 18px;
  position: relative;
}

.blender-job-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.blender-job-title h4 {
  margin: 0 0 6px;
}

.blender-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  align-items: center;
}

.blender-owner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.blender-owner .avatar {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}

.blender-job-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.blender-job-status-inline {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.status-chip.running {
  border-color: rgba(74, 222, 128, 0.6);
  color: #bbf7d0;
}

.status-chip.failed,
.status-chip.crashed {
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

.status-chip.completed {
  border-color: rgba(59, 130, 246, 0.6);
  color: #bfdbfe;
}

.status-chip.canceled,
.status-chip.stalled {
  border-color: rgba(248, 181, 0, 0.6);
  color: #fcd34d;
}

.blender-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 12px;
}

.blender-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.85), rgba(14, 165, 233, 0.85));
  width: 0%;
  transition: width 0.3s ease;
}

.blender-job-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.blender-job-stats {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.blender-job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blender-job-actions .btn {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.blender-job-remove {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.blender-job-remove:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
  border-color: rgba(248, 113, 113, 0.75);
}

.blender-job-output {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blender-job-error {
  margin-top: 8px;
  font-size: 0.82rem;
  color: #fca5a5;
}

.blender-stats-grid {
  display: grid;
  gap: 12px;
}

.blender-stat-card {
  padding: 14px;
}

.blender-stat-card strong {
  font-size: 1.2rem;
}

.blender-queue-preview {
  display: grid;
  gap: 10px;
}

.blender-queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.blender-queue-item strong {
  display: block;
}

.blender-queue-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.blender-queue-left .avatar {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.blender-queue-left strong {
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blender-projects-list {
  display: grid;
  gap: 16px;
}

.blender-project {
  padding: 18px;
}

.blender-project-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.blender-project-header h4 {
  margin: 0;
}

.blender-project-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.blender-project-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.blender-project-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.setup-list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .blender-layout {
    grid-template-columns: 1fr;
  }

  .blender-job-status {
    align-items: flex-start;
  }

  .blender-job-status-inline {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .blender-search input {
    min-width: 140px;
  }

  .blender-queue-left strong {
    max-width: 220px;
  }

  .blender-alarm-popup {
    right: 14px;
    left: 14px;
    width: auto;
    bottom: 14px;
  }
}
