/*
 * Project Portal — Custom portal styles
 * Applies to /project-portal/* pages only (not the Desk).
 * Uses Bootstrap 4 utilities where available; all custom classes prefixed .po-
 */

/* ═══════════════════════════════════════════════════════════
   1. RESET & BASE
═══════════════════════════════════════════════════════════ */

.po-page * { box-sizing: border-box; }

body {
  background: #f4f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Remove Frappe website default padding/margin that fight our layout */
.container, .container-fluid { max-width: 100% !important; padding: 0 !important; }
.website-main-header { display: none !important; }
footer.web-footer { display: none !important; }
.page-content-wrapper { padding: 0 !important; }
.website-content-wrapper { padding: 0 !important; }

/* ═══════════════════════════════════════════════════════════
   2. NAVBAR
═══════════════════════════════════════════════════════════ */

.po-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0;
  background: #0a2540;
  color: #fff;
  padding: 0 24px;
  height: 52px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.po-navbar-brand {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  margin-right: 32px;
  white-space: nowrap;
}

.po-navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.po-nav-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none !important;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.po-nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.po-nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

.po-navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.po-user-name {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-btn-desk {
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 12px;
  text-decoration: none !important;
  transition: border-color 0.15s, color 0.15s;
}

.po-btn-desk:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.65);
}

.po-btn-logout {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  text-decoration: none !important;
  padding: 4px 8px;
}

.po-btn-logout:hover { color: #fff; }

/* ═══════════════════════════════════════════════════════════
   3. PAGE WRAPPER
═══════════════════════════════════════════════════════════ */

.po-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* ═══════════════════════════════════════════════════════════
   4. STATS BAR
═══════════════════════════════════════════════════════════ */

.po-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.po-stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #dfe1e6;
}

.po-stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}

.po-stat-label {
  font-size: 12px;
  color: #5e6c84;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   5. SECTION HEADER
═══════════════════════════════════════════════════════════ */

.po-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.po-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #172b4d;
  margin: 0;
}

.po-btn-primary {
  background: #0065ff;
  color: #fff !important;
  border: none;
  border-radius: 5px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-block;
}

.po-btn-primary:hover { background: #0052cc; }

/* ═══════════════════════════════════════════════════════════
   6. PROJECT CARDS GRID
═══════════════════════════════════════════════════════════ */

.po-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.po-project-card {
  background: #fff;
  border-radius: 6px;
  border: 1px solid #dfe1e6;
  border-left: 4px solid #0065ff;
  padding: 18px 18px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.po-project-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.po-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.po-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #172b4d;
  text-decoration: none !important;
  line-height: 1.3;
  flex: 1;
}

.po-card-title:hover { color: #0065ff; }

.po-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.po-badge-lg {
  padding: 4px 14px;
  font-size: 13px;
}

.po-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #5e6c84;
}

.po-card-meta svg { flex-shrink: 0; }

/* ── Progress bar ── */

.po-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.po-progress-bar {
  flex: 1;
  height: 6px;
  background: #ebecf0;
  border-radius: 3px;
  overflow: hidden;
}

.po-progress-bar-lg { height: 10px; border-radius: 5px; }

.po-progress-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s ease;
}

.po-progress-pct {
  font-size: 11px;
  color: #5e6c84;
  white-space: nowrap;
  font-weight: 600;
}

/* ── Task pills ── */

.po-task-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.po-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Card action buttons ── */

.po-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid #f4f5f7;
  margin-top: 2px;
}

.po-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #42526e !important;
  background: #f4f5f7;
  text-decoration: none !important;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.po-action-btn:hover {
  background: #dfe1e6;
  color: #172b4d !important;
}

.po-action-primary {
  background: #e9f2ff !important;
  color: #0065ff !important;
}

.po-action-primary:hover {
  background: #0065ff !important;
  color: #fff !important;
}

/* ═══════════════════════════════════════════════════════════
   7. EMPTY STATE
═══════════════════════════════════════════════════════════ */

.po-empty-state {
  text-align: center;
  padding: 60px 24px;
  color: #5e6c84;
}

.po-empty-state h3 { color: #172b4d; margin-bottom: 8px; }
.po-empty-state p { margin-bottom: 20px; }

/* ═══════════════════════════════════════════════════════════
   8. MASTERS PAGE
═══════════════════════════════════════════════════════════ */

.po-masters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.po-masters-card {
  background: #fff;
  border-radius: 6px;
  border: 1px solid #dfe1e6;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}

.po-masters-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-left: 4px solid #0065ff;
  border-bottom: 1px solid #f4f5f7;
}

.po-masters-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #172b4d;
  margin: 0;
}

.po-masters-links {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.po-masters-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  color: #42526e !important;
  text-decoration: none !important;
  transition: background 0.1s, color 0.1s;
}

.po-masters-link:hover {
  background: #f4f5f7;
  color: #0065ff !important;
}

/* ═══════════════════════════════════════════════════════════
   9. PROJECT DETAIL — BANNER
═══════════════════════════════════════════════════════════ */

.po-breadcrumb {
  font-size: 13px;
  color: #5e6c84;
  margin-bottom: 16px;
}

.po-breadcrumb a {
  color: #0065ff;
  text-decoration: none;
  font-weight: 600;
}

.po-breadcrumb-sep { margin: 0 6px; }

.po-project-banner {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #dfe1e6;
  border-bottom: 4px solid #0065ff;
  padding: 22px 24px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  flex-wrap: wrap;
}

.po-banner-left { flex: 1; min-width: 220px; }

.po-project-title {
  font-size: 22px;
  font-weight: 800;
  color: #172b4d;
  margin: 0 0 10px;
}

.po-banner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #5e6c84;
}

.po-banner-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.po-banner-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 200px;
}

.po-progress-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.po-progress-group .po-progress-bar { width: 200px; }

.po-banner-actions {
  display: flex;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════
   10. TAB BAR
═══════════════════════════════════════════════════════════ */

.po-tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid #dfe1e6;
  margin-bottom: 20px;
}

.po-tab {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #5e6c84;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.12s;
}

.po-tab:hover { color: #172b4d; }

.po-tab.active {
  color: #0065ff;
  border-bottom-color: #0065ff;
}

.po-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #ebecf0;
  color: #42526e;
  font-size: 11px;
  font-weight: 700;
}

.po-tab.active .po-tab-count {
  background: #e9f2ff;
  color: #0065ff;
}

/* ═══════════════════════════════════════════════════════════
   11. KANBAN BOARD
═══════════════════════════════════════════════════════════ */

.po-kanban {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}

.po-kanban::-webkit-scrollbar { height: 6px; }
.po-kanban::-webkit-scrollbar-track { background: #f4f5f7; border-radius: 3px; }
.po-kanban::-webkit-scrollbar-thumb { background: #c1c7d0; border-radius: 3px; }

.po-kanban-col {
  min-width: 230px;
  max-width: 260px;
  flex-shrink: 0;
  background: #f4f5f7;
  border-radius: 6px;
  padding: 10px 8px 12px;
}

.po-kanban-col-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5e6c84;
  padding: 2px 4px 10px;
  border-bottom: 3px solid var(--col-color, #6554c0);
  margin-bottom: 8px;
}

.po-kanban-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.po-kanban-col-count {
  margin-left: auto;
  background: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  color: #42526e;
}

.po-kanban-card {
  display: block;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #dfe1e6;
  padding: 10px 12px 8px;
  margin-bottom: 8px;
  text-decoration: none !important;
  transition: box-shadow 0.12s, border-color 0.12s;
}

.po-kanban-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  border-color: #b3bac5;
}

.po-kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: #172b4d;
  line-height: 1.4;
  margin-bottom: 6px;
}

.po-kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.po-kanban-date {
  font-size: 11px;
  color: #5e6c84;
}

.po-kanban-date-overdue {
  color: #ff5630 !important;
  font-weight: 700;
}

.po-kanban-empty {
  font-size: 12px;
  color: #97a0af;
  text-align: center;
  padding: 16px 0;
}

/* Priority badges */
.po-priority {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 3px;
}

.po-priority-high   { background: #ffeceb; color: #ff5630; }
.po-priority-medium { background: #fff4e0; color: #ff8b00; }
.po-priority-low    { background: #e3fcef; color: #36b37e; }

/* ═══════════════════════════════════════════════════════════
   12. TABLES
═══════════════════════════════════════════════════════════ */

.po-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #dfe1e6;
}

.po-table thead tr {
  background: #f4f5f7;
  border-bottom: 2px solid #dfe1e6;
}

.po-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5e6c84;
  text-align: left;
  white-space: nowrap;
}

.po-table td {
  padding: 10px 14px;
  font-size: 13px;
  color: #172b4d;
  border-bottom: 1px solid #f4f5f7;
  vertical-align: middle;
}

.po-table tbody tr:last-child td { border-bottom: none; }

.po-table tbody tr:hover { background: #fafbfc; }

.po-table a { color: #0065ff; text-decoration: none; }
.po-table a:hover { text-decoration: underline; }

.po-empty-inline {
  padding: 24px;
  text-align: center;
  color: #97a0af;
  background: #fafbfc;
  border: 1px dashed #dfe1e6;
  border-radius: 6px;
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════
   14. KANBAN BOARD
═══════════════════════════════════════════════════════════ */

.po-page-board { max-width: 100%; padding-left: 16px; padding-right: 16px; }

.po-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.po-kanban-col {
  background: #f4f5f7;
  border-radius: 6px;
  padding: 8px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  transition: background 0.15s;
}

.po-kanban-col-over {
  background: #e9f2ff;
  outline: 2px dashed #0065ff;
}

.po-kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  border-radius: 4px;
  border-top: 3px solid #0065ff;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.po-kanban-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5e6c84;
}

.po-kanban-col-count {
  background: #f4f5f7;
  color: #5e6c84;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.po-kanban-col-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.po-kanban-empty {
  text-align: center;
  color: #c1c7d0;
  font-size: 12px;
  padding: 16px 8px;
}

.po-task-card {
  background: #fff;
  border: 1px solid #dfe1e6;
  border-radius: 5px;
  padding: 10px 12px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: transform 0.1s, box-shadow 0.1s;
}

.po-task-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
  transform: translateY(-1px);
}

.po-task-card-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.po-task-card-subject {
  font-size: 13px;
  font-weight: 600;
  color: #172b4d;
  margin-bottom: 6px;
}

.po-task-card-subject a {
  color: inherit;
  text-decoration: none;
}

.po-task-card-subject a:hover { color: #0065ff; }

.po-task-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.po-task-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #5e6c84;
}

.po-task-card-due { font-weight: 500; }

.po-task-card-assignees {
  display: inline-flex;
  gap: -4px;
}

.po-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6554c0;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: -4px;
  border: 2px solid #fff;
}

.po-avatar:first-child { margin-left: 0; }

.po-avatar-more { background: #97a0af; }

@media (max-width: 1100px) {
  .po-kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .po-kanban { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   13. WORKSPACE — full-viewport split-pane + collapsible sidebar
═══════════════════════════════════════════════════════════ */

/*
 * The workspace shell uses position:fixed so it completely escapes
 * the apjakaltheme page wrapper padding and any other layout constraints.
 */
.po-ws-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 9990;
  background: #f4f5f7;
}

/* Override sticky on the navbar when inside the fixed shell */
.po-ws-navbar {
  position: static !important;
  flex-shrink: 0;
}

/* Hamburger toggle button in the navbar */
.po-sb-toggle-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  padding: 6px 8px;
  margin-right: 6px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.po-sb-toggle-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* Body row: sidebar + resize handle + iframe */
.po-ws-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── Sidebar ── */
.po-ws-sidebar {
  width: 240px;
  min-width: 240px;
  background: #fff;
  border-right: 1px solid #dfe1e6;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: width 0.22s ease, min-width 0.22s ease, opacity 0.18s ease;
}

.po-ws-sidebar::-webkit-scrollbar { width: 4px; }
.po-ws-sidebar::-webkit-scrollbar-track { background: transparent; }
.po-ws-sidebar::-webkit-scrollbar-thumb { background: #dfe1e6; border-radius: 2px; }

.po-ws-sidebar.po-sb-hidden {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  border-right-color: transparent;
}

/* ── Section ── */
.po-sb-section {
  border-bottom: 1px solid #f4f5f7;
}

.po-sb-section-head {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px 9px 12px;
  cursor: pointer;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #5e6c84;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
}
.po-sb-section-head:hover {
  background: #f4f5f7;
  color: #172b4d;
}

.po-sb-section-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.po-sb-section-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.po-sb-section-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.po-sb-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  opacity: 0.6;
}

/* Collapsed state — rotate chevron + hide links */
.po-sb-section.po-sb-collapsed .po-sb-chevron {
  transform: rotate(-90deg);
}
.po-sb-section.po-sb-collapsed .po-sb-links {
  display: none;
}

/* ── Section links ── */
.po-sb-links {
  list-style: none;
  margin: 0;
  padding: 3px 0 6px;
}

.po-sb-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 26px;
  font-size: 13px;
  color: #42526e !important;
  text-decoration: none !important;
  border-left: 3px solid transparent;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.po-sb-link:hover {
  background: #f4f5f7;
  color: #172b4d !important;
}
.po-sb-link.active {
  background: #e9f2ff;
  color: #0065ff !important;
  border-left-color: #0065ff;
  font-weight: 600;
}

.po-sb-link-arrow {
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.1s;
}
.po-sb-link:hover .po-sb-link-arrow,
.po-sb-link.active .po-sb-link-arrow {
  opacity: 1;
}

/* ── Loading overlay + spinner ── */
.po-frame-overlay {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: opacity 0.28s ease;
}

.po-frame-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dfe1e6;
  border-top-color: #0065ff;
  border-radius: 50%;
  animation: po-spin 0.7s linear infinite;
}

@keyframes po-spin {
  to { transform: rotate(360deg); }
}

/* ── Drag-resize handle ── */
.po-ws-resize-handle {
  width: 5px;
  cursor: col-resize;
  background: transparent;
  flex-shrink: 0;
  transition: background 0.15s;
  position: relative;
  z-index: 10;
}
.po-ws-resize-handle:hover,
.po-ws-resize-handle:active {
  background: #0065ff33;
}

/* ── Iframe panel ── */
.po-ws-frame-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  min-width: 0;
}

#poMainFrame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ═══════════════════════════════════════════════════════════
   14. ADMIN PAGE — portal link permission matrix
═══════════════════════════════════════════════════════════ */

.po-nav-admin {
  background: rgba(255,140,0,0.15) !important;
  color: #ffb347 !important;
}
.po-nav-admin:hover { background: rgba(255,140,0,0.28) !important; color: #fff !important; }

.po-admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.po-admin-subtitle {
  font-size: 13px;
  color: #5e6c84;
  margin: 6px 0 0;
  max-width: 680px;
}

.po-admin-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.po-admin-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12px;
  color: #5e6c84;
  margin-bottom: 18px;
  align-items: center;
}

.po-perm-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.po-perm-ok { background: #36b37e; }
.po-perm-no { background: #ff5630; }

.po-admin-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #dfe1e6;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.po-admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

.po-admin-table thead tr {
  background: #f4f5f7;
  border-bottom: 2px solid #dfe1e6;
}

.po-admin-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5e6c84;
  text-align: left;
  white-space: nowrap;
}

.po-admin-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #f4f5f7;
  vertical-align: middle;
}

.po-admin-table tbody tr:last-child td { border-bottom: none; }
.po-admin-table tbody tr:hover { background: #fafbfc; }

.po-role-col { text-align: center; min-width: 110px; }
.po-role-cell { text-align: center; }

.po-section-cell {
  font-weight: 700;
  font-size: 12px;
  color: #5e6c84;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: top;
  padding-top: 14px;
  white-space: nowrap;
  border-right: 2px solid #f4f5f7;
}

.po-link-label { font-weight: 500; color: #172b4d; }

.po-doctype-cell { font-size: 12px; color: #5e6c84; }
.po-doctype-link { color: #0065ff !important; text-decoration: none !important; }
.po-doctype-link:hover { text-decoration: underline !important; }

.po-toggle-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.po-toggle-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #0065ff;
}

.po-admin-msg {
  margin-top: 16px;
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}
.po-admin-msg-success { background: #e3fcef; color: #006644; border: 1px solid #abf5d1; }
.po-admin-msg-error   { background: #ffeceb; color: #bf2600; border: 1px solid #ffbdad; }

.po-admin-section-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #dfe1e6;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ═══════════════════════════════════════════════════════════
   15. RESPONSIVE
═══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .po-stats-bar { grid-template-columns: repeat(2, 1fr); }
  .po-project-banner { flex-direction: column; }
  .po-banner-right { align-items: flex-start; }
  .po-progress-group .po-progress-bar { width: 100%; }
  /* Auto-collapse sidebar on smaller screens */
  .po-ws-sidebar { width: 200px; min-width: 200px; }
}

@media (max-width: 600px) {
  .po-navbar { padding: 0 14px; }
  .po-page { padding: 16px 14px 40px; }
  .po-stats-bar { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .po-stat-value { font-size: 24px; }
  .po-card-grid { grid-template-columns: 1fr; }
  .po-masters-grid { grid-template-columns: 1fr; }
  .po-user-name { display: none; }
  /* Hide sidebar by default on mobile */
  .po-ws-sidebar { width: 0; min-width: 0; opacity: 0; border-right-color: transparent; }
}
