.pi-shell {
  display: grid;
  gap: 12px;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: #1f2328;
  max-width: 1200px;
}

.pi-hero {
  background: linear-gradient(135deg, #f0f9ff 0%, #ecfdf5 50%, #fffbeb 100%);
  border: 1px solid #d0d7de;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.pi-hero-top {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.pi-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #0369a1;
  margin-bottom: 4px;
}

.pi-hero h2 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
}

.pi-sub {
  margin: 0;
  color: #57606a;
  font-size: 14px;
}

.pi-plan-select-wrap {
  min-width: 220px;
}

.pi-plan-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pi-plan-select {
  flex: 1;
  min-width: 160px;
}

.pi-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #57606a;
  margin-bottom: 4px;
}

.pi-hub-plan {
  margin-top: 14px;
  max-width: 420px;
}

.pi-plan-name-field {
  margin-top: 10px;
  max-width: 420px;
}

.pi-dept-name-hint {
  margin: -4px 0 0;
  font-size: 12px;
}

.pi-modal-sheet-confirm {
  width: min(440px, 100%);
}

.pi-delete-confirm-text {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2328;
}

.pi-delete-confirm-warn {
  margin: 0 0 4px;
  font-size: 13px;
}

.pi-delete-confirm-foot {
  margin-top: 16px;
}

.pi-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.pi-nav-card {
  display: grid;
  gap: 8px;
  text-align: left;
  padding: 18px 16px !important;
  border: 1px solid #d0d7de !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #24292f !important;
  width: 100% !important;
  margin: 0 !important;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pi-nav-card:hover {
  border-color: #0969da !important;
  box-shadow: 0 4px 14px rgba(9, 105, 218, 0.12);
  background: #f8fbff !important;
}

.pi-nav-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #dbeafe, #d1fae5);
  color: #0369a1;
  font-size: 18px;
}

.pi-nav-title {
  font-size: 16px;
  font-weight: 700;
}

.pi-nav-desc {
  font-size: 13px;
  color: #57606a;
  line-height: 1.4;
}

.pi-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.pi-page-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.pi-back-btn {
  width: auto !important;
  margin: 0 !important;
  padding: 8px 14px !important;
  border: 1px solid #d0d7de !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #24292f !important;
  font-size: 13px !important;
  cursor: pointer;
}

.pi-back-btn:hover {
  background: #f6f8fa !important;
}

.pi-panel {
  display: grid;
  gap: 12px;
}

.pi-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pi-stat {
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.pi-stat-val {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #0969da;
  line-height: 1.1;
}

.pi-stat-lbl {
  font-size: 12px;
  color: #57606a;
}

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

.pi-task {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  border-left: 4px solid #94a3b8;
}

.pi-task.is-due {
  border-left-color: #f59e0b;
}

.pi-task.is-done {
  border-left-color: #22c55e;
  opacity: 0.85;
}

.pi-task-main {
  flex: 1;
  min-width: 180px;
}

.pi-task-name {
  font-weight: 600;
  font-size: 15px;
}

.pi-task-meta {
  font-size: 12px;
  color: #57606a;
  margin-top: 2px;
}

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

.pi-btn {
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid #d0d7de !important;
  background: #fff !important;
  background-color: #fff !important;
  color: #1f2328 !important;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.pi-btn:hover {
  background: #f6f8fa !important;
  background-color: #f6f8fa !important;
}

.pi-btn-primary {
  background: #0969da !important;
  background-color: #0969da !important;
  border-color: #0969da !important;
  color: #fff !important;
}

.pi-btn-primary:hover {
  background: #0550ae !important;
  background-color: #0550ae !important;
}

.pi-btn-soft {
  background: #f6f8fa !important;
  background-color: #f6f8fa !important;
  color: #1f2328 !important;
}

.pi-btn-danger {
  background: #fef2f2 !important;
  background-color: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #b91c1c !important;
}

.pi-btn-success {
  background: #ecfdf5 !important;
  background-color: #ecfdf5 !important;
  border-color: #86efac !important;
  color: #166534 !important;
}

.pi-muted {
  color: #57606a;
  font-size: 13px;
  margin: 0;
}

.pi-card {
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 14px;
}

.pi-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.pi-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.pi-card-head h3 {
  margin: 0;
}

.pi-card-inner {
  margin-top: 10px;
  background: #f6f8fa;
}

.pi-input,
.pi-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
}

.pi-field {
  display: grid;
  gap: 4px;
}

.pi-field-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 22px;
}

.pi-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pi-field-row .pi-input {
  flex: 1;
}

.pi-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.pi-weekday-hint {
  margin: 0 0 8px;
  font-size: 12px;
}

.pi-weekday-hint strong {
  color: #0969da;
  font-weight: 700;
}

.pi-weekday-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.pi-chip {
  padding: 6px 10px;
  border: 1px solid #d0d7de;
  border-radius: 20px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.pi-weekday-chips .pi-chip {
  min-width: 44px;
  padding: 8px 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #f1f5f9 !important;
  color: #64748b !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.pi-weekday-chips .pi-chip:hover:not(.is-on) {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #475569 !important;
}

.pi-weekday-chips .pi-chip.is-on,
.pi-weekday-chips .pi-chip[aria-pressed="true"],
body .pi-modal .pi-weekday-chips button.pi-chip.is-on {
  background: #0969da !important;
  background-color: #0969da !important;
  border-color: #0969da !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.28) !important;
}

.pi-weekday-chips .pi-chip.is-on:hover,
.pi-weekday-chips .pi-chip[aria-pressed="true"]:hover,
body .pi-modal .pi-weekday-chips button.pi-chip.is-on:hover {
  background: #0550ae !important;
  background-color: #0550ae !important;
  border-color: #0550ae !important;
  color: #fff !important;
}

.pi-chip.is-on {
  background: #0969da;
  border-color: #0969da;
  color: #fff;
}

.pi-radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 14px;
  cursor: pointer;
}

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

.pi-edit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafbfc;
}

.pi-edit-row-name {
  flex: 1;
  min-width: 140px;
  font-weight: 600;
}

.pi-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
}

.pi-badge-weekly {
  background: #fef3c7;
  color: #b45309;
}

.pi-badge-monthly {
  background: #ede9fe;
  color: #6d28d9;
}

.pi-save-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.pi-week-nav-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.pi-week-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pi-week-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.pi-week-range-label {
  font-weight: 700;
  font-size: 16px;
  color: #24292f;
}

.pi-week-offset-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.pi-btn-week-nav {
  width: 44px !important;
  min-width: 44px;
  height: 44px;
  padding: 0 !important;
  font-size: 24px;
  line-height: 1;
  border-radius: 10px !important;
  background: #fff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  flex-shrink: 0;
}

.pi-btn-week-nav:hover:not(:disabled) {
  background: #e0f2fe !important;
  border-color: #0969da !important;
}

.pi-btn-week-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pi-week-subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
}

.pi-week-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}

.pi-week-jump-input {
  width: auto !important;
  min-width: 150px;
}

.pi-week-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.pi-week-stat {
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #475569;
}

.pi-week-stat strong {
  color: #0969da;
  font-size: 16px;
  margin-right: 4px;
}

.pi-week-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #475569;
}

.pi-week-hint {
  margin: 0 0 12px;
  font-size: 12px;
}

.pi-legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.pi-legend-done { background: #16a34a; }
.pi-legend-missed { background: #dc2626; }
.pi-legend-pending { background: #f59e0b; }
.pi-legend-future { background: #94a3b8; }
.pi-legend-none { background: #e2e8f0; }

.pi-week-wrap {
  overflow-x: auto;
}

.pi-week-th-today {
  background: #eff6ff !important;
  color: #0369a1;
}

.pi-week-th-date {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
}

.pi-week-status-cell {
  font-weight: 700;
  font-size: 15px;
  min-width: 36px;
}

.pi-week-status-cell[data-clickable="1"] {
  cursor: pointer;
}

.pi-week-status-cell[data-clickable="1"]:hover {
  filter: brightness(0.95);
}

.pi-cell-done {
  background: #ecfdf5 !important;
  color: #16a34a !important;
}

.pi-cell-missed {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

.pi-cell-pending {
  background: #fffbeb !important;
  color: #d97706 !important;
}

.pi-cell-future {
  background: #f8fafc !important;
  color: #64748b !important;
}

.pi-cell-none {
  color: #d1d5db !important;
}

.pi-week-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  overflow: hidden;
}

.pi-week-table th,
.pi-week-table td {
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  text-align: center;
}

.pi-week-table th {
  background: #f6f8fa;
  font-weight: 600;
}

.pi-week-table td:first-child,
.pi-week-table th:first-child {
  text-align: left;
  font-weight: 600;
  min-width: 160px;
}

.pi-cell-yes {
  color: #16a34a;
  font-weight: 700;
}

.pi-cell-no {
  color: #d1d5db;
}

/* Qlobal button { width:100% } və hidden atributunu ləğv edən display:flex */
.pi-shell button,
.pi-modal button {
  width: auto;
  margin-top: 0;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 6px;
}

.pi-modal[hidden] {
  display: none !important;
}

.pi-modal:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pi-modal-sheet {
  background: #fff;
  border-radius: 12px;
  width: min(480px, 100%);
  max-height: 85vh;
  overflow: auto;
  padding: 18px 20px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.pi-modal-sheet-wide {
  width: min(520px, 100%);
}

.pi-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.pi-modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

.pi-modal-x {
  flex: 0 0 32px;
  width: 32px !important;
  height: 32px;
  min-width: 32px;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d0d7de !important;
  border-radius: 8px;
  background: #f6f8fa !important;
  color: #57606a !important;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.pi-modal-x:hover {
  background: #eef2f6 !important;
  color: #24292f !important;
}

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

.pi-modal .pi-form-grid {
  gap: 14px;
  margin-bottom: 0;
}

.pi-modal .pi-field {
  gap: 6px;
}

.pi-modal .pi-field > span {
  font-size: 12px;
  font-weight: 600;
  color: #57606a;
}

.pi-modal .pi-form-grid-top {
  grid-template-columns: 1fr 1fr;
}

.pi-modal .pi-field-check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  width: fit-content;
  cursor: pointer;
}

.pi-modal .pi-field-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.pi-modal .pi-field-check-row span {
  font-size: 14px;
  font-weight: 500;
  color: #24292f;
}

.pi-modal .pi-card-inner {
  margin-top: 0;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.pi-modal .pi-field-row {
  margin-top: 0;
}

.pi-wh-block .pi-label {
  margin-bottom: 2px;
}

.pi-wh-grid {
  display: grid;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.pi-wh-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: stretch;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background 0.12s;
}

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

.pi-wh-row:hover {
  background: #f8fbff;
}

.pi-wh-row:has(input:checked) {
  background: #eff6ff;
}

.pi-wh-col-radio {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #e5e7eb;
  background: #f6f8fa;
  padding: 10px 0;
}

.pi-wh-col-radio input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #0969da;
}

.pi-wh-col-label {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  min-height: 44px;
}

.pi-wh-col-label label {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #24292f;
  cursor: pointer;
  line-height: 1.35;
  width: 100%;
}

.pi-custom-wh {
  display: grid;
  gap: 6px;
  padding-top: 4px;
}

.pi-month-hint {
  margin: 0 0 8px;
  font-size: 12px;
}

.pi-month-cal {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.pi-month-cal-title {
  font-size: 14px;
  font-weight: 600;
  color: #24292f;
  text-align: center;
  margin-bottom: 8px;
}

.pi-month-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.pi-month-cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #57606a;
  padding: 2px 0;
}

.pi-month-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.pi-month-cell {
  min-height: 34px;
  border-radius: 6px;
  font-size: 13px;
}

.pi-month-cell-empty {
  visibility: hidden;
  pointer-events: none;
}

.pi-month-day {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #e5e7eb !important;
  background: #fff !important;
  color: #24292f !important;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.pi-month-day:hover {
  background: #f0f9ff !important;
  border-color: #7dd3fc !important;
}

.pi-month-day.is-on,
.pi-month-day[aria-pressed="true"],
body .pi-modal .pi-month-cal-grid button.pi-month-day.is-on {
  background: #0969da !important;
  background-color: #0969da !important;
  border-color: #0969da !important;
  color: #fff !important;
}

.pi-month-day.is-on:hover,
.pi-month-day[aria-pressed="true"]:hover,
body .pi-modal .pi-month-cal-grid button.pi-month-day.is-on:hover {
  background: #0550ae !important;
  background-color: #0550ae !important;
  border-color: #0550ae !important;
  color: #fff !important;
}

.pi-month-cal-extra {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e5e7eb;
}

.pi-month-last-btn.is-on,
.pi-month-last-btn[aria-pressed="true"],
body .pi-modal button.pi-month-last-btn.is-on {
  background: #0969da !important;
  background-color: #0969da !important;
  border-color: #0969da !important;
  color: #fff !important;
}

.pi-month-summary {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #0369a1;
}

.pi-card-inner[hidden],
#piCustomWhWrap[hidden],
#piMonthdayBlock[hidden],
#piWeekdayBlock[hidden] {
  display: none !important;
}

.pi-modal .anbar-open-picker-btn {
  width: auto !important;
  flex-shrink: 0;
  white-space: nowrap;
}

.pi-catalog-list {
  display: grid;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 10px;
}

.pi-catalog-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.pi-catalog-item:hover {
  background: #f0f9ff;
  border-color: #7dd3fc;
}

.pi-catalog-cat {
  font-size: 11px;
  color: #57606a;
}

.pi-modal-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.pi-modal-foot .pi-btn {
  min-width: 96px;
}

.pi-modal-foot-spacer {
  flex: 1;
  min-width: 8px;
}

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