:root {
  --navy: #0c1e2b;
  --navy-2: #133048;
  --emerald: #1d8a6c;
  --emerald-dark: #146b54;
  --gold: #d2b26b;
  --sand: #f2e9d8;
  --sand-2: #efe3cf;
  --ink: #0b1220;
  --muted: #6c7a89;
  --card: #ffffff;
  --glass: rgba(255, 255, 255, 0.75);
  --shadow: 0 18px 40px rgba(16, 38, 60, 0.12);
  --border: rgba(15, 30, 45, 0.08);
  --radius: 18px;
  --radius-lg: 26px;
  --transition: 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif;
  background: linear-gradient(135deg, #f7f2e8, #f5f7fb 45%, #f0f6f2 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: "IBM Plex Sans Arabic", "Tajawal", sans-serif;
  margin: 0 0 8px;
}

p {
  margin: 0;
  color: var(--muted);
}

button, select, input, textarea {
  font-family: inherit;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.35;
  z-index: 0;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(29, 138, 108, 0.35), rgba(29, 138, 108, 0));
  top: -120px;
  right: -120px;
}

.orb-2 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(210, 178, 107, 0.35), rgba(210, 178, 107, 0));
  bottom: -180px;
  left: -120px;
}

.app {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 24px;
  padding: 24px;
  z-index: 1;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1 1 auto;
  min-width: 0;
}

.topbar {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 500;
}

.crumb {
  color: var(--ink);
}

.crumb-sep {
  opacity: 0.4;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.top-controls {
  display: grid;
  gap: 10px;
  min-width: 320px;
  flex: 1;
}

.top-search {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.top-search input {
  min-width: 240px;
  flex: 1;
}

.top-views {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.top-scopes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.top-select {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.top-select select {
  min-width: 160px;
}

.page {
  display: none;
  opacity: 0;
  transform: translateY(14px);
  transition: var(--transition);
}

.page.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  background: rgba(29, 138, 108, 0.15);
  color: var(--emerald-dark);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 12px;
}

.hero p {
  margin-top: 12px;
  max-width: 520px;
}

.hero-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 242, 232, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  background: var(--card);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
}

.mini-progress {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.progress {
  width: 100%;
  background: rgba(12, 30, 43, 0.08);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), #4bb08f);
  border-radius: 999px;
}

.progress-value {
  font-weight: 600;
  color: var(--ink);
}

.grid {
  display: grid;
  gap: 20px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(12, 30, 43, 0.08);
}

.badge.success {
  background: rgba(29, 138, 108, 0.15);
  color: var(--emerald-dark);
}

.badge.warning {
  background: rgba(210, 178, 107, 0.2);
  color: #8a6a2f;
}

.badge.danger {
  background: rgba(180, 35, 24, 0.12);
  color: #b42318;
}

.badge.pending {
  background: rgba(31, 70, 96, 0.15);
  color: #1f4660;
}

.badge.info {
  background: rgba(19, 48, 72, 0.1);
  color: #133048;
}

button {
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

button.primary {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  color: #fff;
}

button.secondary {
  background: rgba(12, 30, 43, 0.08);
  color: var(--ink);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

button:hover {
  transform: translateY(-2px);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card .actions {
  margin-bottom: 12px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.filter-field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.filter-field input,
.filter-field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.filter-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.filters-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stepper {
  display: grid;
  gap: 10px;
}

.list + .stepper {
  margin-top: 12px;
}

.stepper + button {
  margin-top: 10px;
}

.stepper.horizontal {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.step {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.step.done {
  border-color: rgba(29, 138, 108, 0.4);
  background: rgba(29, 138, 108, 0.08);
}

.step-status {
  font-size: 12px;
  color: var(--muted);
}

.step.done .step-status {
  color: var(--emerald-dark);
  font-weight: 600;
}

.requests, .training-list {
  display: grid;
  gap: 10px;
}

.list, .checklist, .toggle-group {
  display: grid;
  gap: 10px;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.request, .training-item, .ticket, .relation, .alert, .list-item, .check-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
}

.request {
  align-items: flex-start;
  gap: 12px;
}

.request-info {
  display: grid;
  gap: 4px;
}

.request-sla {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.request-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.decision-reason {
  font-size: 12px;
  color: var(--muted);
}

.sla-bar {
  height: 6px;
  background: rgba(12, 30, 43, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.sla-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--gold));
}

.sla-flag {
  font-size: 11px;
  color: #8a6a2f;
}

.sla-box {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.check-item {
  cursor: pointer;
}

.check-item.done {
  border-color: rgba(29, 138, 108, 0.4);
  background: rgba(29, 138, 108, 0.08);
}

.meta-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tab {
  border-radius: 999px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tab.active {
  background: rgba(29, 138, 108, 0.15);
  border-color: rgba(29, 138, 108, 0.4);
  color: var(--emerald-dark);
}

.tab-content + .tab-content {
  margin-top: 12px;
}

.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
}

.org-tree {
  display: grid;
  gap: 10px;
}

.org-node {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  width: fit-content;
}

.org-branch {
  display: grid;
  gap: 8px;
  margin-inline-start: 14px;
  padding-inline-start: 12px;
  border-inline-start: 2px dashed rgba(12, 30, 43, 0.15);
}

.roster {
  display: grid;
  gap: 8px;
}

.roster-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 14px;
}

.roster-row.roster-head {
  background: rgba(12, 30, 43, 0.06);
  font-weight: 600;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px 10px;
}

.toggle input {
  display: none;
}

.toggle-slider {
  width: 38px;
  height: 20px;
  background: rgba(12, 30, 43, 0.2);
  border-radius: 999px;
  position: relative;
  transition: var(--transition);
}

.toggle-slider::after {
  content: "";
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  right: 2px;
  transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: var(--emerald);
}

.toggle input:checked + .toggle-slider::after {
  transform: translateX(-18px);
}

.chat-preview {
  display: grid;
  gap: 8px;
  background: rgba(12, 30, 43, 0.04);
  padding: 12px;
  border-radius: 12px;
}

.offboarding {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.matrix {
  display: grid;
  gap: 8px;
}

.matrix-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.matrix-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
}

.matrix-row.matrix-head {
  background: rgba(12, 30, 43, 0.06);
  font-weight: 600;
}

.matrix-row.seven {
  grid-template-columns: minmax(160px, 1.2fr) repeat(6, minmax(110px, 1fr));
}

.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.chart-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  height: 160px;
}

.chart-bars .bar {
  background: linear-gradient(180deg, var(--emerald), rgba(29, 138, 108, 0.3));
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 6px;
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.chart-bars .bar span {
  padding: 0 4px;
  line-height: 1.2;
}

.chart-canvas {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.chart-legend, .pie-legend {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 6px;
}

.dot.emerald {
  background: var(--emerald);
}

.dot.gold {
  background: var(--gold);
}

.dot.sand {
  background: var(--sand-2);
  border: 1px solid var(--border);
}

.pie-chart {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--emerald) 0 55%, var(--sand-2) 55% 78%, var(--gold) 78% 100%);
  border: 8px solid rgba(255, 255, 255, 0.6);
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  align-items: center;
}

.timeline-time {
  font-weight: 600;
  color: var(--emerald-dark);
}

.timeline-content {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--border);
}

.map-preview {
  position: relative;
  background: linear-gradient(135deg, rgba(19, 48, 72, 0.08), rgba(29, 138, 108, 0.08));
  border-radius: 16px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.map-preview.large {
  height: 230px;
}

.map-pin {
  width: 18px;
  height: 18px;
  background: var(--emerald);
  border-radius: 50% 50% 50% 0;
  transform: rotate(45deg);
  position: relative;
}

.map-ring {
  position: absolute;
  width: 140px;
  height: 140px;
  border: 2px dashed rgba(29, 138, 108, 0.5);
  border-radius: 50%;
}

.map-info {
  position: absolute;
  bottom: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.table {
  display: grid;
  gap: 8px;
}

.table + .list {
  margin-top: 12px;
}

.table-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 14px;
}

.table-row.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-note {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  padding-top: 4px;
}

.table-row.table-head {
  background: rgba(12, 30, 43, 0.06);
  font-weight: 600;
}

.bulk-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.bulk-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.table-edit .cell-edit {
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px dashed rgba(12, 30, 43, 0.25);
  background: rgba(12, 30, 43, 0.04);
  min-height: 28px;
}

.table-edit .cell-edit:focus {
  outline: none;
  border-color: rgba(29, 138, 108, 0.6);
  background: rgba(29, 138, 108, 0.08);
}

.cell-check {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.state-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.state-card strong {
  color: var(--ink);
  font-size: 13px;
}

.state-card.loading {
  background: rgba(12, 30, 43, 0.04);
}

.state-card.empty {
  background: rgba(210, 178, 107, 0.08);
}

.state-card.error {
  background: rgba(180, 35, 24, 0.08);
}

.state-line {
  height: 8px;
  border-radius: 999px;
  background: rgba(12, 30, 43, 0.12);
}

.state-line.short {
  width: 60%;
}

.table-row.table-head span.sortable {
  cursor: pointer;
  position: relative;
  padding-inline-end: 14px;
}

.table-row.table-head span.sortable::after {
  content: '';
  position: absolute;
  inset-inline-end: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.5;
}

.table-row.table-head span.sortable[data-sort-dir='asc']::after {
  content: '^';
}

.table-row.table-head span.sortable[data-sort-dir='desc']::after {
  content: 'v';
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.table-pagination .page-numbers {
  display: flex;
  gap: 6px;
}

.table-pagination .page-number {
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.table-pagination .page-number.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

.table-pagination button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.heatmap {
  padding: 8px 0;
  overflow-x: auto;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 160px repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  min-width: 720px;
}

.heatmap-head {
  font-size: 12px;
  color: var(--muted);
}

.heatmap-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.heatmap-cell {
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(15, 30, 45, 0.08);
  background: rgba(12, 30, 43, 0.04);
}

.heatmap-cell.high {
  background: rgba(29, 138, 108, 0.35);
}

.heatmap-cell.mid {
  background: rgba(29, 138, 108, 0.18);
}

.heatmap-cell.low {
  background: rgba(210, 178, 107, 0.22);
}

.heatmap-cell.critical {
  background: rgba(180, 35, 24, 0.2);
}

.heatmap-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-inline-end: 6px;
}

.legend-dot.high {
  background: rgba(29, 138, 108, 0.35);
}

.legend-dot.mid {
  background: rgba(29, 138, 108, 0.18);
}

.legend-dot.low {
  background: rgba(210, 178, 107, 0.22);
}

.legend-dot.critical {
  background: rgba(180, 35, 24, 0.2);
}

.drilldown {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.drilldown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
}

.status.success {
  color: var(--emerald-dark);
  font-weight: 600;
}

.status.warning {
  color: #8a6a2f;
  font-weight: 600;
}

.status.danger {
  color: #b42318;
  font-weight: 600;
}

.status.pending {
  color: #1f4660;
  font-weight: 600;
}

.profile {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  background: var(--navy-2);
  color: #fff;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.label {
  font-size: 12px;
  color: var(--muted);
}

.attachments {
  display: grid;
  gap: 8px;
}

.attachment {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.mobile-checkin {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: center;
}

.phone {
  width: 170px;
  height: 320px;
  border-radius: 26px;
  background: linear-gradient(180deg, #101c27, #1b2d3b);
  padding: 12px;
  display: flex;
  justify-content: center;
}

.phone.large {
  width: 200px;
  height: 360px;
}

.phone-screen {
  background: #f9fafc;
  border-radius: 18px;
  width: 100%;
  padding: 12px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.phone-time {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
}

.phone-badge {
  background: rgba(29, 138, 108, 0.12);
  color: var(--emerald-dark);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  width: fit-content;
}

.phone-note {
  font-size: 12px;
  color: var(--muted);
}

.phone-list {
  display: grid;
  gap: 8px;
}

.phone-list div {
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  border: 1px solid var(--border);
}

.phone-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.phone-os {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.phone-screen button {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.phone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
}

.phone-chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(12, 30, 43, 0.08);
}

.phone-chip.success {
  background: rgba(29, 138, 108, 0.18);
  color: var(--emerald-dark);
}

.phone-chip.warning {
  background: rgba(210, 178, 107, 0.22);
  color: #8a6a2f;
}

.phone-chip.danger {
  background: rgba(180, 35, 24, 0.15);
  color: #b42318;
}

.phone-chip.pending {
  background: rgba(31, 70, 96, 0.15);
  color: #1f4660;
}

.phone-chip.info {
  background: rgba(19, 48, 72, 0.12);
  color: #133048;
}

.phone-map {
  position: relative;
  height: 110px;
  border-radius: 16px;
  border: 1px dashed rgba(12, 30, 43, 0.2);
  background: radial-gradient(circle at 25% 35%, rgba(29, 138, 108, 0.2), transparent 60%),
    #edf2f6;
  overflow: hidden;
}

.phone-map.wide {
  height: 120px;
}

.phone-map-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--emerald);
  inset-inline-start: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.phone-map-ring {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px dashed rgba(29, 138, 108, 0.5);
  inset-inline-start: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.phone-map-ring.ring-wide {
  width: 84px;
  height: 84px;
}

.phone-map-label {
  position: absolute;
  bottom: 8px;
  inset-inline-start: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
}

.phone-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.phone-meta {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.phone-rows {
  display: grid;
  gap: 6px;
}

.phone-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
}

.phone-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(12, 30, 43, 0.08);
}

.phone-tag.success {
  background: rgba(29, 138, 108, 0.15);
  color: var(--emerald-dark);
}

.phone-tag.warning {
  background: rgba(210, 178, 107, 0.2);
  color: #8a6a2f;
}

.phone-tag.danger {
  background: rgba(180, 35, 24, 0.12);
  color: #b42318;
}

.phone-tag.pending {
  background: rgba(31, 70, 96, 0.15);
  color: #1f4660;
}

.phone-tag.info {
  background: rgba(19, 48, 72, 0.1);
  color: #133048;
}

.phone-steps {
  display: grid;
  gap: 6px;
}

.phone-step {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
}

.phone-step.done {
  border-color: rgba(29, 138, 108, 0.35);
  background: rgba(29, 138, 108, 0.12);
  color: var(--emerald-dark);
}

.phone-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  font-size: 10px;
}

.phone-calendar-head {
  text-align: center;
  font-weight: 600;
  color: var(--muted);
}

.phone-calendar-cell {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 4px;
  display: grid;
  gap: 2px;
  justify-items: center;
  min-height: 36px;
  font-size: 11px;
}

.phone-calendar-cell small {
  font-size: 9px;
  color: var(--muted);
}

.phone-calendar-cell.muted {
  opacity: 0.5;
}

.phone-calendar-cell.active {
  border-color: rgba(29, 138, 108, 0.45);
  background: rgba(29, 138, 108, 0.12);
  color: var(--emerald-dark);
}

.phone-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.phone-filter-chip {
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}

.phone-filter-chip.active {
  background: rgba(29, 138, 108, 0.15);
  border-color: rgba(29, 138, 108, 0.45);
  color: var(--emerald-dark);
}

.phone-pdf {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.phone-pdf-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(12, 30, 43, 0.12);
}

.phone-pdf-line {
  height: 6px;
  border-radius: 999px;
  background: rgba(12, 30, 43, 0.1);
}

.phone-pdf-line.short {
  width: 60%;
}

.checkin-status {
  display: grid;
  gap: 6px;
}

.balance {
  display: flex;
  gap: 16px;
}

.rules {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.rule {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.salary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.payslip-preview {
  display: grid;
  gap: 10px;
}

.highlight {
  color: var(--emerald-dark);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.pipeline-col {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
}

.pipeline-col h4 {
  margin-bottom: 8px;
  font-size: 14px;
}

.pipeline-card {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.pipeline-card.highlight {
  border-color: var(--gold);
}

.pipeline-card.success {
  border-color: var(--emerald);
  background: rgba(29, 138, 108, 0.08);
}

.kpi-list {
  display: grid;
  gap: 12px;
}

.kpi-item {
  display: grid;
  gap: 8px;
}

.nine-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.nine-box .box {
  background: rgba(12, 30, 43, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  font-size: 12px;
}

.nine-box .box.highlight {
  background: rgba(210, 178, 107, 0.2);
  font-weight: 600;
}

.training-item {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.ticket, .relation {
  margin-bottom: 10px;
}

.relations {
  display: grid;
  gap: 10px;
}

.alerts {
  display: grid;
  gap: 10px;
}

.metric {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.metric strong {
  font-size: 30px;
}

.trend {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  width: fit-content;
}

.trend.up {
  background: rgba(29, 138, 108, 0.12);
  color: var(--emerald-dark);
}

.trend.down {
  background: rgba(29, 138, 108, 0.12);
  color: var(--emerald-dark);
}

.risk {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-showcase {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 16px;
}

.flow-builder {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.flow-node {
  background: #fff;
  border: 1px dashed var(--border);
  padding: 10px 14px;
  border-radius: 12px;
}

.e-sign, .delegation, .bulk {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.integrations {
  display: grid;
  gap: 8px;
}

.integration {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.sidebar {
  background: rgba(12, 30, 43, 0.94);
  color: #f5f5f5;
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 320px;
  flex: 0 0 320px;
  min-height: calc(100vh - 48px);
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--emerald), var(--gold));
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
}

.brand span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.role-switch label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.7);
}

.role-switch select {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-label {
  margin-top: 10px;
  padding: 4px 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.nav-label.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.nav-item {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  padding: 10px 14px;
  border-radius: 12px;
  text-align: right;
  border: 1px solid transparent;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-item.hidden {
  display: none;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.cta {
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
  border-radius: 16px;
  display: grid;
  gap: 10px;
}

.audit-mini {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.assistant {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 320px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
}

.assistant.open {
  display: flex;
}

.assistant-header {
  padding: 12px 16px;
  background: var(--navy-2);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.assistant-body {
  padding: 14px;
  max-height: 260px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
}

.assistant-msg {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.assistant-msg.bot {
  background: rgba(12, 30, 43, 0.06);
}

.assistant-msg.user {
  background: rgba(29, 138, 108, 0.12);
  justify-self: flex-start;
}

.assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: #fafafa;
}

.chip {
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(12, 30, 43, 0.08);
  border: none;
  font-size: 12px;
}

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: var(--transition);
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(4px);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 30, 43, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  width: min(520px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content.wide {
  width: min(720px, 94vw);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-body {
  display: grid;
  gap: 10px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(12, 30, 43, 0.08);
  color: var(--ink);
  font-size: 11px;
  cursor: help;
}

.tooltip::before,
.tooltip::after {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.tooltip::after {
  content: attr(data-tooltip);
  right: 0;
  bottom: calc(100% + 10px);
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #0c1e2b;
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
  box-shadow: 0 10px 20px rgba(12, 30, 43, 0.2);
  transform: translateY(4px);
  white-space: normal;
}

.tooltip::before {
  content: '';
  right: 10px;
  bottom: calc(100% + 4px);
  width: 8px;
  height: 8px;
  background: #0c1e2b;
  transform: rotate(45deg);
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.notification {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(12, 30, 43, 0.04);
}

.offer {
  display: grid;
  gap: 10px;
}

.payslip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  background: rgba(12, 30, 43, 0.04);
  padding: 12px;
  border-radius: 12px;
}

@media (max-width: 980px) {
  .app {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar {
    position: static;
    width: 100%;
    flex: none;
    min-height: auto;
    max-height: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .grid.two, .grid.three {
    grid-template-columns: 1fr;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .filter-range {
    grid-template-columns: 1fr;
  }

  .pipeline {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-checkin {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .top-controls {
    width: 100%;
  }

  .assistant {
    width: 90vw;
    right: 5vw;
    left: auto;
  }
}

@media (max-width: 600px) {
  .app {
    padding: 14px;
  }

  .table-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .matrix-row,
  .roster-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
