/* THEPRODUSER Control Center — componenti del pannello ADMIN nello stile di Vera (ai.dcesana.it): tema chiaro, Amber + Stone,
   Inter, card bianche con bordo stone, gradiente ambra→rosa→viola delle icone del dock. Il resto dell'aspetto (plancia, dock,
   finestre, Filament) viene dal tema compilato resources/css/filament/admin/theme.css, lo stesso di Vera. (Vera, 27/09/2026) */

:root {
  --card-bg: #ffffff;
  --card-bg-soft: #fafaf9;
  --border-color: #e7e5e4;
  --border-strong: #d6d3d1;
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #736c66;

  --accent: #d97706;
  --accent-strong: #b45309;
  --accent-soft: #fffbeb;
  --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #f43f5e 55%, #8b5cf6 100%);
  --accent-gradient-soft: linear-gradient(135deg, #fffbeb, #fff1f2 60%, #f5f3ff);

  --status-success: #047857; --status-success-bg: #ecfdf5; --status-success-bd: #a7f3d0;
  --status-warning: #b45309; --status-warning-bg: #fffbeb; --status-warning-bd: #fde68a;
  --status-orange: #c2410c;  --status-orange-bg: #fff7ed;  --status-orange-bd: #fed7aa;
  --status-critical: #be123c; --status-critical-bg: #fff1f2; --status-critical-bd: #fecdd3;
  --status-info: #0369a1;    --status-info-bg: #f0f9ff;    --status-info-bd: #bae6fd;
  --status-unknown: #57534e; --status-unknown-bg: #f5f5f4; --status-unknown-bd: #e7e5e4;

  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px;
  --shadow-card: 0 1px 2px rgb(28 25 23 / 0.06), 0 1px 3px rgb(28 25 23 / 0.04);
  --shadow-hover: 0 6px 20px -8px rgb(28 25 23 / 0.18);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1); --dur-fast: 150ms; --dur: 220ms; --dur-slow: 300ms;
}

/* ------------------------------------------------------------------ griglia dashboard */
.tp-dash { display: grid; gap: var(--space-5); color: var(--text-primary); }
.tp-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.tp-hero h1 { font-size: clamp(22px, 2.1vw, 28px); font-weight: 700; letter-spacing: -.02em; margin: 0; color: var(--text-primary); }
.tp-hero h1 .tp-grad { color: var(--accent); }
.tp-hero p { color: var(--text-secondary); margin: 4px 0 0; }
.tp-row { display: grid; gap: var(--space-5); }
.tp-kpis { display: grid; gap: var(--space-4); grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1500px) { .tp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tp-row-1 { grid-template-columns: minmax(0, 1fr); }
.tp-row-2 { grid-template-columns: minmax(0, 2.1fr) minmax(320px, 1fr); }
.tp-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1280px) { .tp-row-2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .tp-row-4 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ card */
.tp-card { position: relative; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: var(--space-5); min-width: 0; color: var(--text-primary); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.tp-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.tp-card-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; margin: 0; color: var(--text-primary); }
.tp-card-title svg { width: 18px; height: 18px; color: var(--accent); }
.tp-card-sub { color: var(--text-muted); font-size: 12px; }
.tp-link { color: var(--accent-strong); font-size: 12px; font-weight: 600; text-decoration: none; }
.tp-link:hover { text-decoration: underline; }

/* KPI */
.tp-kpi { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text-primary); overflow: hidden; }
.tp-kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--kpi-accent, var(--accent-gradient)); }
.tp-kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.tp-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.tp-kpi-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(180deg, #fff, #f1f1f0); box-shadow: 0 2px 5px rgb(0 0 0 / 0.14), inset 0 1px 0 #fff; }
.tp-kpi-ico svg { width: 21px; height: 21px; color: var(--accent); }
.tp-kpi-val { font-size: clamp(22px, 1.9vw, 30px); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--text-primary); }
.tp-kpi-lab { color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.tp-kpi-var { color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* stato: colore + testo (mai solo colore) */
.tp-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.tp-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tp-s-online, .tp-s-success, .tp-s-ok { color: var(--status-success); background: var(--status-success-bg); border-color: var(--status-success-bd); }
.tp-s-warning { color: var(--status-warning); background: var(--status-warning-bg); border-color: var(--status-warning-bd); }
.tp-s-orange { color: var(--status-orange); background: var(--status-orange-bg); border-color: var(--status-orange-bd); }
.tp-s-critical, .tp-s-offline, .tp-s-expired, .tp-s-error { color: var(--status-critical); background: var(--status-critical-bg); border-color: var(--status-critical-bd); }
.tp-s-maintenance, .tp-s-info { color: var(--status-info); background: var(--status-info-bg); border-color: var(--status-info-bd); }
.tp-s-unknown { color: var(--status-unknown); background: var(--status-unknown-bg); border-color: var(--status-unknown-bd); }

/* barre risorse */
.tp-gauge { display: grid; gap: 4px; min-width: 70px; }
.tp-gauge-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.tp-gauge-bar { height: 6px; border-radius: 99px; background: #f0efee; overflow: hidden; }
.tp-gauge-bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #10b981, #06b6d4); transition: width var(--dur-slow) var(--ease); }
.tp-gauge.warn .tp-gauge-bar > i { background: linear-gradient(90deg, #f59e0b, #f97316); }
.tp-gauge.crit .tp-gauge-bar > i { background: linear-gradient(90deg, #f97316, #e11d48); }

/* tabelle */
.tp-table-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--space-5)); padding: 0 var(--space-5); }
.tp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 900px; color: var(--text-primary); }
.tp-table th { text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); padding: 8px 10px; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.tp-table td { padding: 12px 10px; border-bottom: 1px solid #f0efee; vertical-align: middle; }
.tp-table tr:last-child td { border-bottom: 0; }
.tp-table tr:hover td { background: var(--card-bg-soft); }
.tp-table .tp-name { font-weight: 600; color: var(--text-primary); }
.tp-table .tp-mono, .tp-mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.tp-env { white-space: nowrap; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.tp-env-production { background: var(--status-critical-bg); color: var(--status-critical); border-color: var(--status-critical-bd); }
.tp-env-staging { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.tp-env-vpn { background: var(--status-success-bg); color: var(--status-success); border-color: var(--status-success-bd); }
.tp-env-control { background: var(--accent-soft); color: var(--accent-strong); border-color: #fde68a; }

/* salute (anello) */
.tp-health { display: grid; grid-template-columns: auto 1fr; gap: var(--space-5); align-items: center; }
@media (max-width: 500px) { .tp-health { grid-template-columns: 1fr; justify-items: center; } }
.tp-ring { --v: 0; --c: #10b981; width: 148px; height: 148px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(closest-side, #fff 78%, transparent 79% 100%), conic-gradient(var(--c) calc(var(--v) * 1%), #f0efee 0); }
.tp-ring b { font-size: 34px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.tp-ring small { display: block; text-align: center; font-size: 11px; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; }
.tp-hparts { display: grid; gap: 10px; }
.tp-hpart { display: grid; grid-template-columns: 120px 1fr 44px; gap: 10px; align-items: center; font-size: 12px; }
.tp-hpart span:first-child { color: var(--text-secondary); }
.tp-hpart em { font-style: normal; color: var(--text-muted); font-size: 11px; grid-column: 1 / -1; margin-top: -6px; }
.tp-hpart b { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.tp-note { font-size: 12px; color: var(--text-muted); }

/* feed attività / notifiche */
.tp-feed { display: grid; gap: 2px; }
.tp-feed-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; padding: 9px 6px; border-radius: var(--radius-sm); }
.tp-feed-item:hover { background: var(--card-bg-soft); }
.tp-feed-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: #fff; border: 1px solid var(--border-color); }
.tp-feed-ico svg { width: 15px; height: 15px; }
.tp-feed-t { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.tp-feed-d { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.tp-feed-w { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.tp-empty { display: grid; place-items: center; gap: 6px; text-align: center; padding: 26px 10px; color: var(--text-muted); font-size: 13px; }
.tp-empty svg { width: 28px; height: 28px; color: #10b981; }

/* segmented control */
.tp-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #f5f5f4; border: 1px solid var(--border-color); gap: 2px; flex-wrap: wrap; }
.tp-seg button { font: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary); background: transparent; border: 0; padding: 5px 10px; border-radius: 8px; cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.tp-seg button:hover { color: var(--text-primary); background: #fff; }
.tp-seg button[aria-pressed="true"] { background: #fff; color: var(--accent-strong); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }

/* grafico dentro la card */
.tp-chart .fi-section { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; --tw-ring-shadow: 0 0 #0000 !important; }
.tp-chart .fi-section-header { display: none; }
.tp-chart .fi-section-content-ctn, .tp-chart .fi-section-content { padding: 0 !important; }

/* pagine */
.tp-page { display: grid; gap: var(--space-5); color: var(--text-primary); }
.tp-grid-cards { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.tp-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.tp-kv dt { color: var(--text-muted); }
.tp-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text-primary); }
.tp-timeline { display: grid; border-left: 2px solid var(--border-color); margin-left: 8px; }
.tp-tl { position: relative; padding: 0 0 16px 18px; }
.tp-tl::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--c, #a8a29e); box-shadow: 0 0 0 3px #fff; }
.tp-tl-t { font-size: 13px; font-weight: 600; }
.tp-tl-d { font-size: 12px; color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
.tp-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }
