/* Panou de lucru */
.ops-page {
  padding: 16px 20px 40px;
  max-width: 1320px;
  margin: 0 auto;
}
.ops-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.ops-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}
.ops-page-title i {
  color: #3b82f6;
  margin-right: 6px;
}
.ops-page-sub {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 2px;
}
.ops-refresh-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.ops-refresh-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.ops-board {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Sumar */
.ops-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.ops-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
div.ops-kpi {
  cursor: default;
}
button.ops-kpi:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.ops-kpi i {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.ops-kpi b {
  display: block;
  font-size: 1.45rem;
  line-height: 1.1;
  color: #0f172a;
}
.ops-kpi span {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}
.ops-kpi-blue i { background: #dbeafe; color: #2563eb; }
.ops-kpi-violet i { background: #ede9fe; color: #7c3aed; }
.ops-kpi-amber i { background: #fef3c7; color: #d97706; }
.ops-kpi-green i { background: #dcfce7; color: #16a34a; }
.ops-kpi-red i { background: #fee2e2; color: #dc2626; }
.ops-kpi-orange i { background: #ffedd5; color: #ea580c; }
.ops-kpi-red:not(.is-zero) {
  border-color: #fecaca;
  background: #fff7f7;
}
.ops-kpi-red.is-zero i {
  background: #f1f5f9;
  color: #94a3b8;
}

/* Panouri */
.ops-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: 4px solid #94a3b8;
  border-radius: 12px;
  padding: 14px 16px 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  min-width: 0;
}
.ops-accent-blue { border-top-color: #3b82f6; }
.ops-accent-violet { border-top-color: #8b5cf6; }
.ops-accent-amber { border-top-color: #f59e0b; }
.ops-accent-green { border-top-color: #22c55e; }
.ops-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ops-panel-head i {
  color: #64748b;
}
.ops-panel-head h2 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}
.ops-panel-count {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 2px 10px;
}
/* Urmărire: vechime, sarcini, amânare, prioritate */
.ops-age {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 5px;
  background: #f1f5f9;
  color: #64748b;
}
.ops-age.lvl-critic { background: #dc2626; color: #fff; }
.ops-age.lvl-ridicat { background: #fed7aa; color: #9a3412; }
.ops-age.lvl-normal { background: #e2e8f0; color: #334155; }
.ops-age.is-snoozed { background: #e0e7ff; color: #3730a3; }
.ops-item-follow {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}
.ops-task-chip,
.ops-snooze-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 8px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-task-chip { background: #e0f2fe; color: #075985; }
.ops-task-chip.is-late { background: #fee2e2; color: #991b1b; }
.ops-snooze-chip { background: #eef2ff; color: #3730a3; }

.ops-prio-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
}
.ops-prio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #eef2f6;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
}
.ops-prio-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ops-prio-main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.ops-prio-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.ops-prio-top .ops-pill {
  font-size: 0.68rem !important;
  padding: 1px 8px !important;
}
.ops-prio-kind {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
}
.ops-manage .modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ops-manage-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.ops-manage-section h6 {
  margin: 0 0 4px;
  font-weight: 700;
}
.ops-manage-section label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
}
.ops-manage-hint {
  font-size: 0.72rem;
  color: #64748b;
}
.ops-accent-red { border-top-color: #ef4444; }

.ops-add-btn {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.ops-add-btn:hover {
  background: #dbeafe;
}
.ops-add-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px dashed #93c5fd;
  border-radius: 10px;
  background: #f8fbff;
}
.ops-add-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  background: #fff;
}
.ops-add-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.ops-add-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.ops-add-cancel,
.ops-add-save {
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.ops-add-cancel {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
}
.ops-add-save {
  border: none;
  background: #2563eb;
  color: #fff;
}
.ops-add-save:hover {
  background: #1d4ed8;
}
.ops-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}

/* Grupuri și rânduri */
.ops-group {
  margin-bottom: 10px;
}
.ops-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px 6px;
}
.ops-group-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  font-weight: 700;
}
.ops-group-count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0 8px;
}
.ops-group.is-empty .ops-group-head {
  opacity: 0.5;
  padding-bottom: 2px;
}
.ops-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ops-tone-slate { background: #94a3b8; }
.ops-tone-amber { background: #f59e0b; }
.ops-tone-violet { background: #8b5cf6; }
.ops-tone-green { background: #22c55e; }
.ops-tone-blue { background: #3b82f6; }
.ops-tone-red { background: #ef4444; }

.ops-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 3px 4px 3px 12px;
  font-size: 0.78rem;
  font-weight: 700;
}
.ops-pill b {
  min-width: 22px;
  text-align: center;
  border-radius: 999px;
  padding: 0 7px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.74rem;
}
.ops-pill-slate { background: #f1f5f9; color: #334155; }
.ops-pill-amber { background: #fef3c7; color: #92400e; }
.ops-pill-violet { background: #ede9fe; color: #5b21b6; }
.ops-pill-green { background: #dcfce7; color: #166534; }
.ops-pill-blue { background: #dbeafe; color: #1e40af; }
.ops-pill-red { background: #fee2e2; color: #991b1b; }
.ops-pill-orange { background: #ffedd5; color: #9a3412; }
.ops-pill-rose { background: #fce7f3; color: #9d174d; }

.ops-item { border-left-width: 4px !important; }
.ops-edge-slate { border-left-color: #94a3b8 !important; background: #f8fafc !important; border-color: #eef2f6; }
.ops-edge-amber { border-left-color: #f59e0b !important; background: #fffbeb !important; border-color: #fdf0c8; }
.ops-edge-violet { border-left-color: #8b5cf6 !important; background: #f7f5ff !important; border-color: #ebe5fd; }
.ops-edge-green { border-left-color: #22c55e !important; background: #f2fcf5 !important; border-color: #d9f5e2; }
.ops-edge-blue { border-left-color: #3b82f6 !important; background: #f2f7ff !important; border-color: #dbe7fc; }
.ops-edge-red { border-left-color: #ef4444 !important; background: #fff5f5 !important; border-color: #fde0e0; }
.ops-edge-orange { border-left-color: #ea580c !important; background: #fff4ec !important; border-color: #fde0cc; }
.ops-edge-orange .ops-mini-bar span { background: #ea580c; }
.ops-edge-orange .ops-mini b { color: #c2410c; }
.ops-edge-rose { border-left-color: #db2777 !important; background: #fdf2f8 !important; border-color: #fad7e8; }
.ops-item[class*="ops-edge-"]:hover { filter: brightness(0.98); }
.ops-item.is-urgent { background: #fee2e2 !important; border-left-color: #dc2626 !important; }

/* Separare vizibilă între grupuri */
.ops-group + .ops-group {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  margin-top: 4px;
}
.ops-group-head {
  padding: 2px 0 8px !important;
}
.ops-pill {
  font-size: 0.86rem !important;
  padding: 5px 5px 5px 14px !important;
  letter-spacing: 0.01em;
}
.ops-pill b {
  font-size: 0.8rem !important;
  min-width: 26px !important;
}

.ops-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 96px;
}
.ops-mini-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.ops-mini-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #3b82f6;
}
.ops-mini b {
  font-size: 0.74rem;
  color: #1e40af;
  min-width: 30px;
  text-align: right;
}

.ops-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  margin-bottom: 6px;
  background: #fff;
  transition: border-color 0.12s, background 0.12s;
}
.ops-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.ops-item {
  flex-wrap: wrap;
}
.ops-item-main {
  flex: 1 1 170px;
  min-width: 0;
  cursor: pointer;
}
.ops-item-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: #1e293b;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.ops-item-meta {
  font-size: 0.72rem;
  color: #64748b;
  white-space: normal;
  overflow-wrap: anywhere;
}
.ops-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
  min-width: 0;
  margin-left: auto;
}
.ops-item-actions .ops-chip-select {
  min-width: 0;
  flex: 0 1 auto;
}
.ops-chip-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #e2e8f0;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2364748b'/%3E%3C/svg%3E") no-repeat right 8px center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  padding: 3px 22px 3px 10px;
  max-width: 130px;
  cursor: pointer;
}
.ops-chip-select:hover {
  border-color: #94a3b8;
}
.ops-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  white-space: nowrap;
}
.ops-chip-locked {
  background: #f1f5f9;
  color: #475569;
}
.ops-chip-green {
  background: #dcfce7;
  color: #15803d;
}
.ops-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
}
.ops-icon-btn:hover {
  background: #eff6ff;
  color: #2563eb;
}
.ops-icon-urgent:hover {
  background: #fef2f2;
  color: #dc2626;
}
.ops-icon-urgent.is-on {
  background: #dc2626;
  color: #fff;
}
.ops-item.is-urgent {
  background: #fef2f2;
  border-color: #fecaca;
  border-left: 4px solid #dc2626;
}
.ops-item.is-urgent .ops-item-name {
  color: #991b1b;
}
.ops-urgent-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  background: #dc2626;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 6px;
  vertical-align: 1px;
}
.ops-more-btn {
  border: none;
  background: none;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 4px;
  cursor: pointer;
}
.ops-more-btn:hover {
  text-decoration: underline;
}

@media (max-width: 1200px) {
  .ops-columns {
    grid-template-columns: 1fr 1fr;
  }
  .ops-columns > .ops-panel:last-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 900px) {
  .ops-page {
    padding: 12px 10px 32px;
  }
  .ops-columns {
    grid-template-columns: 1fr;
  }
  .ops-columns > .ops-panel:last-child {
    grid-column: auto;
  }
}
@media (max-width: 560px) {
  .ops-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .ops-kpi {
    padding: 10px 12px;
  }
  .ops-item {
    flex-wrap: wrap;
  }
  .ops-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .ops-chip-select {
    max-width: none;
    flex: 1;
  }
}

/* Raport săptămânal */
.ops-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ops-report-period {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 10px;
}
.ops-report-kpis {
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.ops-report-kpis .ops-kpi {
  padding: 10px 12px;
  border-top-width: 3px;
}
.ops-report-kpis .ops-kpi span {
  font-size: 0.75rem;
}
.ops-report-kpis .ops-kpi-green { border-top-color: #16a34a; }
.ops-report-kpis .ops-kpi-blue { border-top-color: #2563eb; }
.ops-report-kpis .ops-kpi-orange { border-top-color: #ea580c; }
.ops-report-kpis .ops-kpi-red { border-top-color: #dc2626; }
.ops-report-kpis .ops-kpi-slate { border-top-color: #94a3b8; }
.ops-report-h {
  font-weight: 700;
  font-size: 0.92rem;
  margin: 18px 0 8px;
  color: #0f172a;
}
.ops-report-h i {
  color: #3b82f6;
  margin-right: 6px;
}
.ops-report-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: #334155;
}
.ops-report-list li {
  margin-bottom: 4px;
}
.ops-report-list li.is-late,
.ops-report-table td.is-late {
  color: #b91c1c;
  font-weight: 600;
}
.ops-report-problems .ops-problem-critic { color: #b91c1c; }
.ops-report-problems .ops-problem-ignorat { color: #c2410c; }
.ops-report-problems .ops-problem-amanat { color: #64748b; }
.ops-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.ops-report-table th,
.ops-report-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
}
.ops-report-table th:first-child,
.ops-report-table td:first-child {
  text-align: left;
  font-weight: 600;
}
.ops-report-table th {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
}
.ops-report-actions {
  margin-top: 16px;
}
@media (max-width: 560px) {
  .ops-report-kpis {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mod întunecat */
[data-theme="dark"] .ops-page-title,
[data-theme="dark"] .ops-panel-head h2,
[data-theme="dark"] .ops-kpi b,
[data-theme="dark"] .ops-pcard-name,
[data-theme="dark"] .ops-item-name,
[data-theme="dark"] .ops-pcard-stats b {
  color: #e2e8f0;
}
[data-theme="dark"] .ops-panel,
[data-theme="dark"] .ops-kpi,
[data-theme="dark"] .ops-item,
[data-theme="dark"] .ops-refresh-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}
[data-theme="dark"] .ops-pcard,
[data-theme="dark"] .ops-add-form,
[data-theme="dark"] .ops-add-input,
[data-theme="dark"] .ops-chip-select,
[data-theme="dark"] .ops-empty-state {
  background-color: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}
[data-theme="dark"] .ops-item.is-urgent {
  background: #3b1d1d !important;
  border-color: #7f1d1d;
}
[data-theme="dark"] .ops-edge-slate { background: #1e293b !important; }
[data-theme="dark"] .ops-edge-amber { background: #2a2416 !important; }
[data-theme="dark"] .ops-edge-violet { background: #241f35 !important; }
[data-theme="dark"] .ops-edge-green { background: #16281e !important; }
[data-theme="dark"] .ops-edge-blue { background: #172338 !important; }
[data-theme="dark"] .ops-edge-red { background: #2d1a1a !important; }
[data-theme="dark"] .ops-edge-orange { background: #2e1f14 !important; }
[data-theme="dark"] .ops-edge-rose { background: #2e1a24 !important; }
[data-theme="dark"] .ops-item[class*="ops-edge-"] { border-color: #334155; }
[data-theme="dark"] .ops-group + .ops-group { border-top-color: #334155; }
[data-theme="dark"] .ops-prio-row,
[data-theme="dark"] .ops-manage-section { border-color: #334155; }
[data-theme="dark"] .ops-prio-rank { background: #e2e8f0; color: #0f172a; }
[data-theme="dark"] .ops-report-h { color: #e2e8f0; }
[data-theme="dark"] .ops-report-list { color: #cbd5e1; }
[data-theme="dark"] .ops-report-table td,
[data-theme="dark"] .ops-report-table th { border-color: #334155; color: #cbd5e1; }

/* Sarcini: sursă + evidență Manager Digital */
.task-source-badge { font-weight: 600; background: #ede9fe; color: #5b21b6; }
.task-source-panou { background: #e0f2fe; color: #075985; }
.task-source-asistent_ai { background: #fef3c7; color: #92400e; }
.kanban-task-card > .task-source-badge { display: inline-block; align-self: flex-start; width: auto; margin: 0 0 .35rem 0 !important; }
.md-tasks-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.md-tasks-controls .form-select { width: auto; flex: 1 1 200px; }
.md-tasks-list { display: flex; flex-direction: column; gap: .4rem; }
.md-task-row { display: flex; align-items: flex-start; gap: .6rem; padding: .55rem .7rem; border: 1px solid #eef2f6; border-left: 4px solid; border-radius: 8px; cursor: pointer; }
.md-task-main { flex: 1 1 auto; min-width: 0; }
.md-task-main .ops-item-name { white-space: normal; overflow-wrap: anywhere; }
.md-task-desc { display: none; margin-top: .4rem; font-size: .85rem; color: #475569; white-space: pre-line; }
.md-task-row.is-open .md-task-desc { display: block; }
[data-theme="dark"] .task-source-badge { background: #2e1065; color: #ddd6fe; }
[data-theme="dark"] .task-source-panou { background: #0c4a6e; color: #bae6fd; }
[data-theme="dark"] .task-source-asistent_ai { background: #451a03; color: #fde68a; }
[data-theme="dark"] .md-task-row { border-color: #334155; }
[data-theme="dark"] .md-task-desc { color: #cbd5e1; }
