/* =========================================================
   SiloKala Customer Dashboard — modular widget home
   Uses design tokens; RTL-first; zoom-safe fluid grids.
   ========================================================= */

.sk-customer-dash {
  direction: rtl;
  font-family: var(--font-base);
  color: var(--text-primary, #1d2327);
  margin: 0 0 2rem;
  max-width: 100%;
  overflow-x: clip;
}

.sk-customer-dash__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px);
  align-items: start;
}

.sk-dash-widget {
  grid-column: span 12;
  min-width: 0;
}

.sk-dash-widget--welcome { grid-column: span 12; }
.sk-dash-widget--account_status { grid-column: span 4; }
.sk-dash-widget--supplier_status { grid-column: span 8; }
.sk-dash-widget--verification_status { grid-column: span 6; }
.sk-dash-widget--quick_actions { grid-column: span 6; }
.sk-dash-widget--notifications { grid-column: span 6; }
.sk-dash-widget--tasks { grid-column: span 6; }
.sk-dash-widget--recent_orders { grid-column: span 8; }
.sk-dash-widget--profile_completeness { grid-column: span 4; }
.sk-dash-widget--announcements { grid-column: span 12; }

@media (max-width: 1100px) {
  .sk-dash-widget--account_status,
  .sk-dash-widget--supplier_status,
  .sk-dash-widget--verification_status,
  .sk-dash-widget--quick_actions,
  .sk-dash-widget--notifications,
  .sk-dash-widget--tasks,
  .sk-dash-widget--recent_orders,
  .sk-dash-widget--profile_completeness {
    grid-column: span 12;
  }
}

.sk-dash-card,
.sk-dash-welcome,
.sk-supplier-card {
  background: #fff;
  border: 1px solid var(--border-subtle, #dcdcde);
  border-radius: 8px;
  padding: clamp(14px, 2vw, 20px);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.sk-dash-card__title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

.sk-dash-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.sk-dash-card__head .sk-dash-card__title {
  margin: 0;
}

.sk-dash-welcome {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(21, 49, 92, 0.06), rgba(232, 147, 15, 0.08)),
    #fff;
}

.sk-dash-welcome__eyebrow {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: var(--text-muted, #646970);
}

.sk-dash-welcome__title {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
}

.sk-dash-welcome__sub {
  margin: 0;
  line-height: 1.7;
  color: var(--text-secondary, #50575e);
  max-width: 52ch;
}

.sk-dash-welcome__mark {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--blue-800, #1b3a6b);
  color: #fff;
  font-weight: 800;
}

.sk-dash-status-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sk-dash-status-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f1;
  font-size: 0.92rem;
}

.sk-dash-status-list li:last-child {
  border-bottom: 0;
}

.sk-dash-status-list .is-ok { color: #007017; }
.sk-dash-status-list .is-warn { color: #996800; }

/* Supplier lifecycle card */
.sk-supplier-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.sk-supplier-card__icon {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55), transparent 45%),
    linear-gradient(145deg, #1b3a6b, #3a72c4);
}

.sk-supplier-card__icon--accent { background: linear-gradient(145deg, #e8930f, #f6c15b); }
.sk-supplier-card__icon--pending,
.sk-supplier-card__icon--info { background: linear-gradient(145deg, #224a85, #5b95e0); }
.sk-supplier-card__icon--warning { background: linear-gradient(145deg, #c97e12, #f0b429); }
.sk-supplier-card__icon--success { background: linear-gradient(145deg, #007017, #00a32a); }
.sk-supplier-card__icon--danger { background: linear-gradient(145deg, #8a2424, #d63638); }
.sk-supplier-card__icon--muted { background: linear-gradient(145deg, #646970, #a7aaad); }

.sk-supplier-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sk-supplier-card__head .sk-dash-card__title {
  margin: 0;
}

.sk-supplier-card__desc,
.sk-supplier-card__recommend {
  margin: 0 0 8px;
  line-height: 1.7;
}

.sk-supplier-card__notes {
  margin: 0 0 10px;
  padding-right: 18px;
}

.sk-supplier-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}

.sk-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #f0f0f1;
  color: #1d2327;
}

.sk-badge--accent { background: #fff4e5; color: #9a5b00; }
.sk-badge--pending,
.sk-badge--info { background: #e7f5fe; color: #0a4b78; }
.sk-badge--warning { background: #fcf0e3; color: #8a5100; }
.sk-badge--success { background: #edfaef; color: #007017; }
.sk-badge--danger { background: #fcf0f1; color: #b32d2e; }
.sk-badge--muted { background: #f0f0f1; color: #50575e; }

.sk-dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
}

.sk-dash-btn:focus-visible,
.sk-dash-linkbtn:focus-visible,
.sk-dash-action:focus-visible {
  outline: 2px solid var(--blue-600, #2c5ca3);
  outline-offset: 2px;
}

.sk-dash-btn--primary {
  background: var(--blue-800, #1b3a6b);
  color: #fff;
}

.sk-dash-btn--ghost {
  background: #fff;
  border-color: #c3c4c7;
  color: #1d2327;
}

.sk-dash-btn--sm {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.sk-dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.sk-dash-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: #fbfcfd;
  min-width: 0;
}

.sk-dash-action:hover {
  border-color: var(--blue-500, #3a72c4);
}

.sk-dash-action__label {
  font-weight: 700;
  font-size: 0.92rem;
}

.sk-dash-action__hint {
  font-size: 0.78rem;
  color: #646970;
  line-height: 1.5;
}

.sk-dash-notify-list,
.sk-dash-task-list,
.sk-dash-announce-list,
.sk-dash-completeness__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sk-dash-notify {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f1;
}

.sk-dash-notify.is-unread {
  background: #f5f8ff;
  margin: 0 -8px;
  padding: 10px 8px;
  border-radius: 6px;
}

.sk-dash-notify__title { display: block; margin-bottom: 2px; }
.sk-dash-notify__body { margin: 0 0 4px; font-size: 0.88rem; line-height: 1.6; }
.sk-dash-notify__time { font-size: 0.75rem; color: #646970; }
.sk-dash-notify__actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.sk-dash-linkbtn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--blue-700, #224a85);
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: none;
}

.sk-dash-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  padding: 0 6px;
  margin-right: 6px;
  border-radius: 999px;
  background: #d63638;
  color: #fff;
  font-size: 0.75rem;
}

.sk-dash-task {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f1;
}

.sk-dash-task__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.sk-dash-task__priority {
  font-size: 0.75rem;
  color: #646970;
}

.sk-dash-task--high .sk-dash-task__priority,
.sk-dash-task--urgent .sk-dash-task__priority {
  color: #b32d2e;
  font-weight: 700;
}

.sk-dash-progress {
  height: 6px;
  background: #f0f0f1;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}

.sk-dash-progress > span {
  display: block;
  height: 100%;
  background: var(--blue-600, #2c5ca3);
}

.sk-dash-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sk-dash-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  font-size: 0.88rem;
}

.sk-dash-table th,
.sk-dash-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #f0f0f1;
  text-align: right;
}

.sk-dash-completeness {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.sk-dash-completeness__ring {
  --sk-pct: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--blue-600, #2c5ca3) calc(var(--sk-pct) * 1%), #e2e4e7 0);
  font-weight: 800;
  font-size: 0.85rem;
}

.sk-dash-completeness__ring > span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
}

.sk-dash-completeness__list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f1;
  font-size: 0.88rem;
}

.sk-dash-completeness__list .is-done { color: #007017; }
.sk-dash-check { color: #007017; font-weight: 700; }

.sk-dash-empty,
.sk-dash-inline-note {
  margin: 0;
  color: #646970;
  font-size: 0.9rem;
}

.sk-dash-announce-list li {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f1;
}

.sk-dash-announce-list p {
  margin: 4px 0 6px;
  line-height: 1.6;
}

.sk-dash-activity__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sk-dash-activity__item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f1;
  font-size: 0.95rem;
  line-height: 1.5;
}

.sk-dash-activity__item time {
  font-size: 0.8rem;
  color: #646970;
}

/* Harmonize legacy verification card inside widget */
.sk-customer-dash .sk-ver-status {
  margin: 0;
  border: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

@media (max-width: 640px) {
  .sk-supplier-card {
    grid-template-columns: 1fr;
  }

  .sk-dash-notify {
    grid-template-columns: 1fr;
  }

  .sk-dash-welcome {
    flex-direction: column;
  }
}

@media (prefers-color-scheme: dark) {
  .sk-customer-dash {
    color-scheme: light;
  }
}
