@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ── Reset isolato ─────────────────────────────────────────────────────────── */
.kima-portal *, .kima-portal *::before, .kima-portal *::after { box-sizing: border-box; }
.kima-portal a    { text-decoration: none !important; color: inherit !important; }
.kima-portal p    { margin: 0; padding: 0; }
.kima-portal h2, .kima-portal h3, .kima-portal h4 { margin: 0; padding: 0; font-weight: 600; }
.kima-portal table { border-collapse: collapse; width: 100%; margin: 0; }
.kima-portal button { cursor: pointer; font-family: inherit; }
.kima-portal svg  { display: block; overflow: visible; }

/* ── Variables ─────────────────────────────────────────────────────────────── */
.kima-portal {
  --kima-blue:       #2B7FD4;
  --kima-blue-dark:  #1a5fa0;
  --kima-blue-light: #e8f2fc;
  --kima-blue-mid:   #4a94e0;
  --kima-text:       #1a1e2e;
  --kima-muted:      #6b7280;
  --kima-border:     #e2e8f0;
  --kima-bg:         #f5f8fc;
  --kima-white:      #ffffff;
  --kima-green:      #10b981;
  --kima-green-bg:   #ecfdf5;
  --kima-orange:     #f59e0b;
  --kima-red:        #ef4444;
  --kima-red-bg:     #fef2f2;
  font-family: 'DM Sans', sans-serif;
  color: var(--kima-text);
  font-size: 15px;
  line-height: 1.5;
}

.kima-portal--error {
  background: #fff; border: 1px solid #fecaca;
  border-radius: 12px; padding: 24px; color: var(--kima-red); font-size: 14px;
}
.kp-editor-badge {
  display: inline-block; background: #f59e0b; color: #fff;
  font-size: 11px; font-weight: 600; padding: 4px 12px;
  border-radius: 99px; margin-bottom: 20px; letter-spacing: .04em;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.kp { max-width: 1100px; margin: 0 auto; }

/* ── Greeting ──────────────────────────────────────────────────────────────── */
.kp-greeting { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.kp-avatar {
  width: 52px; height: 52px; min-width: 52px; border-radius: 50%;
  background: var(--kima-blue);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 600;
}
.kp-greeting__name { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--kima-text); }
.kp-greeting__sub  { font-size: 14px; color: var(--kima-muted); margin-top: 2px; }

/* ── Top grid ──────────────────────────────────────────────────────────────── */
.kp-top-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
  align-items: stretch;
}
.kp-top-grid > .kp-card { height: 100%; }

/* ── Card base ─────────────────────────────────────────────────────────────── */
.kp-card {
  background: var(--kima-white);
  border: 1px solid var(--kima-border);
  border-radius: 14px;
  padding: 24px;
  transition: box-shadow .2s;
  animation: kp-up .45s ease both;
}
.kp-card:hover { box-shadow: 0 4px 24px rgba(43,127,212,.08); }
@keyframes kp-up {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}
.kp-card__label {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--kima-muted);
  margin-bottom: 16px; display: flex; align-items: center; gap: 6px;
}
.kp-dot { width:7px; height:7px; border-radius:50%; background:var(--kima-blue); display:inline-block; flex-shrink:0; }
.kp-empty { color: var(--kima-muted); font-size: 13px; }

/* ── Mantenimento ──────────────────────────────────────────────────────────── */
.kp-maint-inner {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 24px;
}
.kp-maint-info  { flex: 1; min-width: 0; }
.kp-maint-title { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.kp-maint-sub   { font-size: 13px; color: var(--kima-muted); margin-bottom: 14px; }

.kp-pill { display:inline-flex; align-items:center; gap:6px; padding:5px 13px; border-radius:20px; font-size:12px; font-weight:500; }
.kp-pill::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; }
.kp-pill--active    { background: var(--kima-green-bg); color: var(--kima-green); }
.kp-pill--expiring  { background: #fffbeb; color: var(--kima-orange); }
.kp-pill--expired   { background: var(--kima-red-bg); color: var(--kima-red); }
.kp-pill--suspended { background: #f3f4f6; color: #6b7280; }

.kp-maint-bar { margin-top: 22px; }
.kp-maint-bar__labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--kima-muted); margin-bottom: 7px;
}
.kp-bar-track {
  height: 6px; background: var(--kima-border);
  border-radius: 99px; overflow: hidden; margin-bottom: 4px;
}
.kp-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--kima-blue-mid), var(--kima-blue));
  transition: width 1.3s cubic-bezier(.4,0,.2,1);
}
.kp-bar-fill--warn  { background: linear-gradient(90deg, #f59e0b, #ef4444) !important; }

.kp-countdown {
  text-align: center; background: var(--kima-bg);
  border-radius: 12px; padding: 20px 24px; flex-shrink: 0;
}
.kp-countdown__num {
  font-size: 48px; font-weight: 500;
  color: var(--kima-blue); line-height: 1; margin-bottom: 6px;
}
.kp-countdown__label {
  font-size: 10px; color: var(--kima-muted);
  text-transform: uppercase; letter-spacing: .07em;
}

/* ── Ore credito ───────────────────────────────────────────────────────────── */
.kp-card--hours {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kp-donut-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 8px auto 16px;
  flex-shrink: 0;
}
.kp-donut-wrap > svg {
  position: absolute;
  top: 0; left: 0;
  width: 120px; height: 120px;
}
.kp-donut-center {
  position: absolute;
  top: 0; left: 0;
  width: 120px; height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.kp-donut-num {
  font-size: 16px; font-weight: 700;
  color: var(--kima-text); line-height: 1.1;
  display: block;
  text-align: center;
}
.kp-donut-sub {
  font-size: 10px; color: var(--kima-muted);
  margin-top: 2px; display: block;
}

.kp-hours-sub { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.kp-hours-sub--green  { color: var(--kima-green); }
.kp-hours-sub--orange { color: var(--kima-orange); }
.kp-hours-sub--red    { color: var(--kima-red); }

/* barra ore con etichette */
.kp-hours-bar-wrap { width: 100%; }
.kp-hours-bar-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--kima-muted);
  margin-top: 6px;
}
.kp-hours-bar-labels .kp-remaining-label {
  font-weight: 600;
}

/* ── Section title ─────────────────────────────────────────────────────────── */
.kp-section-title {
  font-size: 16px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.kp-count {
  background: var(--kima-blue-light); color: var(--kima-blue);
  font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 99px;
}

/* ── Tabella interventi ────────────────────────────────────────────────────── */
.kp-table-wrap {
  border: 1px solid var(--kima-border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 28px;
  animation: kp-up .45s .08s ease both;
}

.kp-table { width: 100%; border-collapse: collapse; }

.kp-table thead tr { background: var(--kima-blue-light); }
.kp-table thead th {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--kima-muted);
  padding: 13px 20px; text-align: left;
  border-bottom: 1px solid var(--kima-border);
  white-space: nowrap;
}
.kp-table tbody tr {
  background: var(--kima-white);
  border-bottom: 1px solid var(--kima-border);
  transition: background .12s;
}
.kp-table tbody tr:last-child { border-bottom: none; }
.kp-table tbody tr:hover      { background: var(--kima-blue-light); }
.kp-table tbody td { padding: 14px 20px; font-size: 13px; vertical-align: middle; }

/* ── Tabella interventi nuova (stile C) ─────────────────────────────────── */
.kp-int-wrap {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: 0 0 0 1px #e9ecef;
}
.kp-int-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}
/* Azzera TUTTO quello che il tema potrebbe applicare */
.kp-int-table tr,
.kp-int-table tr:nth-child(odd),
.kp-int-table tr:nth-child(even),
.kp-int-table thead tr,
.kp-int-table thead tr:hover {
  background: #fff !important;
}
.kp-int-table td,
.kp-int-table th,
.kp-int-table tr:nth-child(odd) td,
.kp-int-table tr:nth-child(even) td,
.kp-int-table tr:nth-child(odd) th,
.kp-int-table tr:nth-child(even) th {
  background: transparent !important;
  border: none !important;
}
/* Thead */
.kp-int-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #868e96 !important;
  padding: 14px 20px 10px;
  text-align: left;
  border-bottom: 1px solid #e9ecef !important;
  white-space: nowrap;
}
.kp-int-table thead th:last-child { text-align: right; }
/* Righe body */
.kp-int-table tbody tr {
  border-top: 1px solid #f1f3f5 !important;
  transition: background .1s;
}
.kp-int-table tbody tr:first-child { border-top: none !important; }
.kp-int-table tbody tr:hover td   { background: #f8f9fa !important; }
/* Celle */
.kp-int-table tbody td {
  padding: 14px 20px;
  vertical-align: middle;
  color: inherit;
}
.kp-int-table tbody td:last-child { text-align: right; }

.kp-td-date  { font-size: 12px; color: var(--kima-muted); white-space: nowrap; }
.kp-td-desc strong { font-weight: 500; color: var(--kima-text); }
.kp-td-desc small  { display: block; font-size: 11px; color: var(--kima-muted); margin-top: 2px; }
.kp-td-hours { font-size: 13px; white-space: nowrap; color: var(--kima-text); }
.kp-included { color: var(--kima-green) !important; font-weight: 600; }

.kp-type-pill { font-size:11px; font-weight:500; padding:3px 10px; border-radius:6px; white-space:nowrap; display:inline-block; }
.kp-type-pill--maintenance { background:var(--kima-blue-light); color:var(--kima-blue); }
.kp-type-pill--content     { background:#f3f4f6; color:#374151; }
.kp-type-pill--new_page    { background:var(--kima-green-bg); color:var(--kima-green); }
.kp-type-pill--technical   { background:#fdf4ff; color:#9333ea; }
.kp-type-pill--launch      { background:var(--kima-green-bg); color:var(--kima-green); }
.kp-type-pill--other       { background:#f3f4f6; color:#6b7280; }

/* ── Bottom grid ───────────────────────────────────────────────────────────── */
.kp-bottom-grid {
  display: grid; grid-template-columns: 2fr 1fr;
  gap: 20px; margin-bottom: 28px;
}

/* ── Acquisto ore ──────────────────────────────────────────────────────────── */
.kp-card--buy { border:1.5px dashed var(--kima-blue); background:var(--kima-blue-light); }

.kp-buy-options { display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.kp-buy-opt {
  background:var(--kima-white); border:1.5px solid var(--kima-border);
  border-radius:10px; padding:12px 16px;
  display:flex; align-items:center; justify-content:space-between;
  cursor:pointer; transition:all .18s; user-select:none;
}
.kp-buy-opt:hover     { border-color:var(--kima-blue); box-shadow:0 2px 12px rgba(43,127,212,.1); }
.kp-buy-opt--featured { }
.kp-buy-opt--selected { border-color:var(--kima-blue); box-shadow:0 0 0 2px rgba(43,127,212,.25); }
.kp-buy-opt__info         { line-height:1.3; }
.kp-buy-opt__info strong  { font-size:14px; font-weight:600; color:var(--kima-text); }
.kp-buy-opt__info small   { display:block; font-size:11px; color:var(--kima-muted); }
.kp-buy-opt__price        { font-size:18px; font-weight:600; color:var(--kima-blue); }
.kp-badge-save { background:var(--kima-green); color:#fff; font-size:10px; font-weight:600; padding:2px 7px; border-radius:99px; margin-left:6px; }

.kp-pay-btn {
  display: block; width:100%; border:none; border-radius:10px;
  padding:13px; font-size:14px; font-weight:500;
  font-family:'DM Sans',sans-serif; cursor:pointer;
  transition:all .18s; text-align:center;
  color:#fff !important; background:var(--kima-blue);
  margin-top: 8px;
}
.kp-pay-btn:first-of-type { margin-top: 0; }
.kp-pay-btn:hover { background:var(--kima-blue-dark); transform:translateY(-1px); box-shadow:0 4px 16px rgba(43,127,212,.28); }

.kp-pay-wire {
  background: transparent !important;
  border: 1.5px solid var(--kima-blue) !important;
  color: var(--kima-blue) !important;
}
.kp-pay-wire:hover { background:rgba(43,127,212,.06) !important; transform:none !important; box-shadow:none !important; }

.kp-iban-box {
  background:var(--kima-white); border:1px solid var(--kima-border);
  border-radius:10px; padding:16px 18px; margin-top:12px; display:none;
}
.kp-iban-title { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--kima-muted); margin-bottom:10px; }
.kp-iban-row { display:flex; justify-content:space-between; align-items:center; padding:7px 0; border-bottom:1px solid var(--kima-border); font-size:13px; }
.kp-iban-row:last-of-type { border-bottom:none; }
.kp-iban-row span { color:var(--kima-muted); }
.kp-iban-row strong { color:var(--kima-text); }
.kp-iban-code { font-size:12px; letter-spacing:.04em; }
.kp-iban-note { font-size:11px; color:var(--kima-muted); margin:10px 0 0; line-height:1.5; }
.kp-pay-note  { font-size:11px; color:var(--kima-muted); text-align:center; margin:10px 0 0; }

/* ── Box contatto ─────────────────────────────────────────────────────────── */
.kp-card--contact {
  background:     var(--kima-blue)  !important;
  border-color:   var(--kima-blue)  !important;
  color:          #fff              !important;
  display: flex; flex-direction: column; justify-content: space-between;
}
.kp-card--contact h4  { font-size:17px; font-weight:700; color:#fff !important; margin-bottom:10px; }
.kp-card--contact > p { font-size:13px; line-height:1.55; color:rgba(255,255,255,.9) !important; margin-bottom:20px; }

.kp-contact-btn {
  display:      block         !important;
  width:        100%          !important;
  background:   rgba(255,255,255,.14) !important;
  border:       1.5px solid rgba(255,255,255,.35) !important;
  color:        #fff          !important;
  border-radius:9px           !important;
  padding:      12px 16px     !important;
  font-size:    13px          !important;
  font-weight:  500           !important;
  text-align:   center        !important;
  text-decoration: none       !important;
  margin-bottom:10px          !important;
  transition:   background .18s;
  font-family:  'DM Sans', sans-serif !important;
}
.kp-contact-btn:hover     { background: rgba(255,255,255,.26) !important; }
.kp-contact-btn--wa       { background: #25D366 !important; border-color: #25D366 !important; }
.kp-contact-btn--wa:hover { background: #1da84e !important; }
.kp-contact-note { font-size:11px; color:rgba(255,255,255,.65) !important; text-align:center; margin:4px 0 0; }

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .kp-top-grid,
  .kp-bottom-grid { grid-template-columns: 1fr !important; }
  .kp-maint-inner  { flex-direction: row; align-items: center; }
  .kp-countdown    { min-width: 90px; padding: 12px 16px; }
  .kp-countdown__num { font-size: 36px; }
  .kp-greeting__name { font-size: 22px; }
  .kp-table-wrap     { overflow-x: auto; }
}
