/*
 * Design System — Phase 4 (component migration, slice 1: buttons).
 *
 * Consumes the tokens injected by render_design_theme_tokens_css()
 * (see custom_helper.php / includes/head.php). Loaded after style.css /
 * components.css / custom.css so these rules win the cascade on
 * specificity-equal selectors without needing !important — do not add
 * !important here; if a rule needs it to win, its selector isn't specific
 * enough yet.
 *
 * Token defaults were set to match the exact hex values these selectors
 * used to hardcode, so this file is a zero-visual-diff swap until an
 * admin actually changes something in Settings > Design.
 */

.btn-secondary, .btn-secondary.disabled {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary:active,
.btn-outline-secondary.disabled:hover, .btn-outline-secondary.disabled:focus, .btn-outline-secondary.disabled:active {
  background-color: var(--color-secondary);
}

.btn-success, .btn-success.disabled {
  background-color: var(--color-success);
  border-color: var(--color-success);
}

.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active,
.btn-outline-success.disabled:hover, .btn-outline-success.disabled:focus, .btn-outline-success.disabled:active {
  background-color: var(--color-success);
}

.btn-danger, .btn-danger.disabled {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
}

.btn-warning, .btn-warning.disabled {
  background-color: var(--color-warning);
  border-color: var(--color-warning);
}

.btn-outline-warning:hover, .btn-outline-warning:focus, .btn-outline-warning:active,
.btn-outline-warning.disabled:hover, .btn-outline-warning.disabled:focus, .btn-outline-warning.disabled:active {
  background-color: var(--color-warning);
}

.btn-info, .btn-info.disabled {
  background-color: var(--color-info);
  border-color: var(--color-info);
}

/* Cards — slice 2. Only radius/shadow are migrated here; the markup
   duplication documented in "Current Architecture.md" (cards copy-pasted
   between projects.php/tasks.php/etc.) is a structural refactor for a
   later phase, not a token-consumption change. */
.card {
  box-shadow: var(--shadow-1);
  border-radius: var(--radius-sm);
}

/* Utility classes + form inputs — slice 3. Bootstrap utilities are
   !important by convention (that's their contract: always win) — keeping
   !important here matches the existing style.css rules being replaced,
   not the "avoid !important" guidance for component-level rules above. */
.bg-secondary { background-color: var(--color-secondary) !important; }
.bg-success   { background-color: var(--color-success) !important; }
.bg-info      { background-color: var(--color-info) !important; }
.bg-warning   { background-color: var(--color-warning) !important; }
.bg-danger    { background-color: var(--color-danger) !important; }

.text-secondary, .text-secondary-all *, .text-secondary-all *:before, .text-secondary-all *:after { color: var(--color-secondary) !important; }
.text-success, .text-success-all *, .text-success-all *:before, .text-success-all *:after { color: var(--color-success) !important; }
.text-info, .text-info-all *, .text-info-all *:before, .text-info-all *:after { color: var(--color-info) !important; }
.text-warning, .text-warning-all *, .text-warning-all *:before, .text-warning-all *:after { color: var(--color-warning) !important; }
.text-danger, .text-danger-all *, .text-danger-all *:before, .text-danger-all *:after { color: var(--color-danger) !important; }

/* Badges — slice 4. .badge-secondary (#34395e, a dark navy) is a
   deliberately different shade from the generic --color-secondary token
   (#cdd3d8, used by buttons) — left hardcoded rather than forced onto a
   token that doesn't actually match it. Border-radius (30px "pill" shape)
   also left as-is; it's a one-off, not part of the radius scale. */
.badge.badge-success { background-color: var(--color-success); }
.badge.badge-info    { background-color: var(--color-info); }
.badge.badge-danger  { background-color: var(--color-danger); }

/* Page background + sidebar — slice 5. (--color-header was unused when
   this slice was written; slice 11 below gives it a job.) */
body { background-color: var(--color-background); }
.main-sidebar { background-color: var(--color-sidebar); }

/* Form inputs — slice 6. Diagnosed the earlier "computed border stays
   Bootstrap's #ced4da no matter what" mystery: even a same-tab,
   higher-specificity, later-appended, non-!important rule couldn't move
   border-color, while an identical background-color rule worked fine —
   that's the signature of a browser extension in the test environment
   overriding input borders specifically (autofill/accessibility tooling
   commonly does this via injected styles or a MutationObserver), not a
   real cascade issue in this app's CSS. The source-level rule is a plain
   .form-control selector, same specificity as Bootstrap's, loaded later —
   it wins under normal conditions. */
.form-control,
.input-group-text,
.custom-select,
.custom-file-label {
  border-color: var(--color-border);
}

/* Dropdown menus — slice 7. Its shadow doesn't match the existing
   sm/md/lg elevation scale, so this adds --shadow-menu as a new,
   purpose-specific token (still defaulting to the exact current value)
   rather than forcing it onto shadow-1/2/3, which would change it. */
.dropdown-menu {
  box-shadow: var(--shadow-menu);
}

/* Tables — slice 8. New tokens (table-header-bg/text, table-stripe-bg,
   table-border): these are subtle alpha tints / greys, not brand colors,
   so they didn't fit any existing token — defaults match style.css's
   current values exactly. */
.table:not(.table-sm) thead th {
  background-color: var(--table-header-bg);
  color: var(--table-header-text);
}
.table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--table-stripe-bg);
}
.table.table-bordered td, .table.table-bordered th {
  border-color: var(--table-border);
}

/* Select2 — slice 9. Border-color and the multi-select "choice" shadow
   matched existing tokens (color-border, shadow-1) exactly. The
   open/focus accent (#95a0f4) and off-white idle/open backgrounds
   (#fdfdff/#fefeff) are Select2-specific interaction tints, not brand
   colors — left hardcoded, same reasoning as badge-secondary in
   slice 4. */
.select2-container .select2-selection--multiple,
.select2-container .select2-selection--single {
  border-color: var(--color-border);
}
.select2-dropdown {
  border-color: var(--color-border) !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  box-shadow: var(--shadow-1);
}

/* Modals — slice 10. shadow-modal/shadow-modal-active are new tokens
   (Bootstrap's default modal elevation doesn't match shadow-1/2/3);
   defaults match the exact current hardcoded values. Footer radius
   reuses the existing radius-sm token (already 3px, same value). */
.modal-content {
  box-shadow: var(--shadow-modal);
}
.modal.show .modal-content {
  box-shadow: var(--shadow-modal-active);
}
.modal-footer {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* ============================================================
   Modern layout redesign — slice 11. Unlike slices 1-10 (zero-
   visual-diff token wiring), this slice intentionally changes the
   look: flat neutral header instead of the theme-color band, and
   softer/rounder shadows+corners across buttons, inputs and menus.
   Still 100% token-driven — an admin can dial any of it back from
   Settings > Design, and radius-sm/shadow-1's new defaults live in
   design_theme_tokens(), not here.
   ============================================================ */

/* Header: flat neutral surface (color-header) instead of the
   theme-color band; color-text carries the sidebar's original
   text-on-light tone (now used here, since slice 12 below moved the
   sidebar itself to a dark surface). */
.navbar-bg,
.navbar.active {
  background-color: var(--color-header);
  border-bottom: 1px solid var(--color-border);
  box-shadow: none;
}
.navbar .nav-link,
.navbar .nav-link.nav-link-user,
.navbar .active .nav-link,
.navbar .navbar-text {
  color: var(--color-text);
}
.navbar .nav-link:hover,
.navbar .nav-link.disabled {
  color: var(--color-text);
  opacity: .7;
}

/* Page title card: softer shadow + rounder corners, plus a colored
   left accent (slice 12) so it reads as a distinct, branded element
   rather than a plain white bar. */
.section .section-header {
  box-shadow: var(--shadow-1);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--color-primary);
}

/* Rounder, more consistent corners on the most common controls —
   previously only .card/.modal-footer consumed radius-sm. */
.btn,
.form-control,
.custom-select,
.input-group-text,
.custom-file-label,
.dropdown-menu {
  border-radius: var(--radius-sm);
}

/* ============================================================
   Icon-first sidebar — slice 13. Superseded slice 12's dark-navy
   sidebar after reviewing 3 mockup directions with the user (see
   DESIGN_SYSTEM.md) — chosen direction is colorful/icon-first: users
   should be able to navigate by icon shape + color, not by reading
   labels. White sidebar (color-sidebar back to #fff) with each nav
   icon rendered as a small colored chip. Reuses the per-item
   text-danger/success/info/warning/primary classes navbar.php
   already hardcodes on each <i> (previously neutralized by slice 11)
   as the color hook — no markup change needed, just re-purposing
   classes already there.
   ============================================================ */
.main-sidebar .sidebar-menu li.menu-header {
  color: var(--color-sidebar-text);
  opacity: .55;
}
.main-sidebar .sidebar-menu li a {
  color: var(--color-sidebar-text);
  font-weight: 600;
}
.main-sidebar .sidebar-menu li a i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: #fff !important;
  background: var(--color-secondary);
  font-size: 13px;
  transition: transform var(--duration-fast) var(--easing-standard);
}
.main-sidebar .sidebar-menu li a i.text-danger  { background: var(--color-danger); }
.main-sidebar .sidebar-menu li a i.text-success { background: var(--color-success); }
.main-sidebar .sidebar-menu li a i.text-info    { background: var(--color-info); }
.main-sidebar .sidebar-menu li a i.text-warning { background: var(--color-warning); }
.main-sidebar .sidebar-menu li a i.text-primary { background: var(--color-primary); }
.main-sidebar .sidebar-menu li a i.text-dark    { background: var(--color-cat-purple); }
.main-sidebar .sidebar-menu li a:hover {
  background-color: #f5f6f9;
}
.main-sidebar .sidebar-menu li a:hover i {
  transform: scale(1.08);
}
.main-sidebar .sidebar-menu li.active > a {
  background-color: color-mix(in srgb, var(--color-primary) 8%, white);
  border-left: 3px solid var(--color-primary);
  padding-left: 17px;
  color: var(--color-text);
  font-weight: 700;
}
.main-sidebar .sidebar-menu li ul.dropdown-menu li a {
  color: var(--color-sidebar-text);
}
.main-sidebar .sidebar-menu li ul.dropdown-menu li a:hover,
.main-sidebar .sidebar-menu li ul.dropdown-menu li.active > a {
  color: var(--color-primary);
}

/* ============================================================
   Icon-first dashboard components — slice 13 continued. Colorful
   quick-stat tiles + "My Projects" / "My Tasks" summary panels for
   the dashboard, so a user sees their work at a glance without
   opening Projects/Tasks. Project/task colors reuse the existing
   project_class / priority_class taxonomy already computed server-
   side (card-primary/secondary/success/danger/warning), applied as
   a class on .pm-proj-icon / .pm-task-flag rather than inventing a
   new color system. */
.pm-page-title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  margin: 0;
}
.pm-eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 4px;
}

.pm-tile-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-16);
  margin-bottom: var(--space-24);
}
.pm-tile {
  border-radius: var(--radius-md);
  padding: var(--space-20);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard);
}
.pm-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--elevation-hover);
}
.pm-tile i.bgicon {
  position: absolute;
  right: -8px;
  bottom: -14px;
  font-size: 72px;
  opacity: .18;
}
.pm-tile .num {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  line-height: 1;
  position: relative;
}
.pm-tile .lbl {
  font-size: 12.5px;
  font-weight: 700;
  opacity: .92;
  margin-top: 6px;
  position: relative;
}
.pm-tile.t-primary { background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 70%, white)); }
.pm-tile.t-teal     { background: linear-gradient(135deg, var(--color-cat-teal), color-mix(in srgb, var(--color-cat-teal) 70%, white)); }
.pm-tile.t-orange    { background: linear-gradient(135deg, var(--color-cat-orange), color-mix(in srgb, var(--color-cat-orange) 70%, white)); }
.pm-tile.t-pink       { background: linear-gradient(135deg, var(--color-cat-pink), color-mix(in srgb, var(--color-cat-pink) 70%, white)); }

.pm-panel {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: var(--space-20);
}
.pm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-12);
}
.pm-panel-title {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pm-panel-title .ic {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
}
.pm-see-all {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.pm-proj-item, .pm-task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
}
.pm-proj-item:hover, .pm-task-item:hover {
  background: #f7f7fb;
}
.pm-proj-icon, .pm-task-flag {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}
.pm-task-flag { width: 30px; height: 30px; font-size: 13px; }
.pm-proj-icon.card-primary, .pm-task-flag.card-primary { background: var(--color-primary); }
.pm-proj-icon.card-secondary, .pm-task-flag.card-secondary { background: var(--color-secondary); }
.pm-proj-icon.card-success, .pm-task-flag.card-success { background: var(--color-success); }
.pm-proj-icon.card-danger, .pm-task-flag.card-danger { background: var(--color-danger); }
.pm-proj-icon.card-warning, .pm-task-flag.card-warning { background: var(--color-warning); }
.pm-proj-icon.card-info, .pm-task-flag.card-info { background: var(--color-info); }
/* Compact inline variant for table title cells (slice 14) — same
   color logic as the dashboard's full-size chips, just smaller. */
.pm-proj-icon-sm {
  width: 26px;
  height: 26px;
  font-size: 11px;
  margin-right: 6px;
  vertical-align: middle;
}
.pm-proj-item .txt, .pm-task-item .txt { flex: 1; min-width: 0; }
.pm-proj-item .name, .pm-task-item .name {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-proj-item .sub, .pm-task-item .sub {
  font-size: 11.5px;
  color: var(--color-secondary);
  font-weight: 600;
}
.pm-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  background: color-mix(in srgb, var(--color-primary) 12%, white);
  color: var(--color-primary);
}

/* ============================================================
   Table system — slice 14. Bootstrap-table (data-toggle="table")
   is already the dominant list pattern across the app (Projects,
   Tasks, Members, Leads, Invoices, Users, Reports — confirmed by
   the slice 13 component inventory, DESIGN_SYSTEM.md §Component
   Inventory), so this is a pure CSS reskin of the plugin's generated
   markup — no view/JS changes, same reasoning as every prior slice.
   ============================================================ */
.bootstrap-table {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.bootstrap-table .fixed-table-toolbar {
  padding: 4px 2px 14px;
}
.bootstrap-table table.table td,
.bootstrap-table table.table th {
  padding: 13px 16px;
}
.bootstrap-table table.table-hover tbody tr {
  transition: background var(--duration-fast) var(--easing-standard);
}
.bootstrap-table table.table-hover tbody tr:hover {
  background-color: color-mix(in srgb, var(--color-primary) 4%, white);
}
/* Row action trigger (the "..."/cog dropdown in the last column) as a
   round icon button, matching .pm-btn-icon elsewhere in the app. */
.bootstrap-table table.table td > a[data-toggle="dropdown"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-secondary);
  transition: all var(--duration-fast) var(--easing-standard);
}
.bootstrap-table table.table td > a[data-toggle="dropdown"]:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, white);
  color: var(--color-primary);
}
/* Bootstrap-table's own pagination controls */
.bootstrap-table .pagination .page-link {
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
  border-color: var(--color-border);
  color: var(--color-text);
}
.bootstrap-table .pagination .page-item.active .page-link {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ============================================================
   Modal redesign — user feedback: modals still look plain/dated.
   Targets the shared modal shell every create/edit form in the app
   uses (stisla.js:fireModal generates .modal.fade > .modal-dialog >
   .modal-content > .modal-header/.modal-body/.modal-footer — the
   dominant modal pattern per the DESIGN_SYSTEM.md component
   inventory) plus catalogs.php's few native Bootstrap modals, which
   share the same DOM shape. One CSS pass covers both; no JS/view
   changes needed.
   ============================================================ */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
}
.modal-header {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}
.modal-header h5,
.modal-header .modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  margin: 0;
}
.modal-header .close {
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .55;
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  text-shadow: none;
  transition: all var(--duration-fast) var(--easing-standard);
}
.modal-header .close:hover {
  background: #f5f6f9;
  opacity: 1;
}
.modal-body {
  padding: 24px 26px;
}
.modal-body .form-group:last-child {
  margin-bottom: 0;
}
.modal-footer {
  padding: 16px 26px 22px;
  border-top: 1px solid var(--color-border);
  gap: 8px;
}
.modal-footer .btn {
  min-width: 88px;
  border-radius: var(--radius-sm);
}
.modal-backdrop.show {
  opacity: .55;
}
/* Softer scale-in instead of Bootstrap's default slide-down. */
.modal.fade .modal-dialog {
  transform: scale(.97) translateY(8px);
  transition: transform var(--duration-normal) var(--easing-standard), opacity var(--duration-normal) var(--easing-standard);
  opacity: 0;
}
.modal.show .modal-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ============================================================
   Enterprise modal forms — user feedback: the edit-user modal (and
   by extension every other modal built on the same shared shell)
   read as an old CRUD form: one long white column, every field the
   same weight, inputs that blend into the modal background. This
   redesigns the shell for wide, form-heavy modals: fixed
   header/footer with only the body scrolling, a 2-column field grid
   grouped into visually distinct sections, and inputs with enough
   contrast/size to scan quickly. Applied via two layers: (1) modal
   structure + input styling apply to every modal automatically (no
   per-view opt-in needed - "same reference for the rest of the
   modals" per the user's request), (2) .pm-modal-section /
   .modal-xxl are opt-in for the specific forms restructured into
   sections (currently: add/edit user).
   ============================================================ */

/* --- Wide variant for dense multi-section forms --- */
@media (min-width: 1300px) {
  .modal-dialog.modal-xxl { max-width: 1200px; }
}
@media (min-width: 992px) and (max-width: 1299.98px) {
  .modal-dialog.modal-xxl { max-width: calc(100vw - 80px); }
}

/* --- Fixed header/footer, only the body scrolls --- */
.modal-content {
  max-height: calc(100vh - 64px);
}
.modal-dialog {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}
.modal-header,
.modal-footer {
  flex-shrink: 0;
}
.modal-body {
  overflow-y: auto;
}

/* --- Section cards (opt-in: .pm-modal-section) --- */
.pm-modal-section {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
}
.pm-modal-section:last-child {
  margin-bottom: 0;
}
.pm-modal-section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.pm-modal-section-title i {
  color: var(--color-primary);
  font-size: 17px;
  width: 22px;
  text-align: center;
}
.pm-modal-section .row {
  margin-left: -10px;
  margin-right: -10px;
}
.pm-modal-section .row > [class*="col-"] {
  padding-left: 10px;
  padding-right: 10px;
}
.pm-modal-section .form-group {
  margin-bottom: 20px;
}

/* --- Input redesign — applies inside every modal, not just
   .pm-modal-section forms, per "same reference for the rest of the
   modals". --- */
.modal-body label {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
  display: inline-block;
}
.modal-body .form-control,
.modal-body .custom-select,
.modal-body .select2-container .select2-selection {
  background-color: #f8fafc;
  border: 1.5px solid #d6dce8;
  border-radius: 12px;
  min-height: 48px;
  font-size: 16px;
  transition: border-color var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard);
}
.modal-body textarea.form-control {
  min-height: 88px;
}
.modal-body .form-control::placeholder {
  color: #9aa4b8;
}
.modal-body .form-control:hover,
.modal-body .custom-select:hover,
.modal-body .select2-container:hover .select2-selection {
  border-color: #afc3e5;
}
.modal-body .form-control:focus,
.modal-body .custom-select:focus,
.modal-body .select2-container--focus .select2-selection,
.modal-body .select2-container--open .select2-selection {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 35%, transparent) !important;
}
.modal-body small,
.modal-body .help-text {
  font-size: 13px;
}
.modal-body .select2-selection--multiple {
  min-height: 48px !important;
}

/* --- Footer buttons: equal width/height, clear color coding --- */
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.modal-footer .btn {
  min-width: 110px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   Kanban board redesign — /projects/tasks. User feedback: flat,
   monochromatic, cards blend together, no personality per column.
   Applies to real markup (tasks.php) - every dragula/data-id/
   modal-task-detail/modal-edit-task/delete_task hook, the .count
   span JS updates on drop, and the task_date_div/task_completed_div
   toggles are all left exactly as they were; this is a pure CSS +
   additive-class pass, no behavior changed.
   ============================================================ */
.pm-kb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.pm-page-title {
  font-size: 30px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -.01em;
}
.pm-page-subtitle {
  font-size: 14px;
  color: var(--color-secondary);
  font-weight: 600;
  margin-top: 4px;
}
.pm-kb-illustration {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 80px;
  color: color-mix(in srgb, var(--color-primary) 8%, white);
  z-index: 0;
}
.pm-kb-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1;
}
.pm-segmented {
  display: flex;
  background: #f1f3f9;
  border-radius: var(--radius-sm);
  padding: 4px;
}
.pm-segmented a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-secondary);
  text-decoration: none;
}
.pm-segmented a.active {
  background: #fff;
  color: var(--color-text);
  box-shadow: var(--shadow-1);
}
.pm-btn-primary {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--color-primary) 30%, transparent);
  transition: all var(--duration-fast) var(--easing-standard);
  text-decoration: none;
}
.pm-btn-primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--color-primary) 40%, transparent);
}

/* Floating filter toolbar */
.pm-filter-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-1);
  flex-wrap: wrap;
}
.pm-filter-chip-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-background);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  min-width: 160px;
}
.pm-filter-chip-wrap i {
  color: var(--color-secondary);
  font-size: 12px;
  flex-shrink: 0;
}
.pm-filter-chip-wrap .form-control,
.pm-filter-chip-wrap .select2-container .select2-selection {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.pm-filter-search-wrap {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.pm-filter-search-wrap .form-control {
  width: 180px;
}
.pm-filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 18px;
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 28%, transparent);
}

/* Kanban columns with per-status tint */
.pm-kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}
.pm-kcol {
  border-radius: var(--radius-lg);
  padding: 14px;
}
/* Status-tint modifiers on .pm-kcol. Note: "inprogress" (not
   "progress") deliberately - .pm-kcol-progress is a different class
   below (the thin % bar every column has), and reusing the same name
   for both the "In Progress" status tint and the progress-bar-track
   silently made the bar's background win over the column tint. */
.pm-kcol-todo { background: #FFF8EF; }
.pm-kcol-inprogress { background: #EFF5FF; }
.pm-kcol-review { background: #F6F1FE; }
.pm-kcol-done { background: #F2FCF5; }
.pm-kcol-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 12px;
  font-size: 14px;
  font-weight: 800;
}
.pm-kcol-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pm-kcol-todo .pm-kcol-dot { background: var(--color-warning); }
.pm-kcol-inprogress .pm-kcol-dot { background: var(--color-primary); }
.pm-kcol-review .pm-kcol-dot { background: var(--color-cat-purple); }
.pm-kcol-done .pm-kcol-dot { background: var(--color-success); }
.pm-kcol-progress {
  height: 4px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .06);
  margin: 0 6px 14px;
  overflow: hidden;
}
.pm-kcol-progress > span {
  display: block;
  height: 100%;
  border-radius: 99px;
}
.pm-kcol-todo .pm-kcol-progress > span { background: var(--color-warning); }
.pm-kcol-inprogress .pm-kcol-progress > span { background: var(--color-primary); }
.pm-kcol-review .pm-kcol-progress > span { background: var(--color-cat-purple); }
.pm-kcol-done .pm-kcol-progress > span { background: var(--color-success); }
.pm-kcol-body {
  min-height: 120px;
}

/* Task cards */
.pm-tcard {
  border-radius: 14px !important;
  border: none !important;
  border-top: none !important;
  box-shadow: var(--shadow-1);
  transition: all var(--duration-fast) var(--easing-standard);
}
.pm-tcard:hover {
  box-shadow: var(--elevation-hover);
  transform: translateY(-3px);
}
.pm-tcard-project {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-primary);
  margin-bottom: 6px;
}
.pm-tcard-menu {
  float: right;
}
.pm-tcard-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: -6px -6px 0 0;
  border-radius: var(--radius-sm);
  color: var(--color-secondary);
  transition: background-color .15s ease, color .15s ease;
}
.pm-tcard-menu-btn:hover,
.pm-tcard-menu-btn[aria-expanded="true"] {
  background: var(--color-background);
  color: var(--color-text);
}
@media (hover: none) {
  .pm-tcard-menu-btn { width: 34px; height: 34px; }
}
.pm-tcard-title a {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--color-text);
}
.pm-tcard-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 10px;
}
.pm-tcard-due {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 0 !important;
}
.pm-priority-pill {
  border-radius: 99px !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  padding: 3px 10px !important;
}
.pm-tcard-avatars {
  display: flex;
}
.pm-tcard-avatars .avatar {
  margin-left: -8px;
  border: 2px solid #fff;
}
.pm-tcard-avatars .avatar:first-child {
  margin-left: 0;
}

@media (max-width: 1200px) {
  .pm-kanban-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767.98px) {
  .pm-kanban-board { grid-template-columns: 1fr; }
  .pm-kb-illustration { display: none; }
  .pm-kb-header { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ============================================================
   Projects grid redesign — /projects. Reuses .pm-kb-header/
   .pm-kb-illustration/.pm-segmented/.pm-btn-primary/.pm-filter-*
   from the Kanban redesign above (same page-header + toolbar
   language) plus new KPI tiles and project card styling. Pure CSS +
   additive classes; every functional hook (data-toggle="dropdown",
   .modal-edit-project[data-edit], .delete_project[data-id], the
   $links pagination, .progress-bar[data-width] read by scripts.js)
   is untouched.
   ============================================================ */
.pm-tile-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.pm-tile {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.pm-tile i.bgicon {
  position: absolute;
  right: -6px;
  bottom: -10px;
  font-size: 64px;
  opacity: .18;
}
.pm-tile .num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  position: relative;
}
.pm-tile .lbl {
  font-size: 12px;
  font-weight: 700;
  opacity: .92;
  margin-top: 6px;
  position: relative;
}
.pm-tile.t-primary { background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 60%, white)); }
.pm-tile.t-success { background: linear-gradient(135deg, var(--color-success), color-mix(in srgb, var(--color-success) 60%, white)); }
.pm-tile.t-warning { background: linear-gradient(135deg, var(--color-warning), color-mix(in srgb, var(--color-warning) 60%, white)); }
.pm-tile.t-danger { background: linear-gradient(135deg, var(--color-danger), color-mix(in srgb, var(--color-danger) 60%, white)); }

/* Projects grid — uniform CSS Grid cards (no masonry, fixed height so
   card size never depends on content length). Kebab menu replaces the
   old gear icon; only 3 real project_class values exist in this app
   (danger/info/success, from the project_status lookup table) but the
   default/fallback below covers any future class added via Settings. */
.pm-project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 4px;
}
.pm-pcard {
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--color-border) !important;
  border-left: 4px solid var(--color-secondary) !important;
  box-shadow: var(--shadow-1);
  transition: all var(--duration-fast) var(--easing-standard);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  height: 250px;
  min-width: 0;
  position: relative;
}
.pm-pcard:hover {
  box-shadow: var(--elevation-hover);
  transform: translateY(-3px);
}
.pm-pcard-danger { border-left-color: var(--color-danger) !important; }
.pm-pcard-info { border-left-color: var(--color-info) !important; }
.pm-pcard-success { border-left-color: var(--color-success) !important; }

.pm-pcard-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pm-pcard-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  background: var(--color-secondary);
  flex-shrink: 0;
  margin-top: 1px;
}
.pm-pcard-danger .pm-pcard-icon { background: linear-gradient(135deg, var(--color-danger), color-mix(in srgb, var(--color-danger) 60%, white)); }
.pm-pcard-info .pm-pcard-icon { background: linear-gradient(135deg, var(--color-info), color-mix(in srgb, var(--color-info) 60%, white)); }
.pm-pcard-success .pm-pcard-icon { background: linear-gradient(135deg, var(--color-success), color-mix(in srgb, var(--color-success) 60%, white)); }

.pm-pcard-header-text {
  flex: 1;
  min-width: 0;
}
.pm-pcard-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}
.pm-pcard-title:hover {
  color: var(--color-primary);
}

.pm-pcard-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pm-status-pill {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  border-radius: 99px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 3px 9px !important;
  white-space: nowrap;
}
.pm-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
  display: inline-block;
}
.pm-pcard-menu {
  position: relative;
}
.pm-pcard-kebab {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-secondary);
  font-size: 13px;
}
.pm-pcard-kebab:hover {
  background: var(--color-background);
  color: var(--color-text);
}

.pm-pcard-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 8px;
  flex-wrap: wrap;
}
.pm-pcard-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #475069;
}
.pm-pcard-meta-item i {
  font-size: 11px;
  color: var(--color-secondary);
}
.pm-pcard-meta-item.warn,
.pm-pcard-meta-item.warn i {
  color: var(--color-danger);
}

/* Client + member-count row (Opción B: more info per card) */
.pm-pcard-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: #475069;
  min-width: 0;
}
.pm-pcard-sub-left {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.pm-pcard-sub-left i {
  color: var(--color-secondary);
  font-size: 10.5px;
  flex-shrink: 0;
}
.pm-pcard-sub-left span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-pcard-sub-company {
  font-style: normal;
  color: var(--color-secondary);
}
.pm-pcard-sub-right {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--color-secondary);
  flex-shrink: 0;
  font-size: 11px;
}
.pm-pcard-sub-right i {
  font-size: 10.5px;
}

/* Project date range row */
.pm-pcard-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
}
.pm-pcard-dates i {
  font-size: 10.5px;
}

.pm-pcard-progress-row {
  margin-top: auto;
}
.pm-pcard-progress-label {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 5px;
}
.pm-pcard-progress-label b {
  color: var(--color-text);
  font-size: 12px;
  font-weight: 800;
}
.pm-progress.progress {
  height: 5px;
  border-radius: 99px;
  margin-bottom: 0;
  background: var(--color-background);
}
.pm-progress .pm-progress-bar {
  border-radius: 99px;
}

.pm-pcard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-background);
}
.pm-pcard-budget {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--color-success);
  white-space: nowrap;
}
.pm-pcard-budget i {
  font-size: 10.5px;
  color: var(--color-success);
}
.pm-avatars {
  display: flex;
  align-items: center;
}
/* Smaller avatars (22px, -6px overlap) so more of the team fits per card:
   12 avatars ≈ 198px, which still leaves room for the budget on mobile. */
.pm-avatars .avatar {
  width: 22px;
  height: 22px;
  margin-left: -6px;
  border: 2px solid #fff;
  font-size: 9px;
}
.pm-avatars .avatar:first-child {
  margin-left: 0;
}
.pm-avatars-more {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-background);
  color: var(--color-secondary);
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  margin-left: -6px;
}

/* Responsive: KPI tiles + project grid step down for tablet/mobile.
   iPhone/iPad/tablet are the primary devices for most users here, so
   these breakpoints are not optional polish. */
@media (max-width: 991.98px) {
  .pm-tile-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  .pm-tile-row { grid-template-columns: 1fr; }
  .pm-project-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Gantt — milestone diamond overlay (backlog Tanda 4, item 16 /
   Feedback_2 #3). SVG polygon injected by gantt.php's
   renderMilestoneDiamonds(), one per task that has a milestone
   assigned, positioned at the bar's end (due) date.
   ============================================================ */
.gantt-milestone-diamond {
  fill: var(--color-accent, var(--color-danger));
  stroke: #fff;
  stroke-width: 1.5px;
  cursor: pointer;
}

/* ============================================================
   Gantt page redesign — /projects/gantt. Reuses .pm-kb-header/
   .pm-page-title/.pm-page-subtitle/.pm-kb-header-actions/
   .pm-tile-row/.pm-filter-toolbar/.pm-filter-chip-wrap from the
   Kanban/Projects redesigns (same design system, not a one-off).
   Bar colors use Frappe Gantt's existing custom_class task option
   (see 'bar-wrapper ' + this.task.custom_class in frappe-gantt.js) -
   the class is computed server-side in Projects::gantt() from
   status/days_status already being sent to the view; nothing here
   changes chart data or behavior, only .bar fill color.
   ============================================================ */
.pm-gantt-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pm-gantt-header-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-cat-orange), color-mix(in srgb, var(--color-cat-orange) 60%, white));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 19px;
  flex-shrink: 0;
}
.pm-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--color-border);
  color: var(--color-secondary);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-weight: 700;
  font-size: 13.5px;
  min-height: 44px;
  transition: all var(--duration-fast) var(--easing-standard);
}
.pm-btn-outline:hover {
  color: var(--color-text);
  border-color: var(--color-secondary);
}
.pm-gantt-zoom.select2-container {
  min-width: 140px;
}
.pm-gantt-body {
  padding-top: 0;
}
.pm-gantt-card .card-body#gantt {
  padding: 16px;
  overflow-x: auto;
}
.pm-gantt-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  color: #475069;
}
.pm-gantt-legend .sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}
.pm-gantt-legend-stats {
  margin-left: auto;
  color: var(--color-secondary);
  font-weight: 600;
}

/* Bar status colors via Frappe Gantt's custom_class */
.bar-wrapper.gantt-bar-pending .bar { fill: #94A3B8; }
.bar-wrapper.gantt-bar-progress .bar { fill: var(--color-primary); }
.bar-wrapper.gantt-bar-review .bar { fill: var(--color-cat-orange); }
.bar-wrapper.gantt-bar-done .bar { fill: var(--color-success); }
.bar-wrapper.gantt-bar-delayed .bar { fill: var(--color-danger); }
.bar-wrapper .bar-progress { fill: rgba(0, 0, 0, .15); }
.bar-wrapper .bar {
  rx: 6px;
  ry: 6px;
}

@media (max-width: 767.98px) {
  .pm-gantt-header { flex-direction: column; align-items: flex-start; }
  .pm-kb-header-actions { flex-wrap: wrap; width: 100%; }
}

/* --- Task detail modal redesign (shared #modal-task-detail-part across
   gantt.php/tasks.php/calendar.php - visual only, all ids/names/tab
   plumbing untouched). Dialog/body/footer classes are passed through
   fireModal()'s size/bodyClass/footerClass options in custom.js rather
   than editing the modal template itself. */
.pm-td-dialog { max-width: 720px; }
.pm-td-dialog .modal-content { border-radius: var(--radius-lg); overflow: hidden; border: none; box-shadow: var(--shadow-3); }
.pm-td-dialog .modal-header { border-bottom: 1px solid var(--color-border); padding: var(--space-20) var(--space-24); }
.pm-td-dialog .modal-title { font-weight: 800; }
.pm-td-modal-body { padding: var(--space-24); max-height: 65vh; overflow-y: auto; }
.pm-td-modal-foot { display: flex; align-items: center; justify-content: space-between; padding: var(--space-16) var(--space-24); border-top: 1px solid var(--color-border); }

.pm-td-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-12); margin-bottom: var(--space-16); }
.pm-td-head-left { display: flex; gap: var(--space-12); align-items: flex-start; }
.pm-td-icon { width: 44px; height: 44px; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--color-cat-teal), color-mix(in srgb, var(--color-cat-teal) 65%, white)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.pm-td-title { font-size: 16.5px; font-weight: 800; margin: 0; }
.pm-td-project { font-size: 12px; color: var(--color-primary); font-weight: 700; margin-top: 2px; display: inline-block; }
.pm-td-desc { font-size: 13.5px; color: var(--color-sidebar-text); font-weight: 600; margin-bottom: var(--space-16); line-height: 1.6; }

.pm-td-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-12); margin-bottom: var(--space-16); }
.pm-td-meta-item { background: var(--color-background); border-radius: var(--radius-md); padding: var(--space-12) 14px; }
.pm-td-meta-label { font-size: 10.5px; font-weight: 800; color: var(--color-secondary); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.pm-td-meta-value { font-size: 13px; font-weight: 800; }

.pm-td-tabs.nav-tabs { border-bottom: none; background: var(--color-background); border-radius: var(--radius-md); padding: 4px; gap: 4px; }
.pm-td-tabs.nav-tabs .nav-link { border: none; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--color-secondary); padding: 8px 12px; }
.pm-td-tabs.nav-tabs .nav-link i { margin-right: 6px; }
.pm-td-tabs.nav-tabs .nav-link.active { background: #fff; color: var(--color-text); box-shadow: var(--shadow-1); }
.pm-td-tab-content { padding-top: var(--space-16); }

.pm-td-input-row { display: flex; gap: 10px; margin-bottom: var(--space-16); }
.pm-td-input-row .form-control { border-radius: var(--radius-md); }
.pm-td-send-btn { border-radius: var(--radius-md) !important; width: 44px; flex-shrink: 0; }
.pm-td-comments .media { padding: 12px 0; }

.pm-td-timer-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; border-radius: var(--radius-md); padding: 9px 18px; color: #fff; }

.pm-td-table { margin-top: var(--space-12); }

/* File preview lightbox (dynamically appended, id #pm-file-preview-modal) */
.pm-file-preview-content { border-radius: var(--radius-lg); overflow: hidden; }
.pm-file-preview-media { display: flex; align-items: center; justify-content: center; }
.pm-file-preview-media img { max-width: 100%; max-height: 70vh; border-radius: var(--radius-sm); }
.pm-file-preview-frame { width: 100%; height: 70vh; }
.pm-file-preview-frame iframe { width: 100%; height: 100%; border: none; }
.pm-file-preview-text { max-height: 65vh; overflow: auto; background: var(--color-background); padding: var(--space-16); border-radius: var(--radius-md); font-size: 12.5px; white-space: pre-wrap; }
.pm-file-preview-empty { text-align: center; padding: 40px 20px; color: var(--color-secondary); }
.pm-file-preview-empty i { font-size: 46px; margin-bottom: 14px; display: block; color: var(--color-primary); }
.pm-file-preview-empty p { font-weight: 700; margin-bottom: 16px; }

@media (max-width: 767.98px) {
  .pm-td-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .pm-td-modal-body { max-height: 75vh; }
}

/* --- Project Detail page redesign (projects-detail.php) - visual only,
   every table id/dropzone id/form id/JS-consumed class kept identical
   so users_list/file_list/mydropzone/project-comment-form and the
   project_progress/project_statistics Chart.js canvases keep working. */
.pm-pd-icon { width: 48px; height: 48px; font-size: 20px; border-radius: var(--radius-md); }
.pm-pd-header { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-24); margin-bottom: var(--space-16); }
.pm-pd-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-16); flex-wrap: wrap; margin-bottom: var(--space-16); }
.pm-pd-back { width: 36px; height: 36px; border-radius: var(--radius-md); border: 1px solid var(--color-border); display: flex; align-items: center; justify-content: center; color: var(--color-sidebar-text); text-decoration: none; flex-shrink: 0; }
.pm-pd-title-wrap { display: flex; align-items: center; gap: var(--space-16); }
.pm-pd-title { font-size: 22px; font-weight: 800; margin: 0; }
.pm-pd-status-pill { font-size: 11px; vertical-align: middle; margin-left: 8px; }
.pm-pd-budget { font-size: 20px; font-weight: 800; color: var(--color-success); }
.pm-pd-breadcrumb { font-size: 12.5px; color: var(--color-secondary); font-weight: 600; margin-top: 2px; }
.pm-pd-breadcrumb a { color: var(--color-secondary); text-decoration: none; }
.pm-pd-desc { font-size: 13.5px; color: var(--color-sidebar-text); font-weight: 600; margin: 0 0 var(--space-16) 64px; max-width: 900px; }
.pm-pd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: 64px; }
.pm-pd-btn { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; padding: 9px 14px; border-radius: var(--radius-md); border: 1px solid var(--color-border); background: #fff; color: var(--color-sidebar-text); text-decoration: none; }
.pm-pd-btn.primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pm-pd-btn.danger { color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 40%, white); }

.pm-pd-tile-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-12); margin-bottom: var(--space-16); }
.pm-pd-tile { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-12) 14px; box-shadow: var(--shadow-1); }
.pm-pd-tile .lbl { font-size: 11px; font-weight: 700; color: var(--color-secondary); text-transform: uppercase; letter-spacing: .02em; }
.pm-pd-tile .val { font-size: 19px; font-weight: 800; margin-top: 6px; }
.pm-pd-tile .val.pm-pd-tile-date { font-size: 14px; }
.pm-pd-tile.accent-danger .val { color: var(--color-danger); }
.pm-pd-tile.accent-success .val { color: var(--color-success); }

.pm-pd-grid { display: grid; grid-template-columns: 0.8fr 1.6fr; gap: var(--space-16); margin-bottom: var(--space-16); }
.pm-pd-chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-16); margin-bottom: var(--space-16); }
.pm-pd-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.pm-pd-card-header { padding: var(--space-16) var(--space-20); border-bottom: 1px solid var(--color-border); }
.pm-pd-card-header h4 { font-size: 14.5px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 9px; }
.pm-pd-card-header h4 i { color: var(--color-primary); font-size: 13px; }
.pm-pd-card-body { padding: var(--space-20); }

.pm-pd-info-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--color-border); font-size: 13px; }
.pm-pd-info-row:last-child { border-bottom: none; }
.pm-pd-info-row .k { color: var(--color-secondary); font-weight: 700; }
.pm-pd-info-row .v { font-weight: 700; text-align: right; }

.pm-pd-table thead th { font-size: 11px; text-transform: uppercase; color: var(--color-secondary); }

.pm-pd-comments-card { margin-bottom: var(--space-24); }
.pm-pd-comment-form input.form-control { border-radius: var(--radius-md); }
.pm-pd-send-btn { border-radius: var(--radius-md) !important; }

/* Team members as compact avatar chips (replaces the old AJAX table so a
   15-20 member project doesn't render as a long vertical list). */
.pm-pd-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.pm-pd-team-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  min-width: 0;
  cursor: default;
  transition: border-color var(--duration-fast) var(--easing-standard), background var(--duration-fast) var(--easing-standard), transform var(--duration-fast) var(--easing-standard);
}
.pm-pd-team-chip:hover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 4%, white);
  transform: translateY(-1px);
}
.pm-pd-team-chip .avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  font-size: 11px;
}
.pm-pd-team-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.pm-pd-team-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-pd-team-email {
  font-size: 11px;
  color: var(--color-secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-pd-team-empty {
  font-size: 13px;
  color: var(--color-secondary);
  font-weight: 600;
  padding: 22px 0;
  text-align: center;
}

@media (max-width: 991.98px) {
  .pm-pd-grid, .pm-pd-chart-row { grid-template-columns: 1fr; }
  .pm-pd-tile-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 575.98px) {
  .pm-pd-tile-row { grid-template-columns: repeat(2, 1fr); }
  .pm-pd-desc, .pm-pd-actions { margin-left: 0; }
}

/* --- Timesheet (Registro de Horas) redesign - reuses the shared
   .pm-kb-header/.pm-tile-row/.pm-filter-toolbar components already
   established for Projects/Gantt rather than duplicating them; only
   genuinely new pieces (header icon, weekly quick-entry card, table
   wrapper) get their own classes here. #timesheet_list/.timesheet_filter/
   modal-add-timesheet/-edit-timesheet hooks are all unchanged. */
.pm-ts-header-icon {
  width: 46px; height: 46px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-cat-green), color-mix(in srgb, var(--color-cat-green) 60%, white));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 19px; flex-shrink: 0;
}
.pm-tile.t-purple { background: linear-gradient(135deg, var(--color-cat-purple), color-mix(in srgb, var(--color-cat-purple) 60%, white)); }

.pm-ts-week-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-20) 22px; margin-bottom: var(--space-16); box-shadow: var(--shadow-1); }
.pm-ts-week-title { font-size: 14.5px; font-weight: 800; margin-bottom: var(--space-16); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pm-ts-week-title i { color: var(--color-cat-green); }
.pm-ts-week-hint { font-weight: 600; color: var(--color-secondary); font-size: 12px; }
.pm-ts-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.pm-ts-week-day { text-align: center; }
.pm-ts-week-day .d { font-size: 10.5px; font-weight: 700; color: var(--color-secondary); margin-bottom: 6px; text-transform: uppercase; }
.pm-ts-week-day input { text-align: center; border-radius: var(--radius-sm); }
.pm-ts-week-day.today input { border-color: var(--color-success); background: color-mix(in srgb, var(--color-success) 8%, white); }
.pm-ts-week-save { margin-top: var(--space-16); text-align: right; }

.pm-ts-table-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: var(--space-16) var(--space-20); }

@media (max-width: 767.98px) {
  .pm-ts-week-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .pm-ts-week-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Calendar page redesign (calendar.php) - the toolbar (prev/next/
   today, title, month/week/day) and every day cell/event pill are
   rendered by FullCalendar itself into #calendar, so this is a CSS-only
   reskin of FullCalendar's own classes (same technique already used for
   Frappe Gantt's .bar-wrapper) - no JS/init options touched, event
   colors keep coming from the existing className: 'bg-<task_class>'
   Bootstrap classes set server-side. */
.pm-cal-header-icon {
  width: 46px; height: 46px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-danger), color-mix(in srgb, var(--color-danger) 60%, white));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 19px; flex-shrink: 0;
}
.pm-cal-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: var(--space-16) var(--space-20); margin-bottom: var(--space-16); }

.pm-cal-card #calendar .fc-toolbar-title { font-size: 18px; font-weight: 800; }
.pm-cal-card #calendar .fc-button-primary {
  background: #fff; border: 1px solid var(--color-border); color: var(--color-sidebar-text);
  box-shadow: none; text-transform: capitalize; font-weight: 700; font-size: 12.5px;
}
.pm-cal-card #calendar .fc-button-primary:not(:disabled).fc-button-active,
.pm-cal-card #calendar .fc-button-primary:not(:disabled):active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pm-cal-card #calendar .fc-today-button { text-transform: capitalize; }
.pm-cal-card #calendar .fc-col-header-cell { background: var(--color-background); }
.pm-cal-card #calendar .fc-col-header-cell-cushion { font-size: 11px; font-weight: 800; color: var(--color-secondary); text-transform: uppercase; padding: 10px 4px; }
.pm-cal-card #calendar .fc-daygrid-day-number { font-size: 12.5px; font-weight: 700; padding: 8px; }
.pm-cal-card #calendar .fc-day-today { background: color-mix(in srgb, var(--color-primary) 6%, white) !important; }
.pm-cal-card #calendar .fc-day-today .fc-daygrid-day-number { color: var(--color-primary); }
.pm-cal-card #calendar .fc-event { border-radius: 6px; border: none; font-size: 11px; font-weight: 700; padding: 2px 6px; margin-bottom: 2px; }
.pm-cal-card #calendar .fc-scrollgrid { border-radius: var(--radius-md); overflow: hidden; }

.pm-cal-legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 14px 4px; }
.pm-cal-legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--color-sidebar-text); }
.pm-cal-legend-item .sw { width: 10px; height: 10px; border-radius: 3px; }

@media (max-width: 767.98px) {
  .pm-cal-card #calendar .fc-toolbar { flex-direction: column; gap: 10px; }
}

/* --- Todo ("Que hacer") redesign (todo.php). The check-todo/delete_todo
   JS reads/toggles classes on exact elements (label.check-todo's own
   classes + its 'strong' child, and a *direct sibling* .text-small div
   inside the same .custom-checkbox parent) - kept flat via CSS Grid
   instead of nested wrapper divs so those existing selectors keep
   matching untouched. */
.pm-todo-header-icon {
  width: 46px; height: 46px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-cat-orange), color-mix(in srgb, var(--color-cat-orange) 60%, white));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 19px; flex-shrink: 0;
}
.pm-todo-layout { display: grid; grid-template-columns: 1fr 260px; gap: var(--space-16); align-items: flex-start; }
/* overflow left visible (not hidden) so the per-item .dropdown-menu
   (Editar/Eliminar) isn't clipped by the card's rounded-corner
   boundary; first/last-child radii below handle the visual rounding
   instead. */
.pm-todo-list-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.pm-todo-item.custom-checkbox:first-child { border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); }
.pm-todo-item.custom-checkbox:last-child { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }

.pm-todo-item.custom-checkbox {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-background);
}
.pm-todo-item.custom-checkbox:last-child { border-bottom: none; }
.pm-todo-checkbox-input { display: none; }
.pm-todo-check { grid-column: 1; grid-row: 1 / span 2; cursor: pointer; margin: 0; display: flex; }
.pm-todo-check-box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--color-border); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; flex-shrink: 0; }
.pm-todo-check.checked .pm-todo-check-box { background: var(--color-success); border-color: var(--color-success); }
.pm-todo-check strong { grid-column: 2; grid-row: 1; font-size: 14px; font-weight: 700; margin-left: 34px; }
.pm-todo-due { grid-column: 2; grid-row: 2; margin-left: 34px; font-size: 11.5px; font-weight: 700; margin-top: 3px; }
.pm-todo-due-dot { font-size: 6px; margin-right: 5px; vertical-align: middle; }
.pm-todo-actions { grid-column: 3; grid-row: 1 / span 2; }
.pm-todo-menu-btn { color: var(--color-secondary); padding: 6px 10px; }

.pm-todo-filter-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 10px; }
.pm-todo-filter-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-md); font-size: 13.5px; font-weight: 700; color: var(--color-sidebar-text); text-decoration: none; margin-bottom: 2px; }
.pm-todo-filter-item i { width: 18px; text-align: center; color: var(--color-secondary); }
.pm-todo-filter-item.active { background: var(--color-primary); color: #fff; }
.pm-todo-filter-item.active i { color: #fff; }

.pm-todo-empty { text-align: center; padding: 50px 20px; color: var(--color-secondary); }
.pm-todo-empty i { font-size: 40px; margin-bottom: 14px; display: block; }
.pm-todo-empty p { font-weight: 700; }

@media (max-width: 767.98px) {
  .pm-todo-layout { grid-template-columns: 1fr; }
}

/* --- Notes redesign (notes.php). #notes_project_filter, .modal-edit-notes/
   .delete_notes, #modal-add-notes/-edit-notes untouched. */
.pm-notes-header-icon {
  width: 46px; height: 46px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0891B2, color-mix(in srgb, #0891B2 60%, white));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 19px; flex-shrink: 0;
}
.pm-notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-16); }
.pm-note-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: var(--space-20); border-top: 4px solid #FBBF24; transition: transform var(--duration-fast) var(--easing-standard), box-shadow var(--duration-fast) var(--easing-standard); display: flex; flex-direction: column; min-height: 150px; }
.pm-note-card:hover { box-shadow: var(--elevation-hover); transform: translateY(-3px); }
.pm-note-icon { width: 32px; height: 32px; border-radius: 9px; background: #fef9c3; color: #b45309; display: flex; align-items: center; justify-content: center; font-size: 13px; margin-bottom: 12px; }
.pm-note-title { font-size: 14.5px; font-weight: 800; margin-bottom: 10px; flex: 1; }
.pm-note-project-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 12%, white); padding: 4px 10px; border-radius: 99px; margin-bottom: 14px; width: fit-content; }
.pm-note-footer { display: flex; gap: 14px; padding-top: 12px; border-top: 1px solid var(--color-background); }
.pm-note-footer a { font-size: 12px; font-weight: 700; color: var(--color-secondary); text-decoration: none; display: flex; align-items: center; gap: 5px; }
.pm-note-footer a.pm-note-delete { color: var(--color-danger); }

.pm-notes-empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--color-secondary); }
.pm-notes-empty i { font-size: 40px; margin-bottom: 14px; display: block; }
.pm-notes-empty p { font-weight: 700; }

@media (max-width: 991.98px) { .pm-notes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .pm-notes-grid { grid-template-columns: 1fr; } }

/* --- Chat ("Charla") redesign (chat.php). .user-selected-for-chat/
   #mychatbox/#current_chating_user/#delete_chat/#chat-form/#to_id/
   #chat_input/.chat-content/.new_msg all untouched - chat.js overwrites
   #current_chating_user's innerHTML on every user switch (avatar figure
   + .media-body > .font-weight-bold), so that content is styled here via
   descendant selectors rather than new markup. $.chatCtrl (stisla.js)
   still generates .chat-item.chat-left/.chat-right > .chat-details >
   .chat-text for every message - untouched, restyled via CSS only. */
.pm-chat-header-icon {
  width: 46px; height: 46px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 60%, white));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 19px; flex-shrink: 0;
}
.pm-chat-shell { display: grid; grid-template-columns: 300px 1fr; grid-template-rows: 1fr; gap: var(--space-16); height: calc(100vh - 230px); min-height: 420px; }

.pm-chat-users-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); overflow: hidden; display: flex; flex-direction: column; margin: 0; min-height: 0; }
.pm-chat-users-search { padding: 14px; border-bottom: 1px solid var(--color-background); }
.pm-chat-users-search-wrap { position: relative; }
.pm-chat-users-search-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--color-secondary); font-size: 12px; }
.pm-chat-users-search-wrap input { width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 9px 14px 9px 34px; font-size: 13px; background: var(--color-background); }
.pm-chat-users-list { flex: 1; overflow-y: auto; margin: 0; min-height: 0; }
.pm-chat-user-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; border-left: 3px solid transparent; }
.pm-chat-user-row:hover { background: var(--color-background); }
.pm-chat-user-row.active { background: color-mix(in srgb, var(--color-primary) 8%, white); border-left-color: var(--color-primary); }
.pm-chat-user-row .avatar, .pm-chat-user-row .user-avatar { flex-shrink: 0; }
.pm-chat-user-row .media-body .font-weight-bold { font-size: 13.5px; }
.pm-chat-new-msg { display: inline-flex; align-items: center; gap: 6px; font-size: 11px !important; font-weight: 700; color: var(--color-primary) !important; }
.pm-chat-new-msg .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-primary); flex-shrink: 0; }

.pm-chat-panel { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); display: flex; flex-direction: column; overflow: hidden; margin: 0; min-height: 0; }
.pm-chat-panel-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--color-border); }
.pm-chat-panel-header #current_chating_user { display: flex; align-items: center; gap: 12px; margin: 0; }
.pm-chat-panel-header #current_chating_user h3 { font-size: 14.5px; font-weight: 800; margin: 0; }
.pm-chat-panel-header #current_chating_user .font-weight-bold { font-size: 14.5px; font-weight: 800 !important; }
.pm-chat-icon-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: #fff; color: var(--color-danger); display: flex; align-items: center; justify-content: center; }

.pm-chat-content { flex: 1; padding: 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: var(--color-background); min-height: 0; }
.pm-chat-content .chat-item { display: flex; }
.pm-chat-content .chat-item.chat-left { justify-content: flex-start; }
.pm-chat-content .chat-item.chat-right { justify-content: flex-end; }
.pm-chat-content .chat-details { max-width: 60%; }
.pm-chat-content .chat-text { padding: 10px 16px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.pm-chat-content .chat-left .chat-text { background: #fff; color: var(--color-text); border-bottom-left-radius: 4px; box-shadow: var(--shadow-1); }
.pm-chat-content .chat-right .chat-text { background: var(--color-primary); color: #fff; border-bottom-right-radius: 4px; }

.pm-chat-form-wrap { padding: 14px 20px; border-top: 1px solid var(--color-border); }
.pm-chat-form-wrap #chat-form { display: flex; gap: 10px; }
.pm-chat-form-wrap #chat_input { flex: 1; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 11px 16px; font-size: 13.5px; }
.pm-chat-send-btn { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--color-primary); color: #fff; border: none; flex-shrink: 0; }

@media (max-width: 767.98px) {
  .pm-chat-shell { grid-template-columns: 1fr; }
  .pm-chat-users-card { max-height: 260px; }
}

/* --- Project files redesign (upload card + files table) inside
   projects-detail.php. Upload and browse are fully decoupled: Dropzone
   runs with previewsContainer:false so it can never render a file of
   its own (progress/success/error live in separate elements below the
   dropzone), and the files table (#file_list) is the single place
   files are listed - client-side search/sort/filter/pagination via
   bootstrap-table's own API, restyled to a flat/minimal look instead
   of its default Bootstrap 4 chrome. */

/* Upload card */
.pm-files-dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-background);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--easing-standard), background var(--duration-fast) var(--easing-standard);
}
.pm-files-dropzone:hover,
.pm-files-dropzone.pm-files-dropzone-active {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 5%, var(--color-background));
}
.pm-files-dropzone-icon { font-size: 38px; color: var(--color-primary); margin-bottom: 14px; }
.pm-files-dropzone-text { font-size: 15px; font-weight: 800; color: var(--color-text); }
.pm-files-dropzone-or { font-size: 12px; font-weight: 700; color: var(--color-secondary); margin: 10px 0; text-transform: uppercase; letter-spacing: .04em; }
.pm-files-browse-btn {
  background: var(--color-primary); color: #fff; border: none; border-radius: var(--radius-md);
  padding: 10px 22px; font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.pm-files-browse-btn:hover { background: color-mix(in srgb, var(--color-primary) 88%, black); }
.pm-files-dropzone-hint { font-size: 11.5px; color: var(--color-secondary); font-weight: 600; margin-top: 16px; }

.pm-files-progress { margin-top: 16px; }
.pm-files-progress-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--color-sidebar-text); margin-bottom: 6px; }
.pm-files-progress-track { height: 8px; border-radius: 99px; background: var(--color-background); overflow: hidden; }
.pm-files-progress-bar { height: 100%; width: 0; border-radius: 99px; background: var(--color-primary); transition: width .2s ease; }

.pm-files-feedback { margin-top: 16px; padding: 11px 16px; border-radius: var(--radius-md); font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.pm-files-feedback-success { background: color-mix(in srgb, var(--color-success) 12%, white); color: var(--color-success); }
.pm-files-feedback-error { background: color-mix(in srgb, var(--color-danger) 12%, white); color: var(--color-danger); }

/* Files list card header */
.pm-files-list-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.pm-files-last-updated { font-size: 11.5px; font-weight: 700; color: var(--color-secondary); }

/* Toolbar: search + sort */
.pm-files-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pm-files-search-wrap { position: relative; flex: 1; min-width: 220px; }
.pm-files-search-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--color-secondary); font-size: 12px; }
.pm-files-search-wrap input { width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 9px 14px 9px 36px; font-size: 13px; background: var(--color-background); }
.pm-files-sort-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pm-files-sort-wrap label { font-size: 12px; font-weight: 700; color: var(--color-secondary); margin: 0; white-space: nowrap; }
.pm-files-sort-select { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 8px 12px; font-size: 12.5px; font-weight: 700; background: #fff; }

/* Filter pills */
.pm-files-filter-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pm-files-pill { border: 1px solid var(--color-border); background: #fff; color: var(--color-sidebar-text); border-radius: 99px; padding: 7px 15px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all var(--duration-fast) var(--easing-standard); }
.pm-files-pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pm-files-pill.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* Table */
.pm-files-table-wrap { border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.pm-files-table-wrap .fixed-table-toolbar { display: none; } /* using our own toolbar above */
.pm-files-table { width: 100%; margin: 0; }
.pm-files-table thead th {
  background: var(--color-background); border: none !important; border-bottom: 1px solid var(--color-border) !important;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--color-secondary);
  padding: 12px 18px;
}
.pm-files-table tbody td { padding: 14px 18px; border-top: 1px solid var(--color-background); font-size: 13.5px; vertical-align: middle; }
.pm-files-table tbody tr:hover { background: var(--color-background); }
.pm-files-table th.sortable { cursor: pointer; }

.pm-files-name-cell { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.pm-files-name-icon { font-size: 16px; flex-shrink: 0; }
.pm-files-icon-danger { color: var(--color-danger); }
.pm-files-icon-primary { color: var(--color-primary); }
.pm-files-icon-success { color: var(--color-success); }
.pm-files-icon-warning { color: var(--color-warning); }
.pm-files-icon-purple { color: var(--color-cat-purple); }
.pm-files-icon-secondary { color: var(--color-secondary); }

.pm-files-type-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--color-background); color: var(--color-sidebar-text); }
.pm-files-type-danger { background: color-mix(in srgb, var(--color-danger) 10%, white); color: var(--color-danger); }
.pm-files-type-primary { background: color-mix(in srgb, var(--color-primary) 10%, white); color: var(--color-primary); }
.pm-files-type-success { background: color-mix(in srgb, var(--color-success) 10%, white); color: var(--color-success); }
.pm-files-type-warning { background: color-mix(in srgb, var(--color-warning) 15%, white); color: color-mix(in srgb, var(--color-warning) 70%, black); }
.pm-files-type-purple { background: color-mix(in srgb, var(--color-cat-purple) 10%, white); color: var(--color-cat-purple); }
.pm-files-type-secondary { background: var(--color-background); color: var(--color-secondary); }

.pm-files-actions { display: flex; gap: 6px; }
.pm-files-action-btn { width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: #fff; color: var(--color-sidebar-text); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.pm-files-action-btn:hover { background: var(--color-background); color: var(--color-text); }
.pm-files-action-btn.pm-files-action-danger { color: var(--color-danger); }
.pm-files-action-btn.pm-files-action-danger:hover { background: color-mix(in srgb, var(--color-danger) 8%, white); border-color: color-mix(in srgb, var(--color-danger) 30%, white); }
.pm-files-action-btn.pm-files-action-replace { color: var(--color-primary); }
.pm-files-action-btn.pm-files-action-replace:hover { background: color-mix(in srgb, var(--color-primary) 8%, white); border-color: color-mix(in srgb, var(--color-primary) 30%, white); }

/* bootstrap-table pagination, restyled minimal */
.pm-files-table-wrap .fixed-table-pagination { padding: 12px 18px; border-top: 1px solid var(--color-border); background: #fff; font-size: 12.5px; }
.pm-files-table-wrap .pagination-detail, .pm-files-table-wrap .pagination-info { color: var(--color-secondary); font-weight: 600; }
.pm-files-table-wrap .page-list .btn-group .btn { border: 1px solid var(--color-border); background: #fff; color: var(--color-sidebar-text); font-weight: 700; }
.pm-files-table-wrap .pagination { margin: 0; }
.pm-files-table-wrap .pagination .page-link { border: 1px solid var(--color-border); color: var(--color-sidebar-text); font-weight: 700; margin-left: -1px; }
.pm-files-table-wrap .pagination .page-item.active .page-link { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* Empty state */
.pm-files-empty { text-align: center; padding: 56px 20px; }
.pm-files-empty i { font-size: 46px; color: var(--color-secondary); opacity: .5; margin-bottom: 16px; display: block; }
.pm-files-empty h5 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.pm-files-empty p { font-size: 13.5px; color: var(--color-secondary); margin-bottom: 20px; }

@media (max-width: 767.98px) {
  .pm-files-toolbar { flex-direction: column; align-items: stretch; }
  .pm-files-sort-wrap { justify-content: space-between; }
  .pm-files-table thead { display: none; }
  .pm-files-table, .pm-files-table tbody, .pm-files-table tr, .pm-files-table td { display: block; width: 100%; }
  .pm-files-table tr { border-bottom: 1px solid var(--color-border); padding: 10px 0; }
  .pm-files-table td { padding: 6px 18px; border-top: none; }
}

/* Header Maintenance Mode toggle - same visual language as the language
   switcher next to it: a rounded icon button with hover state, vertically
   centered with its neighbors (bell/lang/avatar). The status dot under the
   wrench shows live state: green = system normal, red = maintenance ACTIVE
   (toggled from navbar.php's maintenance panel JS). */
.pm-maintenance-item {
  display: flex;
  align-items: center;
}
a.nav-link.pm-maintenance-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  transition: background-color .15s ease, color .15s ease;
}
.pm-maintenance-toggle:hover {
  background: var(--color-background);
  color: var(--color-text);
}
.pm-maintenance-toggle .fa-tools {
  font-size: 17px;
  line-height: 1;
}
.pm-maintenance-dot {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399; /* green: system normal */
  border: 1.5px solid var(--color-header);
  box-sizing: content-box;
  transition: background-color .3s ease;
}
.pm-maintenance-dot.active {
  background: #f87171; /* red: maintenance ACTIVE */
}

/* Header language switcher */
a.nav-link.pm-lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  transition: background-color .15s ease;
}
.pm-lang-toggle:hover { background: var(--color-background); }
.pm-lang-toggle .pm-lang-flag { font-size: 18px; line-height: 1; }
.pm-lang-toggle .pm-lang-code { font-size: 12.5px; font-weight: 700; color: var(--color-sidebar-text); text-transform: capitalize; }
.pm-lang-menu { min-width: 190px; padding: 6px; }
.pm-lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-weight: 600;
  font-size: 13.5px;
}
.pm-lang-option .pm-lang-flag { font-size: 17px; line-height: 1; }
.pm-lang-option:hover { background: var(--color-background); }
.pm-lang-option.active { background: color-mix(in srgb, var(--color-primary) 8%, white); color: var(--color-primary); }
.pm-lang-option .pm-lang-check { margin-left: auto; font-size: 11px; color: var(--color-primary); }

/* Users grid: toolbar + compact cards */
.pm-users-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pm-users-search {
  position: relative;
  flex: 1 1 280px;
  max-width: 360px;
}
.pm-users-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-secondary);
  font-size: 13px;
}
.pm-users-search input { padding-left: 34px; }
.pm-users-role-filter { max-width: 190px; }
.pm-users-count {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-secondary);
}
.pm-user-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-1);
  transition: all var(--duration-fast) var(--easing-standard);
  height: 100%;
}
.pm-user-card:hover {
  box-shadow: var(--elevation-hover);
  transform: translateY(-2px);
}
.pm-user-card-body { padding: 16px; }
.pm-user-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.pm-user-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  object-fit: cover;
}
.pm-user-card-identity { min-width: 0; flex: 1; }
.pm-user-card-name {
  font-weight: 800;
  font-size: 14.5px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-user-card-email {
  font-size: 12px;
  color: var(--color-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-user-card-edit {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-secondary);
  transition: background-color .15s ease, color .15s ease;
}
.pm-user-card-edit:hover { background: var(--color-background); color: var(--color-primary); }
.pm-user-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.pm-user-card-stats {
  display: flex;
  gap: 18px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  font-size: 12.5px;
  color: var(--color-secondary);
  font-weight: 600;
}
.pm-user-card-stat-value {
  font-weight: 800;
  color: var(--color-text);
}
.pm-users-empty { text-align: center; padding: 56px 20px; }
.pm-users-empty i { font-size: 40px; color: var(--color-secondary); opacity: .5; margin-bottom: 14px; display: block; }
.pm-users-empty p { font-size: 13.5px; color: var(--color-secondary); }

/* ============================================================
   Users cards + list — approved mockup mockup-users-redesign.html
   (Cards ⇄ List toggle). The existing grid/toolbar/filter logic is
   untouched; this adds the toolbar's right-side view switch, the
   stat strip (total/active/deactivated) and the list table that
   shares the same search + role filter, with sortable columns.
   ============================================================ */
.pm-users-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.pm-users-toolbar-right .pm-users-count { margin-left: 0; }
.pm-users-view-switch {
  display: flex;
  background: var(--color-background);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.pm-users-view-switch button {
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all var(--duration-fast) var(--easing-standard);
  cursor: pointer;
}
.pm-users-view-switch button.active {
  background: #fff;
  color: var(--color-primary);
  box-shadow: var(--shadow-1);
}

.pm-users-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.pm-users-stat {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: var(--shadow-1);
}
.pm-users-stat-ic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.pm-users-stat-ic.st-blue   { background: color-mix(in srgb, var(--color-primary) 10%, white); color: var(--color-primary); }
.pm-users-stat-ic.st-green  { background: color-mix(in srgb, var(--color-success) 12%, white); color: var(--color-success); }
.pm-users-stat-ic.st-red    { background: color-mix(in srgb, var(--color-danger) 10%, white); color: var(--color-danger); }
.pm-users-stat-value { font-size: 20px; font-weight: 800; line-height: 1; }
.pm-users-stat-label { font-size: 11.5px; color: var(--color-secondary); font-weight: 700; margin-top: 3px; }

.pm-users-table-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.pm-users-table { margin: 0; }
.pm-users-table thead th {
  background: #F8FAFD;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--color-secondary);
  font-weight: 800;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.pm-users-table thead th.sortable { cursor: pointer; user-select: none; }
.pm-users-table thead th.sortable:hover { color: var(--color-primary); }
.pm-users-table thead th.sorted { color: var(--color-primary); }
.pm-users-table thead th .sort-ic { margin-left: 5px; font-size: 10px; opacity: .5; }
.pm-users-table thead th.sorted .sort-ic { opacity: 1; }
.pm-users-table tbody td {
  padding: 11px 16px;
  vertical-align: middle;
  font-size: 13px;
  border-bottom: 1px solid #F1F4FA;
}
.pm-users-table tbody tr { transition: background var(--duration-fast) var(--easing-standard); }
.pm-users-table tbody tr:hover { background: color-mix(in srgb, var(--color-primary) 4%, white); }
.pm-users-table tbody tr:last-child td { border-bottom: none; }

.pm-users-tbl-member { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pm-users-tbl-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}
.pm-users-tbl-name { font-weight: 800; color: var(--color-text); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-users-tbl-email { font-size: 11.5px; color: var(--color-secondary); }
.pm-users-tbl-role {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--color-primary) 10%, white);
  color: var(--color-primary);
}
.pm-users-tbl-role.team { background: color-mix(in srgb, var(--color-success) 12%, white); color: #15803D; }
.pm-users-tbl-num { font-weight: 800; color: var(--color-text); }
.pm-users-tbl-actions { display: flex; gap: 5px; justify-content: flex-end; }
.pm-users-tbl-action {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #fff;
  color: #475069;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  transition: all var(--duration-fast) var(--easing-standard);
}
.pm-users-tbl-action:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, white);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

@media (max-width: 767.98px) {
  .pm-users-stats { grid-template-columns: 1fr; }
  .pm-users-toolbar-right { margin-left: 0; }
  .pm-users-count { margin-left: 0; }
}

/* ============================================================
   Expert Directory cards ⇄ list — same Cards/List pattern as
   /users (mockup-users-redesign.html), applied to members.php.
   Reuses the .pm-users-stats / .pm-users-view-switch components;
   only the card grid itself is new. The bootstrap-table (table-1),
   .pm-member-check checkboxes, check-all and the bulk-assign modal
   hooks are all untouched; the JS only syncs checkbox state between
   the two views so the counter stays correct.
   ============================================================ */
.pm-members-grid-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 14px;
  min-height: 20px;
}
.pm-members-select-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-secondary);
  cursor: pointer;
  user-select: none;
}
.pm-members-select-all input {
  width: 15px;
  height: 15px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.pm-member-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-1);
  height: 100%;
  transition: all var(--duration-fast) var(--easing-standard);
}
.pm-member-card:hover {
  box-shadow: var(--elevation-hover);
  transform: translateY(-2px);
}
.pm-member-card-body { padding: 16px; }
.pm-member-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.pm-member-card-check {
  width: 15px;
  height: 15px;
  accent-color: var(--color-primary);
  align-self: center;
  flex-shrink: 0;
  cursor: pointer;
}
.pm-member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
}
.pm-member-card-identity { min-width: 0; flex: 1; }
.pm-member-card-name {
  font-weight: 800;
  font-size: 14.5px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-member-card-email {
  font-size: 12px;
  color: var(--color-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-member-card-view {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: #475069;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--duration-fast) var(--easing-standard);
}
.pm-member-card-view:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, white);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.pm-member-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.pm-member-card-badges .badge {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 7px;
}
.pm-member-org {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-cat-purple, #7C3AED) 8%, white);
  border: 1px solid var(--color-border);
  padding: 4px 10px;
  border-radius: 7px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-member-card-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}
.pm-member-card-roles .badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 99px;
}

/* ============================================================
   Chat redesign (approved mockup): conversation sidebar,
   timestamped messages with avatars/date dividers, typing
   indicator, and the new composer. Reuses design tokens.
   ============================================================ */
.pm-chat-conv-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 0;
}
.pm-chat-conv-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 14px 10px;
  border-bottom: 1px solid var(--color-background);
}
.pm-chat-conv-tab {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-secondary);
  padding: 6px 0;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all .15s ease;
}
.pm-chat-conv-tab:hover { background: var(--color-background); }
.pm-chat-conv-tab.active {
  background: color-mix(in srgb, var(--color-primary) 10%, #fff);
  color: var(--color-primary);
}
.pm-chat-conv-list {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  min-height: 0;
}
.pm-chat-conv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .12s ease;
}
.pm-chat-conv-row:hover { background: var(--color-background); }
.pm-chat-conv-row.active {
  background: color-mix(in srgb, var(--color-primary) 8%, #fff);
  border-left-color: var(--color-primary);
}
.pm-chat-conv-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}
.pm-chat-conv-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.pm-chat-conv-avatar.ph {
  background: linear-gradient(135deg, var(--color-primary), #60A5FA);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.pm-chat-presence {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #CBD5E1;
  border: 2px solid #fff;
}
.pm-chat-presence.online { background: var(--color-success, #16A34A); }
.pm-chat-conv-body {
  flex: 1;
  min-width: 0;
}
.pm-chat-conv-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.pm-chat-conv-name {
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-chat-conv-time {
  font-size: 10.5px;
  color: var(--color-secondary);
  font-weight: 700;
  flex-shrink: 0;
}
.pm-chat-conv-last {
  font-size: 11.5px;
  color: var(--color-secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.pm-chat-conv-last.unread { color: var(--color-text); font-weight: 700; }
.pm-chat-conv-unread {
  margin-left: auto;
  background: var(--color-primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 99px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

/* panel header */
.pm-chat-panel-header { padding: 14px 20px; }
.pm-chat-panel-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pm-chat-panel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.pm-chat-panel-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.pm-chat-panel-avatar.ph {
  background: linear-gradient(135deg, var(--color-primary), #60A5FA);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.pm-chat-panel-name { font-size: 14.5px; font-weight: 800; }
.pm-chat-panel-status {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-success, #16A34A);
  display: flex;
  align-items: center;
  gap: 5px;
}
.pm-chat-panel-status i { font-size: 8px; }
.pm-chat-panel-status.offline { color: var(--color-secondary); }
.pm-chat-panel-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.pm-chat-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
}
.pm-chat-icon-btn:hover { background: var(--color-background); }
.pm-chat-icon-btn.danger { color: var(--color-danger); }
.pm-chat-icon-btn.danger:hover {
  background: color-mix(in srgb, var(--color-danger) 8%, #fff);
  border-color: color-mix(in srgb, var(--color-danger) 30%, #fff);
}

/* message stream */
.pm-chat-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-secondary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 6px 0 2px;
}
.pm-chat-date-divider::before,
.pm-chat-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.pm-chat-item {
  display: flex;
  gap: 10px;
  max-width: 72%;
}
.pm-chat-item.chat-right {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.pm-chat-item.chat-left { align-self: flex-start; }
.pm-chat-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  overflow: hidden;
}
.pm-chat-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pm-chat-msg-avatar.ph {
  background: linear-gradient(135deg, var(--color-primary), #60A5FA);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}
.pm-chat-msg { display: flex; flex-direction: column; min-width: 0; }
.pm-chat-msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-secondary);
}
.pm-chat-item.chat-right .pm-chat-msg-meta { flex-direction: row-reverse; }
.pm-chat-msg-meta .pm-chat-author { color: #334155; }
.pm-chat-text {
  padding: 10px 15px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}
.pm-chat-item.chat-left .pm-chat-text {
  background: #fff;
  color: var(--color-text);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-1);
}
.pm-chat-item.chat-right .pm-chat-text {
  background: var(--color-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.pm-chat-msg-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-secondary);
}
.pm-chat-item.chat-right .pm-chat-msg-foot { justify-content: flex-end; }
.pm-chat-checks { color: #94A3B8; letter-spacing: -2px; }
.pm-chat-checks.read { color: #38BDF8; }

/* typing indicator */
.pm-chat-item.pm-chat-typing .pm-chat-text {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 13px 16px;
}
.pm-chat-item.pm-chat-typing .pm-chat-text span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94A3B8;
  animation: pmTyping 1.2s infinite ease-in-out;
}
.pm-chat-item.pm-chat-typing .pm-chat-text span:nth-child(2) { animation-delay: .15s; }
.pm-chat-item.pm-chat-typing .pm-chat-text span:nth-child(3) { animation-delay: .3s; }
@keyframes pmTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* empty state */
.pm-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-secondary);
  gap: 12px;
  text-align: center;
  padding: 30px;
}
.pm-chat-empty-ic {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: color-mix(in srgb, var(--color-primary) 45%, #fff);
  box-shadow: var(--shadow-1);
}
.pm-chat-empty-title { font-size: 16px; font-weight: 800; color: var(--color-text); }
.pm-chat-empty-sub { font-size: 12.5px; max-width: 280px; }

/* composer */
.pm-chat-composer-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0;
}
.pm-composer-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all .15s ease;
  flex-shrink: 0;
}
.pm-composer-btn:hover {
  background: var(--color-background);
  color: var(--color-primary);
}
.pm-composer-input-wrap { flex: 1; position: relative; }
.pm-composer-input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-size: 13.5px;
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 120px;
  font-family: inherit;
}
.pm-composer-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 12%, transparent);
}
.pm-composer-hint {
  font-size: 10px;
  color: var(--color-secondary);
  font-weight: 600;
  margin-top: 6px;
  padding-left: 2px;
}
.pm-composer-hint b { color: #64748B; }
.pm-chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  border: none;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 15px;
  transition: all .15s ease;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--color-primary) 35%, transparent);
}
.pm-chat-send-btn:hover {
  background: color-mix(in srgb, var(--color-primary) 88%, #000);
  transform: translateY(-1px);
}
.pm-emoji-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .12);
  padding: 12px;
  display: none;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  z-index: 50;
}
.pm-emoji-pop.open { display: grid; }
.pm-emoji-pop span {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  border-radius: 8px;
  cursor: pointer;
}
.pm-emoji-pop span:hover { background: var(--color-background); }

@media (max-width: 767.98px){
  .pm-chat-item { max-width: 88%; }
  .pm-chat-conv-avatar { width: 38px; height: 38px; }
}
/* ============================================================
   Profile redesign (users/profile) — hero, stats, tabs
   ============================================================ */
.pm-prof-hero {
  background: #fff;
  border: 1px solid var(--color-border, #E5EAF2);
  border-radius: var(--radius, 16px);
  box-shadow: var(--shadow-1, 0 1px 2px rgba(16,24,40,.04), 0 4px 14px rgba(16,24,40,.06));
  overflow: hidden;
  margin-bottom: 18px;
}
.pm-prof-cover {
  height: 140px;
  background: linear-gradient(120deg, #1e3a8a 0%, #2563EB 45%, #7C3AED 100%);
  position: relative;
}
.pm-prof-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 160px at 85% 20%, rgba(255,255,255,.14), transparent 60%);
}
.pm-prof-hero-body {
  padding: 0 26px 22px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.pm-prof-avatar {
  margin-top: -50px;
  position: relative;
  flex-shrink: 0;
}
.pm-prof-avatar .ava {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 5px solid #fff;
  background: linear-gradient(135deg, #DB2777, #7C3AED);
  box-shadow: 0 6px 18px rgba(16,24,40,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 38px;
  font-weight: 800;
  overflow: hidden;
}
.pm-prof-avatar .ava img { width: 100%; height: 100%; object-fit: cover; }
.pm-prof-cam {
  position: absolute;
  right: 4px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--color-border, #E5EAF2);
  box-shadow: 0 2px 8px rgba(16,24,40,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary, #2563EB);
  font-size: 13px;
  cursor: pointer;
  transition: transform .15s ease;
}
.pm-prof-cam:hover { transform: scale(1.08); }
.pm-prof-info { flex: 1; min-width: 240px; padding-bottom: 4px; }
.pm-prof-info h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pm-prof-badges { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pm-prof-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  border-radius: 99px;
  padding: 4px 11px;
}
.pm-prof-badge.green { background: #E8F8EE; color: #15803D; border: 1px solid #BBE9CE; }
.pm-prof-badge.blue { background: #EAF1FF; color: #2563EB; border: 1px solid #C7DBFF; }
.pm-prof-badge.purple { background: #F1EDFE; color: #7C3AED; border: 1px solid #DCD1FB; }
.pm-prof-badge.gray { background: #F1F5FB; color: #475069; border: 1px solid var(--color-border, #E5EAF2); }
.pm-prof-meta {
  font-size: 12.5px;
  color: var(--color-muted, #8A93A6);
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.pm-prof-meta i { color: #9AA5B8; margin-right: 5px; }
.pm-prof-hero-actions { display: flex; gap: 9px; padding-bottom: 8px; flex-wrap: wrap; }
.pm-prof-btn-soft {
  background: #F1F5FB;
  color: #475069;
  border: 1px solid var(--color-border, #E5EAF2);
  border-radius: var(--radius-sm, 10px);
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  transition: all .15s ease;
  cursor: pointer;
}
.pm-prof-btn-soft:hover { background: #E8EEF7; color: var(--color-text, #0F172A); }
.pm-prof-btn-danger {
  background: #FEECEE;
  color: #DC2626;
  border: 1px solid #F6C6CB;
  border-radius: var(--radius-sm, 10px);
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s ease;
  cursor: pointer;
}
.pm-prof-btn-danger:hover { background: #FBD5D9; }
.pm-prof-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.pm-prof-stat {
  background: #fff;
  border: 1px solid var(--color-border, #E5EAF2);
  border-radius: 14px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: var(--shadow-1, 0 1px 2px rgba(16,24,40,.04), 0 4px 14px rgba(16,24,40,.06));
  transition: transform .15s ease, box-shadow .15s ease;
}
.pm-prof-stat:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16,24,40,.1); }
.pm-prof-stat .st-ic {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.pm-prof-stat .st-val { font-size: 21px; font-weight: 800; line-height: 1; }
.pm-prof-stat .st-lbl { font-size: 11.5px; color: var(--color-muted, #8A93A6); font-weight: 700; margin-top: 3px; }
.st-blue { background: #EAF1FF; color: #2563EB; }
.st-green { background: #E8F8EE; color: #16A34A; }
.st-purple { background: #F1EDFE; color: #7C3AED; }
.st-amber { background: #FFF7E8; color: #D97706; }
.pm-prof-tabs {
  display: flex;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--color-border, #E5EAF2);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-1, 0 1px 2px rgba(16,24,40,.04), 0 4px 14px rgba(16,24,40,.06));
  overflow-x: auto;
}
.pm-prof-tab {
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 800;
  color: var(--color-muted, #8A93A6);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.pm-prof-tab:hover { color: var(--color-text, #0F172A); background: #F6F8FC; }
.pm-prof-tab.active {
  background: var(--color-primary, #2563EB);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary, #2563EB) 28%, transparent);
}
.pm-prof-tab .t-ic { font-size: 12px; opacity: .85; }
.pm-prof-pane { display: none; }
.pm-prof-pane.active { display: block; animation: pmProfFadeUp .25s ease; }
@keyframes pmProfFadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.pm-prof-card {
  background: #fff;
  border: 1px solid var(--color-border, #E5EAF2);
  border-radius: var(--radius, 16px);
  box-shadow: var(--shadow-1, 0 1px 2px rgba(16,24,40,.04), 0 4px 14px rgba(16,24,40,.06));
  margin-bottom: 16px;
  overflow: hidden;
}
.pm-prof-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--color-border, #E5EAF2);
}
.pm-prof-card-head .h-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.pm-prof-card-head h4 { font-size: 15px; font-weight: 800; margin: 0; }
.pm-prof-card-head p { font-size: 12px; color: var(--color-muted, #8A93A6); font-weight: 600; margin: 2px 0 0; }
.pm-prof-card-body { padding: 20px 22px; }
.pm-prof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.pm-prof-grid .full { grid-column: 1/-1; }
.pm-prof-field label { display: block; font-size: 12px; font-weight: 800; color: #475069; margin-bottom: 6px; }
.pm-prof-field label .req { color: var(--color-danger, #EF4444); }
.pm-prof-field input[type=text],
.pm-prof-field input[type=email],
.pm-prof-field input[type=tel],
.pm-prof-field input[type=password],
.pm-prof-field select,
.pm-prof-field textarea {
  width: 100%;
  border: 1px solid var(--color-border, #E5EAF2);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 13.5px;
  color: var(--color-text, #0F172A);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.pm-prof-field input:focus,
.pm-prof-field select:focus,
.pm-prof-field textarea:focus {
  outline: none;
  border-color: var(--color-primary, #2563EB);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #2563EB) 12%, transparent);
}
.pm-prof-field .select2-container { width: 100% !important; }
.pm-prof-field .select2-container .select2-selection--multiple {
  border: 1px solid var(--color-border, #E5EAF2) !important;
  border-radius: 10px !important;
  min-height: 40px;
  padding: 3px 6px;
}
.pm-prof-hint {
  font-size: 11.5px;
  color: var(--color-muted, #8A93A6);
  font-weight: 600;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.pm-prof-hint.warn { color: #B45309; }
.pm-prof-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--color-border, #E5EAF2);
}
.pm-prof-toggle-row:last-child { border-bottom: none; }
.pm-prof-toggle-row .t-info { font-size: 13.5px; font-weight: 700; }
.pm-prof-toggle-row .t-info small {
  display: block;
  font-weight: 600;
  color: var(--color-muted, #8A93A6);
  font-size: 11.5px;
  margin-top: 2px;
}
.pm-prof-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.pm-prof-switch input { opacity: 0; width: 0; height: 0; }
.pm-prof-switch .trk {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #E2E8F0;
  transition: background .25s ease;
}
.pm-prof-switch .thm {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16,24,40,.25);
  transition: transform .25s ease;
}
.pm-prof-switch input:checked + .trk { background: var(--color-primary, #2563EB); }
.pm-prof-switch input:checked + .trk + .thm { transform: translateX(20px); }
.pm-prof-pic-edit { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pm-prof-pic-edit .prev {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: linear-gradient(135deg, #DB2777, #7C3AED);
  border: 4px solid var(--color-border, #E5EAF2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}
.pm-prof-pic-edit .prev img { width: 100%; height: 100%; object-fit: cover; }
.pm-prof-pic-edit .act { display: flex; flex-direction: column; gap: 8px; }
.pm-prof-file-btn { position: relative; overflow: hidden; }
.pm-prof-file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pm-prof-note-field { margin-bottom: 16px; }
.pm-prof-note-field:last-child { margin-bottom: 0; }
.pm-prof-note-field label {
  font-size: 12.5px;
  font-weight: 800;
  color: #475069;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}
.pm-prof-note-field label i { color: #9AA5B8; }
.pm-prof-note-field textarea {
  width: 100%;
  border: 1px solid var(--color-border, #E5EAF2);
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 13.5px;
  resize: vertical;
  min-height: 72px;
  font-family: inherit;
  color: var(--color-text, #0F172A);
}
.pm-prof-note-field textarea:focus {
  outline: none;
  border-color: var(--color-primary, #2563EB);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #2563EB) 12%, transparent);
}
.pm-prof-footer {
  position: sticky;
  bottom: 14px;
  background: #fff;
  border: 1px solid var(--color-border, #E5EAF2);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(16,24,40,.14);
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.pm-prof-footer .left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--color-muted, #8A93A6);
  font-weight: 700;
}
.pm-prof-footer .right { display: flex; gap: 10px; }
.pm-prof-save { border-radius: 10px; padding: 10px 20px; }
.pm-prof-danger {
  background: #FFF9F9;
  border: 1px solid #F6C6CB;
  border-radius: var(--radius, 16px);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.pm-prof-danger .dz-info { display: flex; gap: 14px; align-items: flex-start; }
.pm-prof-danger .dz-info .dz-ic {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #FEECEE;
  color: #DC2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.pm-prof-danger h5 { font-size: 14px; font-weight: 800; margin: 0; color: #B91C1C; }
.pm-prof-danger p { font-size: 12.5px; color: #7F1D1D; font-weight: 600; margin: 3px 0 0; max-width: 520px; }
@media (max-width: 900px) {
  .pm-prof-grid { grid-template-columns: 1fr; }
}
