/* assets/css/notifications.css */

/* ── Bell / badge ─────────────────────────────── */
.notif-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .15);
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}

.notif-bell:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.notif-bell svg {
  width: 16px;
  height: 16px;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--blue-900);
}

/* ── Dropdown notifiche ───────────────────────── */
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(var(--nav-h) + 4px);
  right: 24px;
  width: 360px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 500;
  overflow: hidden;
}

.notif-dropdown.open {
  display: block;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.notif-mark-all {
  font-size: 12px;
  font-weight: 400;
  color: var(--c-primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
}

.notif-mark-all:hover {
  text-decoration: underline;
}

.notif-list {
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 16px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background .1s;
  text-decoration: none;
  color: var(--c-text);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--gray-50);
  text-decoration: none;
}

.notif-item.unread {
  background: var(--blue-50);
}

.notif-item.unread:hover {
  background: #dbeafe;
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-500);
  flex-shrink: 0;
  margin-top: 5px;
}

.notif-item:not(.unread) .notif-dot {
  background: transparent;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item.unread .notif-title {
  font-weight: 600;
}

.notif-msg {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-time {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 3px;
}

.notif-empty {
  text-align: center;
  padding: 24px 16px;
  font-size: 13px;
  color: var(--c-muted);
}

/* ── Flag letto/non letto documenti ───────────── */
.doc-unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-500);
  flex-shrink: 0;
  margin-right: 4px;
  vertical-align: middle;
}

tr.doc-unread td:first-child {
  font-weight: 600;
}

/* ── Upload sidebar ───────────────────────────── */
.fm-upload-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: var(--c-surface);
  border-left: 1px solid var(--c-border);
  box-shadow: -4px 0 20px rgba(0, 0, 0, .1);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}

.fm-upload-sidebar.open {
  transform: translateX(0);
}

.fm-upload-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.fm-upload-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--c-border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  color: var(--c-muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 16px;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--blue-500);
  background: var(--blue-50);
  color: var(--blue-700);
}

.drop-zone svg {
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  display: block;
  opacity: .5;
}

.drop-zone p {
  font-size: 13px;
  margin: 0;
}

.drop-zone small {
  font-size: 11.5px;
  display: block;
  margin-top: 4px;
}

/* Upload queue */
.upload-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-item {
  background: var(--gray-50);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.upload-item-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.upload-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-item-size {
  font-size: 11.5px;
  color: var(--c-muted);
}

/* Progress bar */
.upload-progress {
  flex: 1;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: var(--blue-500);
  border-radius: 2px;
  transition: width .2s;
}

.upload-status {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.upload-status.ok {
  color: var(--green-600);
}

.upload-status.err {
  color: var(--red-600);
}

.upload-status.wait {
  color: var(--c-muted);
}

/* Overlay semi-trasparente quando la sidebar è aperta */
.fm-upload-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .25);
  z-index: 399;
}

.fm-upload-overlay.open {
  display: block;
}

/* Cestino tab */
.view-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--c-border);
}

.view-tab {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: color .12s;
}

.view-tab:hover {
  color: var(--gray-700);
  text-decoration: none;
}

.view-tab.active {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
}

.view-tab .tab-badge {
  background: var(--red-50);
  color: var(--red-600);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* File manager esplora risorse */
.fm-table th:first-child {
  width: 40%;
}

/* file manager folder rows - same style as file rows */
.fm-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--gray-400);
}

.fm-type-icon.folder {
  color: var(--blue-500);
}

.fm-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}