/* Employee CRM unified design system tokens (Batch A).
   Bluhorizon palette: deep blue primary, sky blue, and restrained cyan.
   No remote font dependencies — local Arabic-safe stack only. */

:root {
  /* Surfaces */
  --bg-page: #F4F7FB;
  --bg-card: #FFFFFF;
  --bg-soft: #EEF3F9;
  --bg-elevated: #F8FAFD;
  --bg-sidebar: #FFFFFF;
  --bg-card-solid: #FFFFFF;
  --bg-primary: #EEF3F9;

  /* Text */
  --color-text: #162B3D;
  --color-text-primary: #162B3D;
  --color-text-secondary: #62778A;
  --color-text-muted: #8A9AAA;

  /* Brand / primary (dark teal) */
  --color-primary: #1769E0;
  --color-primary-hover: #1059C4;
  --color-primary-light: rgba(23, 105, 224, 0.08);
  --color-primary-soft: #EAF2FF;

  /* Accent (yellow) — secondary only, ~2-4% of screen */
  --color-accent: #168FBE;
  --color-accent-hover: #11779F;
  --color-accent-light: rgba(22, 143, 190, 0.10);
  --color-accent-soft: #E7F6FC;

  /* Semantic */
  --color-success: #3F7D61;
  --color-success-light: #E8F1EC;
  --color-success-soft: #E8F1EC;
  --color-warning: #B96A42;
  --color-warning-light: #F7ECE6;
  --color-warning-soft: #F7ECE6;
  --color-danger: #B44D4D;
  --color-danger-hover: #9C3D3D;
  --color-danger-light: #F8EAEA;
  --color-danger-soft: #F8EAEA;

  /* Borders */
  --border-color: #DFE7F0;
  --border-strong: #C8D5E2;
  --focus: #1769E0;

  /* Radii */
  --radius-sm: 10px;   /* inputs / buttons */
  --radius-md: 12px;   /* cards */
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows — employee pages use only level 0 / level 1 */
  --shadow-0: none;
  --shadow-1: 0 2px 8px rgba(20, 30, 35, 0.05);
  --shadow-sm: 0 2px 8px rgba(20, 30, 35, 0.05);
  --shadow-md: 0 2px 8px rgba(20, 30, 35, 0.05);
  --shadow-xl: 0 2px 8px rgba(20, 30, 35, 0.05);

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Typography — local Arabic-safe stack, no remote fonts */
  --font-family: 'Segoe UI', Tahoma, 'Geeza Pro', 'Noto Sans Arabic', system-ui, -apple-system, sans-serif;
  --fs-app-title: 22px;
  --fs-page-title: 21px;
  --fs-task-title: 19px;
  --fs-section: 17px;
  --fs-guidance: 18px;
  --fs-body: 15px;
  --fs-meta: 13px;
  --fs-button: 15px;

  --transition: all 0.2s ease;
}

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

body {
  background: var(--bg-page);
  color: var(--color-text);
  font-family: var(--font-family);
  direction: rtl;
  line-height: 1.5;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

.app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg-page);
  position: relative;
  padding: 0 0 calc(12px + env(safe-area-inset-bottom)) 0;
}

body.drawer-open {
  overflow: hidden;
}

.dashboard-container {
  width: 100%;
  max-width: 1220px;
  background: var(--bg-card);
}

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

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 52px;
}

/* ===== Header + RTL side drawer navigation ===== */

.nav-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--color-primary);
  cursor: pointer;
  transition: var(--transition);
  margin-inline-start: 4px;
}

.nav-menu-btn:hover {
  background: var(--bg-soft);
  border-color: var(--color-text-muted);
}

.nav-menu-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.app-page-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--color-primary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-account {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  max-width: 38%;
}

.header-account-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-account-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.header-account-badge svg { width: 16px; height: 16px; }

/* Overlay */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(38, 38, 38, 0.42);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.drawer-overlay:not([hidden]) {
  opacity: 1;
}

/* Drawer — slides from the right (RTL) */
.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 86vw;
  max-width: 340px;
  background: var(--bg-card);
  border-inline-start: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.24s ease;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  visibility: hidden;
}

.side-drawer[aria-hidden="false"] {
  transform: translateX(0);
  visibility: visible;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-color);
}

.drawer-account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.drawer-account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--color-primary-light);
  border: 1px solid var(--border-color);
  color: var(--color-primary);
  flex-shrink: 0;
}

.drawer-account-avatar svg { width: 20px; height: 20px; }

.drawer-account-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.drawer-account-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-account-role {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.drawer-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.drawer-close-btn:hover {
  background: var(--bg-soft);
  border-color: var(--color-text-muted);
}

.drawer-close-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.drawer-nav {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px;
}

.drawer-group {
  margin-bottom: 14px;
}

.drawer-group-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-text-muted);
  margin: 0 0 6px;
  padding: 0 6px;
}

.drawer-group-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
  border-inline-start: 3px solid transparent;
  transition: var(--transition);
}

.drawer-link:hover {
  background: var(--bg-soft);
}

.drawer-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.drawer-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.drawer-link-icon svg { width: 20px; height: 20px; }

.drawer-link-label {
  flex: 1;
  min-width: 0;
}

.drawer-link-check {
  display: inline-flex;
  color: var(--color-accent);
  flex-shrink: 0;
}

.drawer-link-check svg { width: 18px; height: 18px; }

.drawer-link.active {
  background: var(--color-accent-light);
  border-inline-start-color: var(--color-accent);
  color: var(--color-primary);
  font-weight: 800;
}

.drawer-link.active .drawer-link-icon {
  color: var(--color-accent);
}

.drawer-footer {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border-color);
}

.drawer-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
}

.drawer-logout:hover {
  background: var(--bg-soft);
  color: var(--color-primary);
}

.drawer-logout svg { width: 20px; height: 20px; }

main {
  width: 100%;
  padding: 12px 16px;
}

svg { flex-shrink: 0; }

.panel {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 22px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

.panel h3 {
  color: var(--color-primary);
  margin-bottom: 14px;
}

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

.company-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 700;
}

.company-form input,
.company-form select,
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  background: var(--bg-card-solid);
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  min-width: 680px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table thead th {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  font-weight: 800;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(48, 48, 48, 0.03);
}

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

.notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice.success {
  background: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid rgba(74, 123, 90, 0.15);
}

.notice.error {
  background: rgba(193, 112, 74, 0.08);
  color: var(--color-danger);
  border: 1px solid rgba(193, 112, 74, 0.15);
}

.shift-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 22px;
  background: var(--bg-card-solid);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.shift-panel:hover {
  box-shadow: var(--shadow-md);
}

.shift-panel.active {
  border-color: rgba(74, 123, 90, 0.3);
  background: var(--bg-card-solid);
}

.shift-panel strong {
  display: block;
  color: var(--color-primary);
  font-size: 28px;
  line-height: 1.1;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-form input {
  padding: 8px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: var(--transition);
}

.inline-form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.page-title-row,
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.page-title-row h2,
.panel-title-row h3 {
  color: var(--color-primary);
  margin: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.kpi {
  background: var(--color-accent-light);
  border: 1px solid rgba(255, 204, 45, 0.15);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.kpi::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 100%;
  height: 3px;
  background: var(--color-accent);
}

.kpi span {
  display: block;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi strong {
  display: block;
  color: var(--color-primary);
  font-size: 30px;
  line-height: 1.1;
  margin-top: 5px;
  font-weight: 800;
}

.filters-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg-primary);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.filters-form input,
.filters-form select,
.stack-form input,
.stack-form select,
.stack-form textarea {
  padding: 8px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  background: var(--bg-card-solid);
  transition: var(--transition);
}

.filters-form input:focus,
.filters-form select:focus,
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.btn-small {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--bg-primary);
  color: var(--color-text);
}

.status-new { background: rgba(48, 48, 48, 0.08); color: var(--color-primary); }
.status-contacted { background: rgba(74, 123, 90, 0.08); color: var(--color-success); }
.status-interested { background: rgba(74, 123, 90, 0.15); color: var(--color-success); }
.status-meeting_scheduled { background: var(--color-accent-light); color: #303030; }
.status-not_interested { background: rgba(193, 112, 74, 0.1); color: var(--color-danger); }
.status-customer { background: rgba(74, 123, 90, 0.2); color: var(--color-success); }

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.details-list {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 14px;
  margin-bottom: 16px;
}

.details-list dt { color: var(--color-text-muted); font-weight: 800; }
.details-list dd { margin: 0; font-weight: 700; }

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--bg-card-solid);
  transition: var(--transition);
}

.timeline-item:hover { box-shadow: var(--shadow-sm); }

.timeline-item strong,
.timeline-item span { display: block; }

.timeline-item p { margin-top: 6px; }

.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
}

.kanban-column {
  min-height: 480px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  scroll-snap-align: start;
  box-shadow: var(--shadow-sm);
}

.kanban-column-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.kanban-column-header h3 { color: var(--color-primary); margin: 0; font-size: 16px; }
.kanban-column-header p { color: var(--color-text-muted); font-size: 11px; line-height: 1.4; margin-top: 3px; }

.kanban-column-header > span {
  display: inline-flex;
  min-width: 28px; height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-primary-light);
  border: 1px solid var(--border-color);
  color: var(--color-primary);
  font-weight: 900;
  font-size: 13px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
}

.kanban-cards.drag-over {
  outline: 2px dashed var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
  background: rgba(48, 48, 48, 0.03);
}

.kanban-empty {
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px;
  color: var(--color-text-muted);
  text-align: center;
  background: rgba(245, 240, 235, 0.4);
}

.kanban-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-right: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: var(--transition);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.kanban-card.dragging { opacity: 0.5; cursor: grabbing; }

.kanban-card.status-not_interested { border-right-color: var(--color-danger); }
.kanban-card.status-interested,
.kanban-card.status-customer,
.kanban-card.status-meeting_scheduled { border-right-color: var(--color-success); }

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

.kanban-card-top strong { color: var(--color-primary); font-size: 15px; line-height: 1.3; }

.kanban-card-top span {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 30px; height: 26px;
  border-radius: 6px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 900;
  font-size: 12px;
}

.kanban-meta {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 700;
}

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

.kanban-tags span {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-primary);
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 800;
}

.kanban-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 12px;
}

.kanban-actions .btn { padding-inline: 8px; font-size: 12px; min-height: 34px; }

.meeting-card-form {
  display: none;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.meeting-card-form.open { display: grid; }

.meeting-card-form input {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: var(--transition);
}

.meeting-card-form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.lively-kpis .kpi:nth-child(1) { border-top: 3px solid var(--color-accent); }
.lively-kpis .kpi:nth-child(2) { border-top: 3px solid var(--color-success); }
.lively-kpis .kpi:nth-child(3) { border-top: 3px solid var(--color-primary); }

.calendar-booking-panel {
  background: var(--bg-card-solid);
}

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

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.calendar-day {
  min-height: 380px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card-solid);
  box-shadow: var(--shadow-sm);
  padding: 10px;
  transition: var(--transition);
}

.calendar-day:hover { box-shadow: var(--shadow-md); }

.calendar-day.today {
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 2px rgba(255, 204, 45, 0.12), var(--shadow-md);
}

.calendar-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  color: var(--color-primary);
}

.calendar-events { display: grid; gap: 6px; margin-top: 10px; }
.calendar-empty { color: var(--color-text-muted); font-size: 11px; text-align: center; padding: 16px 8px; }

.calendar-event {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: right;
  border: 0;
  border-right: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
  background: rgba(48, 48, 48, 0.04);
  color: var(--color-text);
  padding: 8px 10px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.calendar-event:hover {
  background: rgba(48, 48, 48, 0.08);
  transform: translateX(2px);
}

.calendar-event span { color: var(--color-primary); font-weight: 900; font-size: 11px; }
.calendar-event strong { font-size: 12px; }
.calendar-event small { color: var(--color-text-muted); font-weight: 700; font-size: 11px; }

.meeting-popover {
  display: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card-solid);
  padding: 10px;
  box-shadow: var(--shadow-md);
}

.meeting-popover.open { display: grid; gap: 5px; }

.admin-grid { align-items: start; }

.status-bars { display: grid; gap: 12px; }

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

.status-bar-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-text);
  font-size: 12px;
}

.status-bar-row span { color: var(--color-text-muted); font-weight: 800; }

.status-bar-row i {
  display: block;
  height: 8px;
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width 0.5s ease;
}

#shift-timer {
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

/* Profile / Company page */
.profile-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 0 30px;
}

.company-header-hero {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.company-header-hero::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 6px; height: 100%;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
}

.company-identity { display: flex; align-items: center; gap: 18px; }

.company-badge-avatar {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--color-accent), #D4A800);
  color: #fff;
  font-weight: 800; font-size: 24px;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(255, 204, 45, 0.2);
}

.company-main-details h1 { font-size: 22px; font-weight: 800; color: var(--color-primary); line-height: 1.2; margin-bottom: 4px; }
.company-main-details p { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }

.company-meta-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.score-indicator-badge {
  background: var(--color-accent-light);
  color: #303030;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(255, 204, 45, 0.2);
}

.sector-indicator-tag {
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}

.company-workspace-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 950px) {
  .company-workspace-grid { grid-template-columns: 1fr; }
}

.sidebar-panel {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.sidebar-section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.meta-info-list { display: flex; flex-direction: column; gap: 14px; }
.meta-info-item { display: flex; flex-direction: column; gap: 3px; }
.meta-info-item label { font-size: 11px; font-weight: 800; color: var(--color-text-muted); }
.meta-info-item span, .meta-info-item a { font-size: 14px; font-weight: 700; color: var(--color-text); text-decoration: none; word-break: break-all; }
.meta-info-item a:hover { color: var(--color-accent); text-decoration: underline; }

.actions-tabs-panel {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}

.tabs-navigation {
  display: flex;
  gap: 3px;
  margin-bottom: 18px;
  overflow-x: auto;
  background: var(--bg-primary);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.tab-trigger {
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tab-trigger:hover { color: var(--color-primary); background: rgba(255, 255, 255, 0.6); }
.tab-trigger.active { color: var(--color-primary); background: var(--color-accent); box-shadow: 0 3px 10px rgba(255, 204, 45, 0.3); }

.tab-content-pane { display: none; animation: fadeIn 0.25s ease-out; }
.tab-content-pane.active { display: block; }

.timeline-feed-panel {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.activity-timeline {
  position: relative;
  padding-right: 28px;
  margin-top: 12px;
}

.activity-timeline::after {
  content: '';
  position: absolute;
  top: 5px; bottom: 5px;
  right: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent), var(--color-success));
  opacity: 0.35;
}

.timeline-card { position: relative; margin-bottom: 22px; }
.timeline-card:last-child { margin-bottom: 0; }

.timeline-icon-wrapper {
  position: absolute;
  right: -28px; top: 3px;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--bg-card-solid);
  border: 2.5px solid var(--color-primary);
  display: grid; place-items: center;
  z-index: 2;
  transition: var(--transition);
}

.timeline-card.task .timeline-icon-wrapper { border-color: var(--color-primary); background: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
.timeline-card.meeting .timeline-icon-wrapper { border-color: var(--color-accent); background: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-light); }
.timeline-card.note .timeline-icon-wrapper { border-color: var(--color-success); box-shadow: 0 0 0 3px var(--color-success-light); }
.timeline-card.system .timeline-icon-wrapper { border-color: var(--color-text-muted); }
.timeline-card.whatsapp .timeline-icon-wrapper { border-color: #25D366; background: #25D366; box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12); }

.timeline-content-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  position: relative;
  transition: var(--transition);
}

.timeline-content-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(48, 48, 48, 0.12);
  transform: translateX(-2px);
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

.activity-badge { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.badge-task { background: var(--color-primary-light); color: var(--color-primary); }
.badge-meeting { background: var(--color-accent-light); color: #8B6B4A; }
.badge-note { background: var(--color-success-light); color: var(--color-success); }
.badge-whatsapp { background: rgba(37, 211, 102, 0.1); color: #128C7E; }
.badge-system { background: rgba(140, 130, 121, 0.1); color: var(--color-text-muted); }

.activity-actor-time { font-size: 11px; color: var(--color-text-muted); font-weight: 600; }

.activity-body {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.5;
}

.excel-dropzone {
  border: 2px dashed rgba(48, 48, 48, 0.2);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 18px;
}

.excel-dropzone:hover, .excel-dropzone.dragover {
  border-color: var(--color-primary);
  background: rgba(48, 48, 48, 0.04);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.excel-dropzone .dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.excel-dropzone .dropzone-icon { color: var(--color-primary); margin-bottom: 8px; opacity: 0.7; transition: var(--transition); }
.excel-dropzone:hover .dropzone-icon { transform: translateY(-4px) scale(1.05); opacity: 1; }
.excel-dropzone .main-text { font-size: 15px; font-weight: 700; color: var(--color-text); }
.excel-dropzone .main-text span { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
.excel-dropzone .sub-text { font-size: 11px; color: var(--color-text-muted); }

.status-msg { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.status-msg.success { background: var(--color-success-light); color: var(--color-success); border: 1px solid rgba(74, 123, 90, 0.15); }
.status-msg.error { background: rgba(193, 112, 74, 0.08); color: var(--color-danger); border: 1px solid rgba(193, 112, 74, 0.15); }

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 700; }

.error-message {
  background: rgba(193, 112, 74, 0.08);
  color: var(--color-danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13px;
  text-align: center;
  border: 1px solid rgba(193, 112, 74, 0.1);
}

.service-tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 800;
  margin-top: 4px;
  margin-bottom: 4px;
  line-height: 1;
  border: 1px solid transparent;
}

.service-tag-0 { background: var(--bg-primary); color: var(--color-primary); border-color: rgba(48, 48, 48, 0.12); }
.service-tag-1 { background: #FCE8E4; color: #9D5A4A; border-color: rgba(157, 90, 74, 0.12); }
.service-tag-2 { background: #EAF5EE; color: #4A7B5A; border-color: rgba(74, 123, 90, 0.12); }
.service-tag-3 { background: #FCF3E8; color: #B8864E; border-color: rgba(184, 134, 78, 0.12); }
.service-tag-4 { background: #F0EDEB; color: #6B5A4E; border-color: rgba(107, 90, 78, 0.12); }
.service-tag-5 { background: #F8EFE8; color: #9C7A5A; border-color: rgba(156, 122, 90, 0.12); }
.service-tag-6 { background: #FAEBE4; color: #B0805A; border-color: rgba(176, 128, 90, 0.12); }
.service-tag-7 { background: #E8F4EC; color: #3D6B4A; border-color: rgba(61, 107, 74, 0.12); }
.service-tag-8 { background: #FCF0E6; color: #C47A4A; border-color: rgba(196, 122, 74, 0.12); }

/* ===== Dashboard Page — Redesigned ===== */

/* ===== Employee Shift Card (mobile-first, stacked) ===== */
.shift-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.shift-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.shift-card__status {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.shift-card__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
}
.shift-card__subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-top: 2px;
}
.shift-card__timer {
  flex-shrink: 0;
}
.shift-card__timer strong {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0.5px;
  color: var(--color-text);
  min-width: 92px;
}
.shift-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.shift-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
}
.shift-stat b {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-text);
}
.shift-stat.completed { background: var(--color-success-light); color: var(--color-success); border-color: transparent; }
.shift-stat.completed b { color: var(--color-success); }
.shift-stat.pending { background: var(--color-accent-light); border-color: transparent; color: var(--color-accent); }
.shift-stat.meetings { background: var(--bg-soft); }
.shift-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shift-card__actions .btn {
  flex: 1 1 auto;
  min-height: 46px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 800;
  margin: 0;
}
.shift-action-primary { flex: 1 1 100%; }
.shift-card__note {
  display: block;
}
.shift-card__note input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-card);
}
.shift-card__note input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  font-family: inherit;
  min-height: 38px;
  text-decoration: none;
  line-height: 1;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn:focus { outline: none; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-text);
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
}
.btn-success {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}
.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn-outline {
  background: var(--bg-card);
  color: var(--color-text);
  border-color: var(--border-color);
}
.btn-outline:hover {
  background: var(--bg-soft);
  border-color: var(--color-text-muted);
}
.btn-secondary {
  background: var(--bg-soft);
  color: var(--color-text-secondary);
  border-color: var(--border-color);
}

/* ===== Task Card ===== */
.dash-task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.dash-task-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--color-accent);
  border-radius: 0 2px 2px 0;
}
.dash-task-card.urgent::before { background: var(--color-danger); }

.dash-task-hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 8px;
}
.dash-task-hdr-main h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.2;
  margin: 0;
}
.dash-task-hdr-main .dash-subtitle {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-top: 2px;
}
.dash-priority-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  background: var(--color-accent-light);
  color: var(--color-accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-priority-badge.high {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.dash-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.dash-info-cell {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.dash-info-cell-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.dash-info-cell-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  word-break: break-word;
}
.dash-info-cell-value a { color: var(--color-text); text-decoration: none; }
.dash-info-cell-value .service-name { color: var(--color-success); font-weight: 800; }

.dash-brief {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-right: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.dash-brief h4 {
  font-size: 10px;
  font-weight: 800;
  color: var(--color-text-muted);
  margin: 0 0 4px;
}
.dash-brief p {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
}

.dash-whatsapp {
  background: var(--color-accent-light);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
}
.dash-whatsapp-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.dash-whatsapp-hdr h4 {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-text);
  margin: 0;
}
.dash-whatsapp textarea {
  width: 100%;
  height: 60px;
  padding: 8px 10px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  background: var(--bg-card);
}
.dash-whatsapp textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.dash-whatsapp-req {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  background: var(--bg-soft);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
}
.dash-whatsapp-req input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}
.dash-whatsapp-req span {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

.dash-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dash-actions .btn {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  flex: 1;
  min-width: 0;
}
.dash-actions .btn-primary {
  background: var(--color-accent);
  color: var(--color-text);
  border-color: var(--color-accent);
}
.dash-actions .btn-success {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}
.dash-actions .btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.dash-actions .btn-outline {
  background: var(--bg-card);
  color: var(--color-text);
  border-color: var(--border-color);
}
.dash-actions .btn-outline:hover {
  background: var(--bg-soft);
  border-color: var(--color-text-muted);
}
.dash-actions .btn-escalate {
  background: var(--bg-card);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}
.dash-actions .btn-escalate:hover {
  background: var(--color-danger);
  color: #fff;
}

/* Snooze picker */
.dash-snooze-box {
  display: none;
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.dash-snooze-box label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 8px;
}
.dash-snooze-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.dash-snooze-row input[type=datetime-local] {
  padding: 7px 10px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  background: var(--bg-card);
}
.dash-snooze-row input:focus { outline: none; border-color: var(--color-primary); }
.dash-snooze-row .btn { min-height: 34px; padding: 6px 16px; font-size: 12px; }

/* Empty / Break states */
.dash-empty {
  text-align: center;
  padding: 40px 16px;
}
.dash-empty-icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 2px solid var(--border-color);
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--color-text-muted);
}
.dash-empty h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text);
  margin: 0 0 4px;
}
.dash-empty p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0 0 16px;
}
.dash-break-state {
  text-align: center;
  padding: 40px 16px;
  border: 2px dashed var(--color-accent);
  border-radius: var(--radius-md);
  background: var(--color-accent-light);
}
.dash-break-state .dash-empty-icon {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}
.dash-break-state h3 { color: var(--color-text); }
.dash-break-state p { color: var(--color-text-secondary); max-width: 400px; margin: 0 auto 16px; }

@media (max-width: 760px) {
  .dash-task-hdr { flex-direction: column; }
  .dash-task-card { padding: 18px; }
}

/* ===== Charts Section (Reports Page) ===== */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px 0;
}
.chart-card-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-card-header h3 svg {
  width: 20px;
  height: 20px;
}
.chart-card-body {
  padding: 14px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}
.chart-container.doughnut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 270px;
}
.chart-container.doughnut-wrap canvas {
  max-width: 240px;
  max-height: 240px;
}
.chart-container.bar-wrap {
  height: 280px;
}
.chart-container.bar-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.chart-legend-custom {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: center;
  margin-top: 4px;
  padding: 0 4px;
}
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}
.chart-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* meeting list */
.meeting-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
}
.meeting-item + .meeting-item {
  border-top: 1px solid var(--border-color);
}
.meeting-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 6px 8px;
  background: var(--color-accent-light);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}
.meeting-time small {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary);
}
.meeting-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meeting-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}
.meeting-meta {
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* done stats panel */
.done-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.done-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.done-stat-label {
  font-size: 13px;
  color: var(--color-text-secondary);
}
.done-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}
.done-stat-divider {
  height: 1px;
  background: var(--border-color);
  margin: 2px 0;
}

@media (max-width: 860px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-container.doughnut-wrap canvas { max-width: 200px; max-height: 200px; }
  .chart-container.doughnut-wrap { height: 240px; }
  .chart-container.bar-wrap { height: 260px; }
}

/* ===== Guidance Panel ===== */
.dash-guidance {
  margin-top: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
}
.dash-guidance-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  width: 100%;
  justify-content: space-between;
}
.dash-guidance-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
  background: var(--color-accent-light);
}
.dash-guidance-arrow {
  font-size: 10px;
  transition: var(--transition);
}
.dash-guidance-content {
  display: none;
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.dash-guidance-section {
  margin-bottom: 10px;
}
.dash-guidance-section:last-child { margin-bottom: 0; }
.dash-guidance-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.dash-guidance-section p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text);
  margin: 0;
}
.dash-guidance-questions {
  margin: 0;
  padding: 0;
  list-style: none;
}
.dash-guidance-questions li {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text);
  padding: 4px 0 4px 16px;
  position: relative;
}
.dash-guidance-questions li::before {
  content: '•';
  position: absolute;
  right: 0;
  color: var(--color-accent);
  font-weight: 700;
}
.dash-guidance-avoid {
  color: var(--color-danger) !important;
}

/* Guidance fallback message */
.dash-guidance-fallback {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 600;
  text-align: center;
}

/* ===== Outcome Panel ===== */
.dash-outcome-panel {
  margin-top: 12px;
  border-top: 2px solid var(--color-accent);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.dash-outcome-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-color);
}
.dash-outcome-hdr h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.dash-outcome-body {
  padding: 14px;
}
.dash-outcome-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-outcome-opt {
  display: block;
  width: 100%;
  text-align: right;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
}
.dash-outcome-opt:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}
.dash-outcome-opt strong { display: block; margin-bottom: 2px; }
.dash-outcome-opt span { font-size: 12px; color: var(--color-text-muted); }
.dash-outcome-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-outcome-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-outcome-q {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}
.dash-req { color: var(--color-danger); }
.dash-outcome-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dash-outcome-chip {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-outcome-chip:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}
.dash-outcome-chip.selected {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-text);
  font-weight: 700;
}
.dash-outcome-input,
.dash-outcome-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-card);
  color: var(--color-text);
}
.dash-outcome-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-card);
  color: var(--color-text);
  resize: vertical;
  font-family: inherit;
}
.dash-outcome-note {
  margin-top: 12px;
}
.dash-outcome-note label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.dash-outcome-error {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--color-danger-light);
  color: var(--color-danger);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}
.dash-outcome-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  justify-content: flex-end;
}
.dash-outcome-loading {
  padding: 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}
.dash-dnc-warning {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--color-danger-light);
  border: 1px solid var(--color-danger-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-danger);
}

/* ===== Desktop Overrides ===== */
@media (min-width: 768px) {
  body {
    padding: 24px 0;
  }
  .app-shell {
    max-width: 480px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    min-height: auto;
    box-shadow: var(--shadow-md);
  }
}

/* ===== Mobile Micro-Adjustments ===== */
@media (max-width: 380px) {
  .app-header {
    padding: 8px 12px;
  }
  .user-badge span {
    max-width: 70px;
  }
  .dash-task-card {
    padding: 12px;
  }
  .dash-info-grid {
    gap: 4px;
  }
  .dash-info-cell {
    padding: 6px 8px;
  }
  .dash-actions .btn {
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* ===== Employee mobile UI cleanup (calm, progressive disclosure) ===== */

/* Compact company summary */
.dash-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.dash-summary-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.dash-summary-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--color-text-muted);
  min-width: 42px;
}
.dash-summary-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  word-break: break-word;
}
.dash-summary-reason {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Primary call action */
.dash-call-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  background: var(--color-success);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  margin-bottom: 12px;
  transition: var(--transition);
}
.dash-call-btn:hover { background: var(--color-primary); color: #fff; }
.dash-call-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.dash-call-text { display: flex; flex-direction: column; line-height: 1.2; }
.dash-call-label { font-size: 16px; font-weight: 800; }
.dash-call-num { font-size: 13px; font-weight: 600; opacity: 0.92; direction: ltr; text-align: left; }
.dash-call-btn--disabled {
  background: var(--bg-soft);
  color: var(--color-text-muted);
  border: 1px dashed var(--border-color);
  cursor: default;
}

/* Collapsible section buttons (branches / details) */
.dash-collapsible-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  margin-bottom: 10px;
  transition: var(--transition);
}
.dash-collapsible-btn svg { width: 18px; height: 18px; color: var(--color-text-secondary); }
.dash-collapsible-btn:hover { background: var(--bg-soft); }
.dash-caret { margin-inline-start: auto; font-size: 12px; color: var(--color-text-muted); }

/* Branches (now toggled) */
.dash-branches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.dash-branch-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  color: var(--color-text);
  min-height: 44px;
}
.dash-branch-btn:hover { border-color: var(--color-primary); background: var(--bg-soft); }
.dash-branch-btn.active { border-color: var(--color-accent); background: var(--color-accent-light); }

/* Outcome action layout */
.dash-primary-action {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
}
.dash-actions-secondary {
  display: flex;
  gap: 8px;
}
.dash-actions-secondary .btn {
  flex: 1;
  min-height: 44px;
  font-size: 13px;
  font-weight: 700;
}

/* Outcome menu (progressive disclosure) */
.dash-outcome-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.dash-outcome-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.dash-outcome-menu-btn:hover { border-color: var(--color-primary); background: var(--bg-soft); }
.dash-outcome-menu-btn.selected { border-color: var(--color-accent); background: var(--color-accent-light); }

/* Reduce yellow on guidance "ask" panel → neutral surface */
.dash-guidance-ask {
  background: var(--bg-soft);
  border-right: 3px solid var(--border-color);
}
.dash-guidance-ask-label { color: var(--color-text-muted); }

/* ===== Mobile breakpoints ===== */
@media (max-width: 760px) {
  /* Calendar: vertical day list instead of 7-column grid */
  .calendar-week {
    display: block;
    overflow-x: visible;
  }
  .calendar-day {
    min-height: 0;
    margin-bottom: 12px;
  }
  .calendar-day:last-child { margin-bottom: 0; }

  /* Company form: single column */
  .company-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Companies: hide table, show cards */
  .data-table { display: none; }
  .company-cards { display: block; }

/* Compact stats summary instead of big KPI cards */
.compact-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-secondary);
}
.compact-stats strong { color: var(--color-text); font-size: 15px; font-weight: 800; }

/* Task card spacious but calm */
.dash-task-card { padding: 14px; }

/* Mobile company cards */
.company-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.company-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.company-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.company-card-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.3;
}
.company-card-sector {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-top: 2px;
}
.company-card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}
.company-card-meta .company-card-phone { direction: ltr; text-align: left; }
.company-card-actions {
  display: flex;
  gap: 8px;
}
.company-card-actions .btn { flex: 1; min-height: 44px; font-size: 13px; font-weight: 700; }

/* Collapsible add forms (mobile-friendly accordions) */
.company-add,
.meeting-add {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
}
.company-add > summary,
.meeting-add > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 800;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.company-add > summary::-webkit-details-marker { display: none; }
.company-add > summary svg,
.meeting-add > summary svg { width: 18px; height: 18px; }
.company-add > form,
.meeting-add > form {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border-color);
}

@media (min-width: 761px) {
  .company-cards { display: none; }
}
