/* ============================================================
   Nexapp Tools — Web App Styles (theme-agnostic)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root { --radius: 10px; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  transition: background .2s, color .2s;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── APP HEADER ─── */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background .2s, border-color .2s;
}
.header-left { flex-shrink: 0; }
.header-nav  { display: flex; gap: 4px; flex: 1; }
.header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-light);
  letter-spacing: -.01em;
}
.logo span { color: var(--text-muted); font-weight: 400; }

.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
}

.user-menu { display: flex; align-items: center; gap: 8px; }
.user-name  { font-size: 13px; color: var(--text-muted); }
.user-role-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.role-admin  { background: rgba(91,106,240,.18); color: var(--accent-light); }
.role-client { background: rgba(52,211,153,.12);  color: var(--green); }

/* ─── MAIN ─── */
.app-main {
  padding: 28px 32px;
}

/* ─── PAGE HEADER ─── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -.02em;
}
.text-muted { color: var(--text-muted); }
.link-external { font-size: 13px; color: var(--text-muted); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:hover  { text-decoration: none; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(91,106,240,.25); }
.btn-primary:hover { opacity: .88; box-shadow: 0 4px 12px rgba(91,106,240,.35); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-light); }

.btn-export {
  background: var(--btn-export-bg);
  color: var(--green);
  border: 1px solid var(--btn-export-border);
}
.btn-export:hover { background: var(--btn-export-hover); }

.btn-danger {
  background: rgba(248,113,113,.12);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.25);
}
.btn-danger:hover { background: rgba(248,113,113,.22); }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }

.btn-theme {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 11px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color .2s, color .2s;
}
.btn-theme:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-theme .theme-label { font-size: 12px; font-weight: 600; }
.btn-theme-sm { font-size: 12px; padding: 4px 10px; }

.action-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─── FORM ELEMENTS ─── */
.form-group  { margin-bottom: 20px; }
.form-label  { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .05em; }
.form-input  {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 13px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,106,240,.15); }
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; line-height: 1.6; }
select.form-input { cursor: pointer; }

.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }

.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.radio-label input { margin-top: 3px; accent-color: var(--accent); }

.input-password-wrap { position: relative; }
.toggle-password {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 2px;
}
.toggle-password:hover { color: var(--text); }

/* ─── CARDS ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
  transition: background .2s, border-color .2s;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title  { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 16px; letter-spacing: -.01em; }
.card-header .card-title { margin-bottom: 0; }
.link-sm { font-size: 13px; color: var(--accent-light); }

/* ─── KPI GRID ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: background .2s, border-color .2s, transform .15s;
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; stroke-width: 1.75; display: block; }

.kpi-icon-accent { background: rgba(91,106,240,.15); color: var(--accent-light); }
.kpi-icon-blue   { background: rgba(96,165,250,.15);  color: var(--blue);   }
.kpi-icon-purple { background: rgba(167,139,250,.15); color: var(--purple); }
.kpi-icon-green  { background: rgba(52,211,153,.15);  color: var(--green);  }
.kpi-icon-yellow { background: rgba(251,191,36,.15);  color: var(--yellow); }
.kpi-icon-red    { background: rgba(248,113,113,.15); color: var(--red);    }
.kpi-value { font-size: 30px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -.02em; }
.kpi-label { font-size: 11px; color: var(--text-muted); margin-top: 5px; text-transform: uppercase; letter-spacing: .05em; }
.kpi-ok   .kpi-value { color: var(--green);  }
.kpi-wip  .kpi-value { color: var(--yellow); }
.kpi-todo .kpi-value { color: var(--red);    }

/* ─── KPI STRIP ─── */
.kpi-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.kpi-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.kpi-chip strong { color: var(--text); }
.kpi-ok-chip   strong { color: var(--green);  }
.kpi-wip-chip  strong { color: var(--yellow); }
.kpi-todo-chip strong { color: var(--red);    }

/* ─── PROGRESS BAR ─── */
.progress-bar-wrap {
  display: flex;
  height: 10px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface2);
}
.progress-bar { height: 100%; transition: width .4s; }
.bg-ok   { background: var(--green);  }
.bg-wip  { background: var(--yellow); }
.bg-todo { background: var(--red);    }
.bg-none { background: var(--border); }
.progress-legend {
  display: flex; gap: 16px; margin-top: 8px;
  font-size: 12px; color: var(--text-muted); flex-wrap: wrap;
}
.leg-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 4px; vertical-align: middle;
}

/* ─── TWO COL GRID ─── */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .two-col-grid { grid-template-columns: 1fr; } }

/* ─── PROJECT CARDS (client) ─── */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .2s, background .2s, transform .15s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.project-card-title { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.project-domain { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.project-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-chip {
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  background: var(--surface2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.ps-ok   { background: rgba(52,211,153,.1);  color: var(--green);  border-color: rgba(52,211,153,.2);  }
.ps-wip  { background: rgba(251,191,36,.1);  color: var(--yellow); border-color: rgba(251,191,36,.2);  }
.ps-todo { background: rgba(248,113,113,.1); color: var(--red);    border-color: rgba(248,113,113,.2); }

/* ─── FILTER BAR ─── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  transition: background .2s;
}
.filter-label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.filter-select, select.filter-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7f9a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.filter-select:focus { border-color: var(--accent); }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-input { padding-left: 32px !important; min-width: 240px; }
.clear-filters {
  background: none; border: none; color: var(--text-muted);
  font-size: 12px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.clear-filters:hover { color: var(--red); background: rgba(248,113,113,.08); }

/* ─── DATA TABLE ─── */
.table-wrap { overflow-x: auto; margin-bottom: 0; }
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table thead th {
  background: var(--surface2);
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.th-sort-link { color: var(--text-muted); text-decoration: none; display: block; }
.th-sort-link:hover { color: var(--accent-light); text-decoration: none; }

.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover { background: var(--row-hover); }
.data-table tbody tr.row-disabled { opacity: .5; }
.data-table tbody td {
  padding: 9px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--row-border);
  color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.text-center { text-align: center; }

.td-url { max-width: 320px; }
.td-url a {
  color: var(--accent-light); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; max-width: 300px;
}
.td-url a:hover { text-decoration: underline; }
.td-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* ─── BADGES ─── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.badge-200   { background: rgba(52,211,153,.12);  color: var(--green);  }
.badge-3xx   { background: rgba(251,191,36,.12);   color: var(--yellow); }
.badge-404   { background: rgba(248,113,113,.12);  color: var(--red);    }
.badge-5xx   { background: rgba(248,113,113,.18);  color: var(--red);    }
.badge-other { background: rgba(96,165,250,.12);   color: var(--blue);   }
.idx-yes { color: var(--green); }
.idx-no  { color: var(--red);   }

/* ─── PAGE STATUS SELECT ─── */
.status-select {
  appearance: none; -webkit-appearance: none;
  border: none; border-radius: 20px;
  padding: 3px 24px 3px 10px;
  font-size: 11px; font-weight: 600;
  cursor: pointer; outline: none;
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23ffffff80' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  transition: opacity .15s;
}
.status-select:hover { opacity: .85; }
.status-ok    { background-color: rgba(52,211,153,.2);  color: #34d399; }
.status-wip   { background-color: rgba(251,191,36,.2);  color: #fbbf24; }
.status-todo  { background-color: rgba(248,113,113,.2); color: #f87171; }
.status-other { background-color: rgba(167,139,250,.2); color: #a78bfa; }
.status-none  { background-color: rgba(122,127,154,.15);color: #7a7f9a; }

/* ─── COMMENT CELL ─── */
.comment-cell { position: relative; }
.comment-display {
  min-width: 140px; max-width: 220px; min-height: 28px;
  padding: 4px 8px; border-radius: 6px;
  border: 1px solid transparent;
  color: var(--text-muted); font-style: italic;
  cursor: text;
  transition: border-color .15s, background .15s;
  font-size: 12px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.comment-display:hover { border-color: var(--border); background: var(--surface2); }
.comment-display.has-value { color: var(--text); font-style: normal; }
.comment-input {
  min-width: 180px; background: var(--surface2);
  border: 1px solid var(--accent); border-radius: 6px;
  padding: 4px 8px; color: var(--text); font-size: 12px;
  outline: none; width: 100%; resize: none;
  font-family: inherit; line-height: 1.4;
}

/* ─── PAGINATION ─── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background .2s;
}
.page-info { color: var(--text-muted); font-size: 13px; }
.page-btns { display: flex; gap: 6px; align-items: center; }
.page-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px;
  padding: 5px 11px; font-size: 13px; cursor: pointer;
  text-decoration: none; display: inline-block;
  transition: border-color .15s, color .15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent-light); text-decoration: none; }
.page-btn:disabled, .page-btn.disabled { opacity: .3; pointer-events: none; }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─── FLASH MESSAGES ─── */
.flash {
  padding: 12px 18px; border-radius: var(--radius); margin-bottom: 20px;
  font-size: 14px; font-weight: 500;
}
.flash-success { background: rgba(52,211,153,.1);  border: 1px solid rgba(52,211,153,.3);  color: var(--green);  }
.flash-error   { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); color: var(--red);    }
.flash-warning { background: rgba(251,191,36,.1);  border: 1px solid rgba(251,191,36,.3);  color: var(--yellow); }
.flash-info    { background: rgba(96,165,250,.1);  border: 1px solid rgba(96,165,250,.3);  color: var(--blue);   }

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface2); border: 1px solid var(--green);
  color: var(--green); border-radius: var(--radius);
  padding: 10px 18px; font-size: 13px; font-weight: 600;
  z-index: 999; opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-error { border-color: var(--red); color: var(--red); }

/* ─── EMPTY STATES ─── */
.empty-state { color: var(--text-muted); font-size: 14px; padding: 16px 0; }
.empty-state-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 48px; text-align: center;
  color: var(--text-muted); margin-bottom: 24px; font-size: 14px;
}

/* ─── UPLOAD DROP AREA ─── */
.upload-drop-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 36px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-drop-area:hover, .upload-drop-area.drag-over {
  border-color: var(--accent); background: var(--upload-hover-bg);
}
.upload-drop-area svg { color: var(--accent); margin-bottom: 10px; }
.link-action { color: var(--accent-light); text-decoration: underline; cursor: pointer; }

/* ─── LOGIN PAGE ─── */
body.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg);
}
.login-wrap { width: 100%; max-width: 440px; padding: 20px; }
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo svg { color: var(--accent); margin-bottom: 14px; }
.login-logo h1 { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 6px; letter-spacing: -.02em; }
.login-logo p  { color: var(--text-muted); font-size: 14px; }
.login-footer  { text-align: center; margin-top: 24px; }

/* ─── TAB BAR ─── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  transition: color .15s, background .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.tab-btn.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
}
.tab-count {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.tab-btn.active .tab-count { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─── 2FA STATUS BLOCKS ─── */
.twofa-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.twofa-status-icon { font-size: 30px; line-height: 1; }
.twofa-on  { background: rgba(52,211,153,.08);  border-color: rgba(52,211,153,.25); }
.twofa-off { background: rgba(248,113,113,.06); border-color: rgba(248,113,113,.2); }

/* ─── QR CODE WRAP ─── */
.qr-wrap { text-align: center; }
.secret-box {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-top: 8px;
  text-align: center;
  word-break: break-all;
}

/* ─── TOTP COUNTDOWN & INPUT ─── */
.totp-countdown { margin-bottom: 0; }
.totp-input {
  font-size: 22px !important;
  font-weight: 700 !important;
  letter-spacing: 8px;
  text-align: center;
  padding: 10px 16px !important;
  border-radius: var(--radius) !important;
  font-family: 'Courier New', monospace !important;
}

/* ─── PROJECT CHART GRID ─── */
.project-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 8px;
}
.project-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .2s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.project-chart-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.pcc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pcc-name   { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }
.pcc-domain { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pcc-chart-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.pcc-center-label {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
.pcc-pct     { display: block; font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.1; }
.pcc-pct-sub { display: block; font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.pcc-legend  { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--text-muted); }
.pcc-leg-item { display: inline-flex; align-items: center; gap: 4px; }
.pcc-leg-item strong { color: var(--text); }
.pcc-footer {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
  padding-top: 8px; border-top: 1px solid var(--border);
}
.pcc-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 20px 0; font-style: italic; }

/* ─── FILTER CHECKBOX ─── */
.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  transition: border-color .15s, color .15s;
  white-space: nowrap;
  user-select: none;
}
.filter-check:hover { border-color: var(--accent); color: var(--text); }
.filter-check input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }

/* ─── STICKY TABLE HEADER ─── */
.table-wrap {
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 0;
}
/* sovrascrive il border sulla table stessa (ora è sul wrapper) */
.table-wrap .data-table {
  border: none;
  border-radius: 0;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 var(--border);
}

/* ─── DRAWER LATERALE ─── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 460px;
  max-width: 95vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,.25);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.drawer-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer;
  color: var(--text-muted);
  background: none; border: none;
  transition: background .15s, color .15s;
  font-size: 18px; line-height: 1;
}
.drawer-close:hover { background: var(--surface2); color: var(--text); }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.drawer-url {
  font-size: 12px;
  color: var(--accent-light);
  word-break: break-all;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.drawer-field { display: flex; flex-direction: column; gap: 5px; }
.drawer-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.drawer-field .drawer-val {
  font-size: 13px;
  color: var(--text);
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
  min-height: 36px;
  word-break: break-word;
}
.drawer-field .drawer-val.empty { color: var(--text-muted); font-style: italic; }
.drawer-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drawer-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
/* row clickable */
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr.row-selected { background: rgba(91,106,240,.08) !important; }

/* ─── NAVBAR BADGE ─── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  margin-left: 4px;
  vertical-align: middle;
}
.nav-badge-todo  { background: rgba(248,113,113,.2); color: var(--red);    }
.nav-badge-wip   { background: rgba(251,191,36,.2);  color: var(--yellow); }
.nav-badge-total { background: rgba(91,106,240,.15); color: var(--accent-light); }

/* ─── SKELETON LOADING ─── */
@keyframes skeleton-pulse {
  0%   { opacity: 1; }
  50%  { opacity: .4; }
  100% { opacity: 1; }
}
.skeleton {
  background: var(--surface2);
  border-radius: 6px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  display: block;
}
.skeleton-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0;
}
.skeleton-thead {
  background: var(--surface2);
  padding: 11px 16px;
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}
.skeleton-thead span { height: 10px; border-radius: 4px; background: var(--border); }
.skeleton-row {
  display: flex;
  gap: 24px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--row-border);
  align-items: center;
}
.skeleton-row:last-child { border-bottom: none; }
.skeleton-row span { height: 10px; border-radius: 4px; background: var(--surface2); }
.skeleton-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.skeleton-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.skeleton-kpi .sk-icon  { width: 44px; height: 44px; border-radius: 12px; background: var(--surface2); }
.skeleton-kpi .sk-val   { width: 50px; height: 22px; border-radius: 5px; background: var(--surface2); }
.skeleton-kpi .sk-label { width: 80px; height: 8px;  border-radius: 4px; background: var(--border); }

/* ─── PROJECT NOTES BAR ─── */
.project-notes-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.notes-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.notes-header svg { color: var(--accent-light); flex-shrink: 0; }
.notes-display {
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.notes-empty {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}
.notes-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.notes-textarea {
  width: 100%;
  min-height: 90px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color .15s;
}
.notes-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.notes-toggle-btn {
  background: none;
  border: none;
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity .15s;
}
.notes-toggle-btn:hover { opacity: .7; }

/* Notes display row with edit button */
.notes-display {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.notes-display svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--accent-light);
  margin-top: 2px;
}
.notes-display > span { flex: 1; }

.notes-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  opacity: .5;
  transition: opacity .15s;
  flex-shrink: 0;
}
.notes-edit-btn:hover { opacity: 1; }

.notes-add-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .15s;
}
.notes-add-btn:hover { color: var(--accent-light); }
.notes-add-btn svg {
  width: 14px;
  height: 14px;
}

/* ─── GLOBAL SEARCH ─── */
.header-search {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.header-search-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px 7px 34px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  transition: border-color .15s, background .15s;
}
.header-search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.header-search-input::placeholder { color: var(--text-muted); }
.header-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 15px;
  height: 15px;
}

/* Global search page */
.search-results-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}
.search-results-count {
  font-size: 13px;
  color: var(--text-muted);
}
.search-result-project {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: 4px 8px;
  background: var(--surface2);
  border-radius: 5px;
  white-space: nowrap;
}
.search-highlight {
  background: rgba(91,106,240,.25);
  color: var(--accent-light);
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 600;
}

/* ─── MODULE CARDS (dashboard principale) ─── */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s, transform .15s;
  cursor: pointer;
}
.module-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(91,106,240,.12);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}
.module-card-coming {
  opacity: .55;
  cursor: default;
  pointer-events: none;
}

.module-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.module-card-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.5;
}

.module-card-body { flex: 1; min-width: 0; }
.module-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -.01em;
}
.module-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.module-card-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color .2s, transform .2s;
}
.module-card-arrow svg { width: 18px; height: 18px; }
.module-card:hover .module-card-arrow {
  color: var(--accent-light);
  transform: translateX(3px);
}

/* ─── DASHBOARD SUMMARY ─── */
.dashboard-summary {
  margin-top: 8px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

/* ─── CHECKBOX GROUP (assegnazione moduli) ─── */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
