/* ==========================================================================
   ГЛАВНАЯ СТРАНИЦА (HOME DASHBOARD)
   ========================================================================== */
.home-hero {
  background: linear-gradient(135deg, var(--surface), var(--pale-green));
}

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

.home-kpi {
  min-width: 0;
  min-height: 125px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(14, 39, 48, 0.12);
}

.home-kpi span { font-size: 11px; color: var(--muted); font-weight: 800; }
.home-kpi strong { font-size: 27px; line-height: 1.1; margin: 4px 0; }
.home-kpi small { font-size: 10px; color: var(--muted); }
.home-kpi.danger { border-left-color: #c52f4e; }
.home-kpi.sales { border-left-color: var(--amber); }
.home-kpi.legal { border-left-color: var(--blue); }

.home-extras {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  min-width: 0;
  margin-bottom: 14px;
}

.home-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  min-width: 0;
}

.home-panel { padding: 19px; }
.home-list { display: grid; gap: 8px; margin-top: 14px; }

.home-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 11px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  transition: background 0.15s ease;
}

.home-list-item:hover { background: var(--surface-hover); }
.home-list-item.late, .home-list-item.missing { border-left-color: #c52f4e; }
.home-list-item.director { border-left-color: var(--amber); }
.home-list-item strong { font-size: 12.5px; }
.home-list-item span, .home-list-item small { font-size: 11px; color: var(--muted); }
.home-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 12px; }

/* ==========================================================================
   ЦЕНТР УВЕДОМЛЕНИЙ
   ========================================================================== */
.notification-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 99px;
  padding: 8px 11px;
  background: var(--pale-red);
  color: var(--red);
  font-size: 11px;
  font-weight: 850;
}

.notification-button strong {
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  border-radius: 99px;
  background: #c52f4e;
  color: white;
  animation: notification-pulse 2.6s ease-in-out infinite;
}

@keyframes notification-pulse {
  0%, 70%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(197,47,78,0); }
  82% { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(197,47,78,0.12); }
}

.notification-popover {
  position: fixed;
  z-index: 45;
  top: 66px;
  right: 16px;
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100vh - 82px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(30, 20, 32, 0.25);
  animation: notification-in 0.2s ease-out;
  transform-origin: top right;
}

@keyframes notification-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notification-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.notification-content {
  padding: 10px 12px;
  overflow: auto;
  max-height: calc(100vh - 205px);
}

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

.notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.notification-item.unread { border-left: 5px solid #c52f4e; background: var(--pale-red); }
.notification-item.resolved { opacity: 0.72; }

.notification-main {
  display: grid;
  gap: 5px;
  text-align: left;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.notification-main strong { font-size: 12px; }
.notification-main > span { font-size: 11px; color: var(--muted); }
.notification-main small { font-size: 9px; color: var(--muted); }
.notification-badges { display: flex; gap: 5px; flex-wrap: wrap; }

.notification-status {
  padding: 4px 7px;
  border-radius: 99px;
  background: var(--pale-red);
  color: var(--red);
  font-size: 8px;
  font-weight: 850;
}
.notification-status.new { background: var(--pale-green); color: var(--green); }
.notification-status.resolved, .notification-status.dismissed { background: var(--soft); color: var(--muted); }
.notification-status.calendar_today { background: var(--pale-blue); color: var(--blue); }

/* Адаптив Главной */
@media(max-width: 1100px) {
  .home-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media(max-width: 900px) {
  .home-columns { grid-template-columns: 1fr; }
  .home-extras { grid-template-columns: 1fr; }
}
@media(max-width: 760px) {
  .home-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .home-kpi { min-height: 105px; padding: 15px; }
  .home-kpi strong { font-size: 23px; }
  .home-hero { padding: 16px; }
  .home-columns { gap: 10px; }
  .notification-popover {
    top: auto;
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    max-height: min(78vh, 680px);
    border-radius: 19px;
  }
}