.sidebar-close {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.logout-btn i {
  font-size: 0.95rem;
}

.nav-folder {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link--folder {
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 16px;
}

.nav-link--folder .nav-folder__caret {
  margin-left: auto;
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.nav-folder.is-open .nav-link--folder .nav-folder__caret {
  transform: rotate(90deg);
}

.nav-folder__menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 10px;
}

.nav-link--child {
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-link--child:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.portal-viewer {
  display: flex;
  flex-direction: column;
  min-height: 560px;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.portal-viewer[hidden] {
  display: none;
}

.portal-viewer .card-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.portal-viewer iframe {
  flex: 1;
  width: 100%;
  min-height: 480px;
  border: 0;
  background: #fff;
}

.portal-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
}

.portal-popup {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(4px);
}

.portal-popup__shell {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  width: min(100%, 780px);
  max-width: min(92vw, 780px);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
}

.portal-popup__shell--compact {
  width: min(100%, 480px);
  max-width: min(92vw, 480px);
  max-height: min(70vh, 560px);
}

.portal-popup__shell--wide {
  width: min(100%, 1320px);
  max-width: min(96vw, 1320px);
  height: min(94vh, 1180px);
  max-height: min(94vh, 1180px);
}

.portal-popup .portal-popup__shell--wide iframe {
  min-height: 960px;
  height: 100%;
}

.portal-popup .portal-popup__header {
  border-bottom: 1px solid var(--border);
  padding: 18px 22px;
  background: #fff;
}

.portal-popup--announcement {
  inset: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(92vw, 520px);
  max-height: min(84vh, 680px);
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

.portal-popup--announcement .portal-popup__header {
  display: none;
}

.portal-popup--announcement iframe {
  width: min(100%, 460px);
  height: min(76vh, 430px);
  border-radius: 22px;
  border: 0;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.22);
  background: transparent;
}

.portal-popup[hidden] {
  display: none;
}

.portal-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  background: var(--surface);
}

.portal-popup__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-popup__actions .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.portal-popup iframe {
  width: 100%;
  height: auto;
  min-height: 320px;
  border: 0;
  border-radius: 0 0 24px 24px;
  background: #fff;
  overflow: hidden;
  flex: 1;
}

.task-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
}

.task-popup {
  position: fixed;
  inset: 0;
  z-index: 2200;
  margin: auto;
  width: min(92vw, 560px);
  height: fit-content;
  max-height: 80vh;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.task-popup[hidden],
.task-popup-backdrop[hidden] {
  display: none;
}

.task-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.task-popup__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-popup__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-popup__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.task-popup__body h4 {
  margin: 0;
  font-size: 1rem;
}

.task-popup__body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.task-popup__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.chip-btn--danger {
  background: #fee2e2;
  color: #b91c1c;
}

.chip-btn--secondary {
  background: #f1f5f9;
  color: #334155;
}

.task-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.partner-report-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.partner-report-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.partner-report-input {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(0, 104, 56, 0.04);
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.partner-report-form input[type="file"] {
  display: none;
}

.partner-report-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.partner-report-list {
  margin-top: 4px;
}

.partner-report-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.03);
}

.partner-report-list li strong {
  display: block;
  font-size: 0.95rem;
}

.partner-report-list li span {
  color: var(--muted);
  font-size: 0.84rem;
}

.partner-report-empty {
  justify-content: flex-start;
  color: var(--muted);
  background: transparent;
  padding: 0;
}

.task-add-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 320px);
}

.task-add-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  background: #fff;
}

.people-popup {
  position: fixed;
  inset: 0;
  z-index: 2300;
  margin: auto;
  width: min(92vw, 760px);
  max-height: 84vh;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #000;
}

.people-form-popup {
  z-index: 2400;
  border: 2px solid #000;
}

.people-popup[hidden],
.people-form-popup[hidden] {
  display: none;
}

.people-popup .task-popup__body,
.people-form-popup .task-popup__body {
  overflow-y: auto;
  max-height: calc(84vh - 120px);
  padding-right: 12px;
}

.people-popup .task-popup__body::-webkit-scrollbar,
.people-form-popup .task-popup__body::-webkit-scrollbar {
  width: 8px;
}

.people-popup .task-popup__body::-webkit-scrollbar-thumb,
.people-form-popup .task-popup__body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
}

.people-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.people-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: #f8fafc;
}

.people-card strong {
  display: block;
  margin-bottom: 6px;
}

.people-card p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.people-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.people-form,
.task-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-form label,
.people-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--muted);
}

.task-form input,
.task-form textarea,
.task-form select,
.people-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}

.posted-task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.posted-task {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
}

.posted-task__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.posted-task p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.posted-task em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.85rem;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.task-badge--warning {
  background: #fef3c7;
  color: #92400e;
}

.task-badge--success {
  background: #dcfce7;
  color: #166534;
}

.task-badge--info {
  background: #dbeafe;
  color: #1d4ed8;
}

@media (max-width: 1100px) {
  .widget-compact {
    grid-column: span 6;
  }

  .widget-large {
    grid-column: span 12;
  }
}

@media (max-width: 860px) {
  .app-shell {
    position: relative;
  }

  .sidebar {
    position: fixed;
    z-index: 1500;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-grid;
  }

  .main-panel {
    padding: 18px;
  }

  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-date {
    align-items: flex-start;
  }

  .search-shell {
    min-width: 0;
    width: min(100%, 320px);
  }
}

@media (max-width: 640px) {
  .people-list {
    grid-template-columns: 1fr;
  }
  .main-panel {
    padding: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-left,
  .topbar-actions {
    flex-wrap: wrap;
  }

  .search-shell {
    width: 100%;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .widget-compact,
  .widget-large {
    grid-column: span 1;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .hero-card {
    padding: 20px;
  }

  .portal-popup {
    inset: 0;
  }

  .portal-popup__header {
    flex-direction: column;
    align-items: flex-start;
  }
}
