/* Admin Portal Styles */
:root {
  --sand: #f4f6fb;
  --sand-deep: #eef2fa;
  --paper: #ffffff;
  --ink: #1a1a2e;
  --ink-soft: #666666;
  --ink-faint: #aaaaaa;
  --nile: #1F4E79;
  --nile-deep: #163a5c;
  --nile-mid: #2E74B5;
  --gold: #D4AF37;
  --terracotta: #C0392B;
  --reed: #1E5631;
  --lapis: #3E1F82;
  --rule: #dce8f5;
  --rule-soft: #e0e8f0;
}

body.admin-body {
  font-family: 'Cairo', Arial, sans-serif;
  background: var(--sand);
  color: var(--ink);
  direction: rtl;
  text-align: right;
  line-height: 1.5;
  font-size: 14px;
  margin: 0;
  padding: 0;
}

.admin-shell {
  display: grid;
  grid-template-columns: 1fr 230px;
  min-height: 100vh;
}

.admin-content {
  min-width: 0;
}

/* Sidebar */
.admin-sidebar {
  background: var(--nile-deep);
  color: var(--sand);
  padding: 22px 0 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
}

.admin-side-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 14px;
}

.admin-side-brand .kicker {
  font-size: 11px;
  color: #72aae2;
  margin-bottom: 4px;
  font-weight: 600;
}

.admin-side-brand .name {
  font-family: 'Amiri', serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
}

.admin-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 12px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 4px;
  color: #C7D6DE;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: none;
  text-align: right;
  width: 100%;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}

.admin-nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.admin-nav-item.active {
  background: var(--nile-mid);
  color: #fff;
}

.admin-side-user {
  padding: 14px 20px 0;
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.admin-side-user .u-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.admin-side-user .u-role {
  font-size: 11px;
  color: #9FB3BD;
  margin-bottom: 10px;
}

.admin-view-public-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #C7D6DE;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 6px 12px;
  text-decoration: none;
  margin-bottom: 8px;
  transition: all .2s;
}

.admin-view-public-btn:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* Content Area */
.admin-content {
  padding: 0;
}

.admin-topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-topbar-title {
  font-family: 'Amiri', serif;
  font-size: 22px;
  font-weight: 700;
}

.admin-topbar-sub {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.admin-topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-screen-inner {
  padding: 26px 32px 50px;
}

/* Overview Ledger Cards */
.admin-ledger {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}

.admin-ledger-cell {
  background: var(--nile);
  color: var(--sand);
  padding: 18px 20px;
  border-radius: 4px;
}

.admin-ledger-val {
  font-family: 'Amiri', serif;
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
}

.admin-ledger-lbl {
  font-size: 12px;
  color: #cfe0f0;
  margin-top: 3px;
}

/* Panels */
.admin-panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  margin-bottom: 22px;
  border-radius: 4px;
}

.admin-panel-hdr {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-panel-hdr h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.admin-panel-body {
  padding: 18px;
}

/* Region Distribution Progress Bars */
.region-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.region-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.region-bar-name {
  width: 90px;
  flex-shrink: 0;
  font-weight: 700;
}

.region-bar-track {
  flex: 1;
  height: 10px;
  background: var(--sand-deep);
  border-radius: 5px;
  overflow: hidden;
}

.region-bar-fill {
  height: 100%;
  border-radius: 5px;
}

.region-bar-count {
  width: 32px;
  text-align: left;
  color: var(--ink-soft);
  font-weight: 600;
}

/* Activity Row */
.activity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
}

.activity-row:last-child {
  border-bottom: none;
}

.activity-who {
  color: var(--ink-soft);
  font-size: 12px;
}

.activity-when {
  color: var(--ink-faint);
  font-size: 11.5px;
}

/* Table */
.admin-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

table.admin-data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--rule);
}

table.admin-data-table thead th {
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 12px 14px;
  border-bottom: 2px solid var(--rule);
  background: var(--sand-deep);
}

table.admin-data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13.5px;
  vertical-align: middle;
}

table.admin-data-table tbody tr:hover {
  background: #f8fafc;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Cairo', Arial, sans-serif;
  text-decoration: none;
  transition: opacity .15s;
}

.btn:hover {
  opacity: .9;
}

.btn-primary {
  background: var(--nile);
  color: #fff;
}

.btn-gold {
  background: var(--gold);
  color: #fff;
}

.btn-outline {
  background: #fff;
  border-color: var(--rule);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--nile);
}

.btn-danger-outline {
  background: #fff;
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.btn-danger-outline:hover {
  background: var(--terracotta);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  background: #fff;
  border-radius: 4px;
  color: var(--ink-soft);
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--nile);
  color: var(--nile);
}

.icon-btn.danger:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.field {
  margin-bottom: 6px;
}

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 600;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: #fff;
  font-size: 13.5px;
  color: var(--ink);
  border-radius: 4px;
  font-family: 'Cairo', Arial, sans-serif;
  box-sizing: border-box;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--nile);
}

.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--rule);
  background: #fff;
  min-height: 44px;
  border-radius: 4px;
}

.tag-input input {
  border: none;
  flex: 1;
  min-width: 120px;
  padding: 4px;
  font-size: 13px;
  outline: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sand-deep);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 12px;
  padding: 3px 6px 3px 10px;
  border-radius: 4px;
  font-weight: 600;
}

.chip button {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  line-height: 1;
}

.chip button:hover {
  color: var(--terracotta);
}

/* SDG Picker */
.sdg-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sdg-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all .15s;
}

.sdg-chip.on {
  color: #fff;
  border-color: transparent;
  transform: scale(1.08);
}

/* Excel Dropzone */
.dropzone {
  border: 2px dashed var(--rule);
  background: #fff;
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.8;
  border-radius: 4px;
  cursor: pointer;
}

.dropzone:hover {
  border-color: var(--nile);
  background: var(--sand-deep);
}

/* Toast */
.admin-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--nile-deep);
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 600;
  border-right: 4px solid var(--gold);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 999;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22,58,92,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: var(--paper);
  border: 1px solid var(--rule);
  width: 380px;
  max-width: 90%;
  padding: 26px;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.modal-box h3 {
  font-family: 'Amiri', serif;
  font-size: 18px;
  margin-bottom: 10px;
}

.modal-box p {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 22px;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.admin-two-col-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
}

@media(max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 10px 14px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  }
  .admin-side-brand, .admin-side-user {
    display: none;
  }
  .admin-nav {
    flex-direction: row;
    gap: 6px;
    width: 100%;
  }
  .admin-nav-item {
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
    width: auto;
  }
  .admin-ledger {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .admin-ledger-cell {
    padding: 14px 16px;
  }
  .admin-ledger-val {
    font-size: 24px;
  }
  .admin-topbar {
    padding: 14px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .admin-topbar-title {
    font-size: 19px;
  }
  .admin-topbar-actions {
    width: 100%;
  }
  .admin-topbar-actions .btn {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
  .admin-screen-inner {
    padding: 18px 16px 40px;
  }
  .admin-two-col-grid {
    grid-template-columns: 1fr !important;
  }
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .admin-toolbar .public-search-box,
  .admin-toolbar .public-select-wrapper,
  .admin-toolbar .public-clear-btn,
  .admin-toolbar .public-count-tag {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box;
  }
  .admin-toolbar .public-count-tag {
    text-align: center;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .dash-hero-grid, .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .dash-grid-2col, .dash-grid-3col {
    grid-template-columns: 1fr !important;
  }
  .sdg-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ========================================================
   EXECUTIVE DASHBOARD ENHANCED STYLING
   ======================================================== */

.dash-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 22px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-filter-lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--nile);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-end: 4px;
}

.dash-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--rule);
  background: var(--sand);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s ease;
}

.dash-filter-pill:hover {
  border-color: var(--nile-mid);
  background: #fff;
  color: var(--nile);
}

.dash-filter-pill.active {
  background: var(--nile);
  border-color: var(--nile);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31, 78, 121, 0.25);
}

.dash-filter-pill .pill-badge {
  background: rgba(0,0,0,0.08);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 10px;
}

.dash-filter-pill.active .pill-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Hero KPI Cards */
.dash-hero-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 1400px) {
  .dash-hero-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
  width: 100%;
}

@media (max-width: 1100px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.dash-kpi-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 18px 16px 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  transition: transform .2s ease, box-shadow .2s ease;
}

.dash-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(31, 78, 121, 0.08);
}

.dash-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.dash-kpi-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--sand-deep);
}

.dash-kpi-val {
  font-family: 'Amiri', serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 4px;
}

.dash-kpi-lbl {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 10px;
}

.dash-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  align-self: flex-start;
}

.dash-kpi-badge.success {
  background: #e6f4ea;
  color: #137333;
}

.dash-kpi-badge.info {
  background: #e8f0fe;
  color: #1a73e8;
}

.dash-kpi-badge.warning {
  background: #fef7e0;
  color: #b06000;
}

.dash-kpi-bar {
  height: 3px;
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  background: var(--nile);
}

/* 2-Column & 3-Column Grids */
.dash-grid-2col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

.dash-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 22px;
}

/* SDG Matrix Card */
.sdg-matrix-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sdg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.sdg-matrix-item {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sdg-matrix-item:hover {
  border-color: var(--nile);
  background: #fbfdff;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.sdg-matrix-item.active {
  border-color: var(--nile);
  background: #f0f7ff;
  box-shadow: 0 0 0 2px rgba(46,116,181,0.3);
}

.sdg-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sdg-badge-num {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sdg-item-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--nile);
}

.sdg-item-name {
  font-size: 11px;
  color: var(--ink);
  line-height: 1.35;
  font-weight: 600;
  height: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sdg-mini-bar {
  height: 4px;
  background: var(--sand-deep);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.sdg-mini-fill {
  height: 100%;
  border-radius: 2px;
}

.sdg-active-detail {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f4f8fe;
  border: 1px solid #d0e2f7;
  border-radius: 6px;
  font-size: 12.5px;
}

.sdg-active-detail strong {
  color: var(--nile);
}

/* Sector Breakdown & Radial Donut */
.sector-donut-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sector-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sector-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 4px;
  background: var(--sand);
  transition: background .15s;
}

.sector-item-row:hover {
  background: var(--sand-deep);
}

.sector-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.sector-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sector-name {
  font-weight: 600;
  color: var(--ink);
}

.sector-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sector-count-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--nile);
  background: #fff;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--rule);
}

.sector-pct {
  font-weight: 700;
  font-size: 12px;
  color: var(--ink-soft);
  width: 40px;
  text-align: left;
}

/* Strategic Flagship Programs & Partners */
.programs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.program-card {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff;
  transition: all .15s;
}

.program-card:hover {
  border-color: var(--nile);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.program-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.program-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--nile);
}

.partners-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.partner-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: #f0f4ff;
  color: var(--nile-mid);
  border-radius: 4px;
  font-weight: 600;
}

/* Activity Audit Timeline */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.activity-timeline-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-soft);
}

.activity-timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  border: 1px solid var(--rule);
}

.activity-icon-badge.edit {
  background: #e8f0fe;
  color: var(--nile);
}

.activity-icon-badge.create {
  background: #e6f4ea;
  color: #137333;
}

.activity-icon-badge.delete {
  background: #fce8e6;
  color: #c5221f;
}

.activity-icon-badge.seed {
  background: #fef7e0;
  color: #b06000;
}

.activity-body {
  flex: 1;
}

.activity-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.activity-meta {
  font-size: 11.5px;
  color: var(--ink-soft);
  display: flex;
  gap: 12px;
}

/* Quick Spotlight Table */
.spotlight-table-wrap {
  max-height: 380px;
  overflow-y: auto;
}

.spotlight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 12.5px;
}

.spotlight-row:hover {
  background: #f8fafc;
}

/* User & Permission Management Styles */
.user-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--rule);
  padding-bottom: 2px;
}

.user-tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-tab-btn:hover {
  color: var(--nile);
}

.user-tab-btn.active {
  color: var(--nile);
  border-bottom-color: var(--nile);
}

.user-count-chip {
  background: #eef2fa;
  color: var(--nile);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
}

.status-pill.active {
  background: #eafaf1;
  color: #1e5631;
  border: 1px solid #c2ebd0;
}

.status-pill.inactive {
  background: #fdf2f2;
  color: #c0392b;
  border: 1px solid #f8c8c8;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  background: #f0f4ff;
  color: var(--nile);
  border: 1px solid #dce8f5;
}

/* Permission Matrix Styles */
.perm-matrix-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .perm-matrix-wrapper {
    grid-template-columns: 1fr;
  }
}

.roles-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-card-item {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.role-card-item:hover {
  border-color: var(--nile-mid);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.role-card-item.selected {
  border-color: var(--nile);
  background: #f6f9fe;
  box-shadow: 0 4px 14px rgba(31, 78, 121, 0.08);
}

.role-card-item.selected::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--nile);
  border-start-start-radius: 8px;
  border-end-start-radius: 8px;
}

.role-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--nile);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.role-card-desc {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 8px;
}

.role-card-meta {
  font-size: 11px;
  color: #888;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.perm-group-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.perm-group-hdr {
  background: #fbfcfe;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.perm-group-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 16px 18px;
}

.perm-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: #fafbfe;
  border: 1px solid #edf2f9;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.perm-check-item:hover {
  background: #f0f4fa;
}

.perm-check-item.checked {
  background: #eff6ff;
  border-color: #d1e2f7;
}

.perm-check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--nile);
}

.perm-label-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.perm-label-desc {
  font-size: 11px;
  color: #777;
  margin-top: 2px;
  line-height: 1.4;
}

/* Modal Dialogs */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 37, 69, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  width: 520px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--rule);
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule-soft);
  background: #fdfefe;
}

.modal-hdr h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--nile-deep);
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #888;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #111;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--rule-soft);
  background: #fafbfe;
}

