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

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  background: oklch(97% 0.006 85);
  color: oklch(24% 0.02 260);
  font-size: 14px;
  line-height: 1.5;
}
a { color: oklch(38% 0.09 255); text-decoration: none; }
a:hover { color: oklch(30% 0.09 255); }
h1 { font-size: 20px; font-weight: 700; margin: 0; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding: 16px 40px; border-bottom: 1px solid oklch(90% 0.006 85);
  background: white;
}
.brand {
  font-weight: 700; font-size: 13px; letter-spacing: 0.03em; text-transform: uppercase;
  color: oklch(38% 0.09 255); margin-bottom: 5px;
}
.pratica-title { font-size: 15px; font-weight: 600; }
.pratica-sub { font-size: 12px; color: oklch(50% 0.02 260); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 100px; font-size: 12px; font-weight: 600;
}
.badge.progress { background: oklch(94% 0.03 70); color: oklch(45% 0.11 70); }
.badge.done { background: oklch(94% 0.05 155); color: oklch(45% 0.13 155); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.from-visura {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  color: oklch(45% 0.13 155); background: oklch(94% 0.05 155);
  padding: 2px 7px; border-radius: 5px; vertical-align: middle; margin-left: 6px;
}

/* Buttons */
.btn {
  display: inline-block; border-radius: 8px; padding: 9px 18px;
  font-size: 13.5px; font-weight: 600; border: 1px solid transparent;
  cursor: pointer; font-family: inherit; background: white;
}
.btn-primary { background: oklch(38% 0.09 255); color: white; }
.btn-primary:hover { background: oklch(30% 0.09 255); }
.btn-outline { background: white; border-color: oklch(82% 0.01 260); color: oklch(30% 0.02 260); }
.btn-outline:hover { background: oklch(97% 0.006 85); }
form.inline { display: inline; }

/* Tab bar */
.tabbar {
  display: flex; gap: 2px; padding: 0 40px; background: white;
  border-bottom: 1px solid oklch(90% 0.006 85); overflow-x: auto;
}
.tab {
  display: flex; align-items: center; gap: 8px; padding: 14px 18px;
  font-size: 13px; font-weight: 600; color: oklch(52% 0.02 260);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.active { color: oklch(38% 0.09 255); border-bottom-color: oklch(38% 0.09 255); }
.tab.disabled { color: oklch(75% 0.006 85); }

/* Content layout */
.body-layout { display: flex; min-height: calc(100vh - 110px); }
.content { flex: 1; overflow: auto; padding: 28px 40px 60px; max-width: 1440px; margin: 0 auto; }
.sections-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: start; }

@media (max-width: 1100px) {
  .sections-grid { grid-template-columns: 1fr; }
}
.sections-grid .section { margin-bottom: 0; }
.content.narrow { max-width: 560px; margin: 0 auto; padding-top: 48px; }

/* Sections + fields */
.section {
  background: white; border: 1px solid oklch(90% 0.006 85); border-radius: 12px;
  padding: 24px 28px; margin-bottom: 20px; scroll-margin-top: 20px;
}
.section-title {
  font-size: 15px; font-weight: 700; margin: 0 0 18px; padding-bottom: 14px;
  border-bottom: 1px solid oklch(93% 0.006 85);
}
.section-desc { font-size: 12.5px; color: oklch(50% 0.02 260); margin: 0 0 16px; }
.field-row { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 16px; }
.field-row:last-child { margin-bottom: 0; }
.field { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
label { font-size: 12.5px; font-weight: 600; color: oklch(38% 0.02 260); }
input[type="text"], input[type="date"], input[type="email"], input[type="password"], select {
  font-family: inherit; font-size: 13.5px; padding: 10px 12px; border-radius: 7px;
  border: 1px solid oklch(85% 0.01 260); background: white; color: oklch(24% 0.02 260); width: 100%;
}
input:focus, select:focus { outline: 2px solid oklch(38% 0.09 255 / 0.3); border-color: oklch(38% 0.09 255); }
input:disabled, select:disabled { background: oklch(96% 0.008 260); color: oklch(45% 0.01 260); }
.radio-row { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.radio-opt { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.4; }
.radio-opt input { width: 15px; height: 15px; margin-top: 2px; flex-shrink: 0; }

/* Callout / info banners */
.callout { background: oklch(97% 0.02 255); border: 1px solid oklch(88% 0.03 255); border-radius: 10px; padding: 14px 18px; margin: 0 0 20px; }
.callout-warn { color: oklch(40% 0.13 70); background: oklch(97% 0.05 70); border: 1px solid oklch(88% 0.08 70); border-radius: 10px; padding: 14px 18px; margin: 0 0 20px; }
.callout-error { color: oklch(40% 0.15 25); background: oklch(96% 0.05 25); border: 1px solid oklch(85% 0.1 25); border-radius: 10px; padding: 14px 18px; margin: 0 0 20px; }

/* Tables (Titolare Effettivo / Soci) */
.row-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.row-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.02em; color: oklch(55% 0.01 260); padding: 6px 4px; }
.row-table td { padding: 4px 4px 4px 0; }
.row-table input { margin-right: 0; }

/* Upload form */
.upload-form {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: white; border: 1px solid oklch(90% 0.006 85); border-radius: 10px;
  padding: 14px 18px; margin-bottom: 20px;
}
.upload-form input[type="file"] { font-size: 13px; }

/* Login card */
.login-card {
  background: white; border: 1px solid oklch(90% 0.006 85); border-radius: 12px;
  padding: 32px; box-shadow: 0 4px 16px oklch(0% 0 0 / 0.04);
}
.login-card h1 { margin-bottom: 20px; }
.field-stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }

/* Pratiche list */
.pratiche-table { width: 100%; border-collapse: collapse; background: white; border: 1px solid oklch(90% 0.006 85); border-radius: 10px; overflow: hidden; }
.pratiche-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.02em; color: oklch(55% 0.01 260); padding: 12px 16px; border-bottom: 1px solid oklch(90% 0.006 85); }
.pratiche-table td { padding: 12px 16px; border-bottom: 1px solid oklch(94% 0.006 85); font-size: 13.5px; }
.pratiche-table tr:last-child td { border-bottom: none; }

@media (max-width: 720px) {
  .topbar, .tabbar, .content { padding-left: 16px; padding-right: 16px; }
}
