/* ============================================
   GENTILE COSTRUZIONI – DESIGN SYSTEM
   Palette: Beige #F4EFE6 | Olive #5E6F5E
   Dark Green #2F4F3E | Copper #B87333 | Gray #6B6B6B
   MOBILE-FIRST – cross-browser safe
============================================ */

/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #F4EFE6;
  color: #1C1C1C;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; background: none; font-family: inherit; }
input, textarea, select {
  outline: none;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
table { border-collapse: collapse; width: 100%; }

/* ── CSS VARIABLES ───────────────────────────────────────────── */
:root {
  --primary: #5E6F5E;
  --primary-dark: #2F4F3E;
  --primary-light: #EBF0EB;
  --accent: #B87333;
  --accent-light: #F5E8D8;
  --dark: #1C1C1C;
  --gray: #6B6B6B;
  --light-gray: #E2DAD0;
  --bg: #F4EFE6;
  --white: #FFFFFF;
  --success: #15803D;
  --error: #DC2626;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
  --max-width: 1280px;
  --sidebar-width: 260px;
  --navbar-h: 60px;
}

/* ── TYPOGRAPHY ──────────────────────────────────────────────── */
h1 { font-size: clamp(1.55rem, 6vw, 3rem); font-weight: 700; line-height: 1.15; color: var(--dark); }
h2 { font-size: clamp(1.25rem, 4.5vw, 2.25rem); font-weight: 700; line-height: 1.2; color: var(--dark); }
h3 { font-size: clamp(1rem, 3vw, 1.5rem); font-weight: 600; line-height: 1.3; color: var(--dark); }
h4 { font-size: clamp(0.9rem, 2vw, 1rem); font-weight: 600; color: var(--dark); }
p  { font-size: 1rem; color: var(--gray); line-height: 1.7; }
.text-sm   { font-size: 0.875rem; }
.text-xs   { font-size: 0.75rem; }
.text-white   { color: var(--white) !important; }
.text-primary { color: var(--primary) !important; }
.text-accent  { color: var(--accent) !important; }
.text-dark    { color: var(--dark) !important; }
.text-gray    { color: var(--gray) !important; }
.font-bold    { font-weight: 700; }
.font-semibold{ font-weight: 600; }
.text-center  { text-align: center; }

/* ── LAYOUT ──────────────────────────────────────────────────── */
.container    { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; width: 100%; }
.section      { padding: 48px 0; }
.section-sm   { padding: 32px 0; }
/* Mobile-first grids: single column */
.grid-2, .grid-3, .grid-4 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { flex-direction: column; }
.gap-4   { gap: 4px;  }
.gap-8   { gap: 8px;  }
.gap-16  { gap: 16px; }
.gap-24  { gap: 24px; }
.gap-32  { gap: 32px; }
.w-full  { width: 100%; }
.page-top-pad { padding-top: var(--navbar-h); }
.overflow-x-auto { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 20px; border-radius: var(--radius-full);
  font-size: 0.9rem; font-weight: 600; transition: all var(--transition);
  white-space: nowrap; cursor: pointer; border: 2px solid transparent;
  line-height: 1.2; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-sm  { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg  { padding: 13px 28px; font-size: 0.95rem; }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover  { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(47,79,62,0.3); }
.btn-secondary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.btn-dark   { background: var(--dark); color: #fff; border-color: var(--dark); }
.btn-dark:hover  { background: #333; transform: translateY(-2px); }
.btn-white  { background: #fff; color: var(--primary); border-color: #fff; }
.btn-white:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover{ background: #9d5e30; transform: translateY(-2px); }
.btn-icon   { padding: 9px; width: 40px; height: 40px; }

/* ── NAVBAR ──────────────────────────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--light-gray);
  transition: box-shadow var(--transition);
}
#navbar.scrolled { box-shadow: var(--shadow-md); }
.navbar-inner {
  height: var(--navbar-h);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 16px; gap: 12px;
}
.navbar-logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 0; }
.navbar-logo .logo-img { max-height: 38px; max-width: 130px; object-fit: contain; }
.navbar-logo .logo-icon { width: 34px; height: 34px; background: var(--primary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: white; font-size: 0.95rem; font-weight: 700; flex-shrink: 0; }
.navbar-logo .logo-text { font-size: 0.9rem; font-weight: 700; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbar-logo .logo-text span { color: var(--primary); }
.navbar-menu { display: none; }
.navbar-cta  { display: none; }
.navbar-hamburger {
  display: flex; flex-direction: column; gap: 5px;
  background: none; padding: 8px; border-radius: var(--radius-sm);
  flex-shrink: 0; -webkit-tap-highlight-color: transparent;
}
.navbar-hamburger span { display: block; width: 22px; height: 2px; background: var(--dark); border-radius: 2px; transition: all var(--transition); }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--navbar-h); left: 0; right: 0;
  background: white;
  border-bottom: 1px solid var(--light-gray);
  z-index: 999;
  padding: 12px 16px 24px;
  flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-md);
  max-height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 0.95rem; color: var(--dark);
  transition: all var(--transition); display: block;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu a:hover, .mobile-menu a:active { background: var(--primary-light); color: var(--primary); }
.mobile-menu .mobile-cta-row {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--light-gray);
  display: flex; gap: 8px;
}
.mobile-menu .mobile-cta {
  background: var(--primary); color: white; text-align: center;
  border-radius: var(--radius-full); padding: 13px 20px;
  font-weight: 600; font-size: 0.9rem; flex: 1;
}

/* Sticky mobile bottom CTA */
.sticky-cta {
  display: block;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--primary); z-index: 500;
}
.sticky-cta a {
  display: block; text-align: center;
  color: white; font-weight: 600;
  padding: 14px; font-size: 0.9rem;
  -webkit-tap-highlight-color: transparent;
}

/* ── HERO ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh; min-height: 100vh; /* svh per mobile browsers */
  display: flex; align-items: center;
  background: linear-gradient(135deg, #1a2e22 0%, #2F4F3E 50%, #3d6350 100%);
  overflow: hidden;
  padding-top: var(--navbar-h);
}
.hero-bg {
  position: absolute; inset: 0;
  background-image: url('/static/images/hero.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.65;
  will-change: transform; /* GPU compositing */
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(47,79,62,0.60) 0%, rgba(94,111,94,0.38) 100%);
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 700px;
  padding: 32px 0 80px;
  width: 100%;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.12);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  padding: 5px 14px; margin-bottom: 16px;
  color: white; font-size: 0.78rem; font-weight: 500;
}
.hero h1 { color: white; margin-bottom: 14px; }
.hero h1 span { color: #D4A96A; }
.hero p { color: rgba(255,255,255,0.85); font-size: 0.95rem; margin-bottom: 24px; max-width: 540px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-btns .btn { min-width: 0; }
.hero-stats {
  display: flex; gap: 16px; margin-top: 32px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.15);
  flex-wrap: wrap;
}
.hero-stat { text-align: center; min-width: 55px; }
.hero-stat .num   { font-size: 1.4rem; font-weight: 700; color: white; line-height: 1.1; }
.hero-stat .label { font-size: 0.65rem; color: rgba(255,255,255,0.65); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }
.hero-scroll {
  display: none;
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 1; flex-direction: column; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.6); font-size: 0.75rem;
  animation: bounce 2s infinite;
}
.hero-scroll .scroll-line { width: 1px; height: 32px; background: rgba(255,255,255,0.4); }

/* ── SECTION HEADERS ─────────────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 32px; }
.section-tag {
  display: inline-block;
  background: var(--primary-light); color: var(--primary);
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px;
}
.section-header h2 { margin-bottom: 10px; }
.section-header p  { max-width: 560px; margin: 0 auto; font-size: 0.95rem; }
.section-divider { width: 40px; height: 3px; background: var(--accent); border-radius: 2px; margin: 14px auto 0; }

/* ── CARD SERVICE ─────────────────────────────────────────────── */
.card-service {
  background: var(--white); border-radius: var(--radius-md);
  padding: 22px 18px; transition: all var(--transition);
  border: 1px solid var(--light-gray);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  text-decoration: none;
}
.card-service::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--transition);
}
.card-service:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-service:hover::before { transform: scaleX(1); }
.card-service .icon {
  width: 48px; height: 48px; background: var(--primary-light);
  border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 14px; color: var(--primary); flex-shrink: 0;
}
.card-service h3 { font-size: 1rem; margin-bottom: 8px; }
.card-service p  { font-size: 0.875rem; line-height: 1.6; flex: 1; }
.card-service .link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: 0.85rem; font-weight: 600; margin-top: 14px; transition: gap var(--transition); }
.card-service .link:hover { gap: 10px; }

/* ── CARD PROPERTY ────────────────────────────────────────────── */
.card-property {
  background: var(--white); border-radius: var(--radius-md);
  overflow: hidden; border: 1px solid var(--light-gray);
  transition: all var(--transition); position: relative;
  display: flex; flex-direction: column; text-decoration: none;
}
.card-property:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-property .img-wrap { position: relative; height: 200px; overflow: hidden; flex-shrink: 0; }
.card-property .img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card-property:hover .img-wrap img { transform: scale(1.06); }
.card-property .badge { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-sale { background: var(--accent); color: white; }
.badge-rent { background: var(--primary); color: white; }
.badge-sold { background: var(--gray); color: white; }
.badge-new  { background: #0EA5E9; color: white; }
.card-property .card-body { padding: 16px; flex: 1; }
.card-property h4 { font-size: 0.95rem; margin-bottom: 5px; }
.card-property .location { display: flex; align-items: center; gap: 5px; color: var(--gray); font-size: 0.8rem; margin-bottom: 10px; }
.card-property .price { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.card-property .specs { display: flex; gap: 10px; flex-wrap: wrap; }
.card-property .spec { display: flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--gray); }
.card-property .card-footer { padding: 12px 16px; border-top: 1px solid var(--light-gray); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── CARD PROJECT ─────────────────────────────────────────────── */
.card-project {
  position: relative; border-radius: var(--radius-md);
  overflow: hidden; aspect-ratio: 4/3; cursor: pointer;
  background: var(--light-gray);
}
.card-project img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; display: block; }
.card-project:hover img { transform: scale(1.08); }
.card-project .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,90,74,0.92) 0%, transparent 60%);
  opacity: 0; transition: opacity var(--transition);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 20px;
}
.card-project:hover .overlay { opacity: 1; }
.card-project .tag { display: inline-block; background: var(--accent); color: white; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; margin-bottom: 6px; width: -webkit-fit-content; width: fit-content; }
.card-project h4   { color: white; font-size: 0.9rem; margin-bottom: 4px; }
.card-project .meta { color: rgba(255,255,255,0.7); font-size: 0.78rem; }
.card-project .always-tag { position: absolute; top: 10px; right: 10px; background: var(--accent); color: white; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; }

/* ── HOME SECTIONS ───────────────────────────────────────────── */
#services       { background: var(--white); }
#certifications { background: var(--bg); }

.cert-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cert-card {
  background: white; border-radius: var(--radius-md); padding: 18px 14px;
  text-align: center; border: 1px solid var(--light-gray); transition: all var(--transition);
}
.cert-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.cert-icon { width: 50px; height: 50px; background: var(--primary-light); border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 1.3rem; }
.cert-card h4 { color: var(--dark); margin-bottom: 5px; font-size: 0.88rem; }
.cert-card p  { font-size: 0.78rem; }

/* Masonry */
#works { background: var(--bg); }
.masonry-grid { -webkit-columns: 1; columns: 1; gap: 14px; }
.masonry-item { -webkit-column-break-inside: avoid; break-inside: avoid; margin-bottom: 14px; border-radius: var(--radius-md); overflow: hidden; }

/* Energy */
#energy {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #3d6350 100%);
  position: relative; overflow: hidden;
}
#energy::before {
  content: ''; position: absolute; top: -50%; right: -10%;
  width: 400px; height: 400px; background: rgba(255,255,255,0.04); border-radius: 50%;
}
.energy-content { display: grid; grid-template-columns: 1fr; gap: 28px; }
.energy-text h2 { color: white; margin-bottom: 12px; }
.energy-text p  { color: rgba(255,255,255,0.82); margin-bottom: 20px; }
.energy-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.energy-feature { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,0.9); font-size: 0.9rem; }
.energy-feature .feat-icon { width: 34px; height: 34px; background: rgba(255,255,255,0.1); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; }
.energy-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.energy-card {
  background: rgba(255,255,255,0.1);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15); border-radius: var(--radius-md);
  padding: 16px 12px; text-align: center; transition: all var(--transition);
}
.energy-card:hover { background: rgba(255,255,255,0.16); transform: translateY(-4px); }
.energy-card .e-icon { font-size: 1.6rem; margin-bottom: 8px; }
.energy-card h4 { color: white; font-size: 0.875rem; margin-bottom: 4px; }
.energy-card p  { color: rgba(255,255,255,0.65); font-size: 0.78rem; }

/* Properties home */
#properties { background: var(--white); }

/* CTA finale */
#cta-section {
  background: var(--primary-dark); text-align: center; padding: 56px 0;
  position: relative; overflow: hidden;
}
#cta-section::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%231F7A63' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
#cta-section h2 { color: white; margin-bottom: 12px; position: relative; }
#cta-section p  { color: rgba(255,255,255,0.7); margin-bottom: 24px; position: relative; padding: 0 16px; }
.cta-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; padding: 0 16px; }

/* ── FOOTER ──────────────────────────────────────────────────── */
#footer { background: #111; padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; margin-bottom: 32px; }
.footer-brand .logo-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand .logo-box { width: 36px; height: 36px; background: var(--primary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 1rem; flex-shrink: 0; }
.footer-logo-img { max-height: 40px; max-width: 160px; object-fit: contain; }
.footer-brand h3 { color: white; font-size: 1rem; }
.footer-brand h3 span { color: var(--primary); }
.footer-brand p { color: #9CA3AF; font-size: 0.85rem; line-height: 1.7; margin-bottom: 16px; }
.social-links { display: flex; gap: 8px; }
.social-links a {
  width: 36px; height: 36px; background: rgba(255,255,255,0.07);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  color: #9CA3AF; font-size: 0.875rem; transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.social-links a:hover { background: var(--primary); color: white; }
.footer-col h4 { color: white; font-size: 0.9rem; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: #9CA3AF; font-size: 0.85rem; transition: color var(--transition); display: flex; align-items: center; gap: 6px; }
.footer-col ul li a:hover { color: var(--primary); }
.footer-contact-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.footer-contact-item .ci-icon { width: 30px; height: 30px; background: rgba(94,111,94,0.18); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 0.8rem; flex-shrink: 0; margin-top: 2px; }
.footer-contact-item .ci-text { font-size: 0.82rem; color: #9CA3AF; line-height: 1.5; }
.footer-contact-item .ci-text strong { color: white; display: block; font-size: 0.78rem; margin-bottom: 2px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.footer-bottom p { color: #6B7280; font-size: 0.75rem; }
.footer-bottom .legal-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.footer-bottom .legal-links a { color: #6B7280; font-size: 0.75rem; transition: color var(--transition); }
.footer-bottom .legal-links a:hover { color: var(--primary); }
/* Crediti X Technology */
.footer-credits { text-align: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.06); font-size: 0.7rem; color: rgba(155,155,155,0.7); }
.footer-credits-link { color: rgba(184,115,51,0.85); text-decoration: none; transition: color var(--transition); }
.footer-credits-link:hover { color: var(--accent); }
.footer-credits-link strong { font-weight: 600; }

/* ── ADMIN BUSINESS CARD PREVIEW ────────────────────────────── */
.bc-admin-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.bc-admin-card {
  background: white; border-radius: var(--radius-md);
  border: 1px solid var(--light-gray); overflow: hidden;
  transition: all var(--transition);
}
.bc-admin-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.bc-admin-card-header {
  background: linear-gradient(135deg, #145A4A, #1F7A63);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}
.bc-admin-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 1.1rem;
  flex-shrink: 0; overflow: hidden;
}
.bc-admin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bc-admin-info { flex: 1; min-width: 0; }
.bc-admin-info .bc-name { font-size: 0.95rem; font-weight: 700; color: white; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-admin-info .bc-role { font-size: 0.75rem; color: rgba(255,255,255,0.75); }
.bc-admin-card-body { padding: 14px 20px; }
.bc-admin-card-body .bc-slug { font-size: 0.72rem; color: var(--gray); font-family: monospace; margin-bottom: 8px; }
.bc-admin-card-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 20px; background: var(--bg); border-top: 1px solid var(--light-gray); }

/* ── INNER PAGE HERO ─────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 0; text-align: center; position: relative;
  min-height: 280px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.page-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  opacity: 0.60;
}
.page-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(47,79,62,0.62) 0%, rgba(94,111,94,0.45) 100%);
}
.page-hero .container { position: relative; z-index: 2; padding: 80px 16px 40px; }
.page-hero h1  { color: white; margin-bottom: 10px; }
.page-hero p   { color: rgba(255,255,255,0.84); font-size: 0.95rem; max-width: 560px; margin: 0 auto; }
.breadcrumb    { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.breadcrumb a  { color: rgba(255,255,255,0.6); font-size: 0.8rem; }
.breadcrumb a:hover { color: white; }
.breadcrumb .sep { color: rgba(255,255,255,0.4); }
.breadcrumb .current { color: white; font-size: 0.8rem; }

/* ── SERVICES PAGE ───────────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.service-detail-card {
  background: white; border-radius: var(--radius-md);
  padding: 22px 18px; border: 1px solid var(--light-gray); transition: all var(--transition);
}
.service-detail-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary); transform: translateY(-4px); }
.service-detail-card .sdc-icon { width: 52px; height: 52px; background: var(--primary-light); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 16px; }
.service-detail-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.service-detail-card p  { font-size: 0.875rem; margin-bottom: 14px; }
.service-detail-card ul { display: flex; flex-direction: column; gap: 6px; }
.service-detail-card ul li { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--gray); }
.service-detail-card ul li::before { content: '✓'; color: var(--primary); font-weight: 700; }

/* ── PROPERTIES PAGE ─────────────────────────────────────────── */
.props-layout  { display: grid; grid-template-columns: 1fr; gap: 20px; }
.filters-panel { background: white; border-radius: var(--radius-md); padding: 18px; border: 1px solid var(--light-gray); }
.filters-panel h3 { font-size: 0.9rem; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--light-gray); display: flex; align-items: center; gap: 8px; }
.filter-group  { margin-bottom: 14px; }
.filter-group label { display: block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray); margin-bottom: 6px; }
.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="number"] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm); font-size: 0.85rem; color: var(--dark);
  background: var(--bg); transition: border-color var(--transition);
}
.filter-group select:focus,
.filter-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(94,111,94,0.15); }
.range-inputs { display: flex; gap: 8px; }
.range-inputs input { flex: 1; min-width: 0; }
.props-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.props-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.props-count  { font-size: 0.875rem; color: var(--gray); }
.sort-select  { padding: 8px 12px; border: 1px solid var(--light-gray); border-radius: var(--radius-sm); font-size: 0.85rem; background: white; }

/* Property Detail */
.prop-detail-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.prop-gallery { border-radius: var(--radius-md); overflow: hidden; }
.prop-gallery .main-img { width: 100%; height: 220px; object-fit: cover; display: block; }
.prop-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 4px; }
.prop-thumbs img { width: 100%; height: 55px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; opacity: 0.7; transition: opacity var(--transition); }
.prop-thumbs img:hover, .prop-thumbs img.active { opacity: 1; }
.prop-info-panel { background: white; border-radius: var(--radius-md); padding: 20px; border: 1px solid var(--light-gray); }
.prop-price      { font-size: 1.6rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.prop-price-note { font-size: 0.78rem; color: var(--gray); margin-bottom: 14px; }
.prop-specs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.prop-spec { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; }
.prop-spec .ps-label { font-size: 0.7rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
.prop-spec .ps-value { font-size: 0.88rem; font-weight: 600; color: var(--dark); }
.contact-form-mini label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 5px; }
.contact-form-mini input,
.contact-form-mini textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 10px;
  transition: border-color var(--transition); resize: vertical; background: white;
}
.contact-form-mini input:focus,
.contact-form-mini textarea:focus { border-color: var(--primary); }

/* ── WORKS PAGE ──────────────────────────────────────────────── */
.works-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; overflow-x: auto; padding-bottom: 4px; }
.filter-btn {
  padding: 7px 14px; border-radius: var(--radius-full); font-size: 0.84rem; font-weight: 500;
  border: 2px solid var(--light-gray); background: white; color: var(--gray);
  transition: all var(--transition); cursor: pointer; white-space: nowrap; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.filter-btn:hover, .filter-btn.active { border-color: var(--primary); background: var(--primary); color: white; }
.works-masonry { -webkit-columns: 1; columns: 1; gap: 14px; }
.work-item { -webkit-column-break-inside: avoid; break-inside: avoid; margin-bottom: 14px; position: relative; border-radius: var(--radius-md); overflow: hidden; cursor: pointer; }
.work-item img { width: 100%; display: block; transition: transform 0.4s ease; }
.work-item:hover img { transform: scale(1.05); }
.work-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,90,74,0.9) 0%, transparent 55%);
  opacity: 0; transition: opacity var(--transition);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 14px;
}
.work-item:hover .work-overlay { opacity: 1; }
.work-overlay .wo-tag { background: var(--accent); color: white; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; width: -webkit-fit-content; width: fit-content; margin-bottom: 5px; }
.work-overlay h4   { color: white; font-size: 0.88rem; margin-bottom: 3px; }
.work-overlay span { color: rgba(255,255,255,0.7); font-size: 0.78rem; }

/* ── TENDERS PAGE ────────────────────────────────────────────── */
.tender-card {
  background: white; border-radius: var(--radius-md); padding: 16px;
  border: 1px solid var(--light-gray); display: flex; flex-direction: column;
  gap: 12px; transition: all var(--transition); margin-bottom: 12px;
}
.tender-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.tender-icon-wrap { width: 44px; height: 44px; background: var(--primary-light); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.tender-body { flex: 1; min-width: 0; }
.tender-body h4 { font-size: 0.9rem; margin-bottom: 5px; }
.tender-body p  { font-size: 0.84rem; margin-bottom: 10px; }
.tender-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tender-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 600; }
.tender-open   { background: #DCFCE7; color: #15803D; }
.tender-closed { background: #FEE2E2; color: #DC2626; }
.tender-pending{ background: #FEF9C3; color: #A16207; }
.tender-actions { display: flex; flex-direction: row; gap: 8px; flex-wrap: wrap; align-items: flex-start; }

/* ── BLOG ────────────────────────────────────────────────────── */
.blog-featured {
  display: flex; flex-direction: column;
  background: white; border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--light-gray); margin-bottom: 28px; transition: all var(--transition);
  text-decoration: none;
}
.blog-featured:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.blog-featured img { width: 100%; height: 210px; object-fit: cover; display: block; }
.blog-featured-body { padding: 20px 22px; display: flex; flex-direction: column; justify-content: center; }
.blog-featured-body h2 { font-size: 1.15rem; margin: 8px 0 10px; }
.blog-featured-body p  { color: var(--gray); line-height: 1.7; margin-bottom: 16px; font-size: 0.9rem; }
.blog-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.blog-card { background: white; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--light-gray); transition: all var(--transition); display: flex; flex-direction: column; }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.blog-card .blog-img { height: 180px; overflow: hidden; flex-shrink: 0; }
.blog-card .blog-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; display: block; }
.blog-card:hover .blog-img img { transform: scale(1.06); }
.blog-card .blog-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.blog-cat { display: inline-block; background: var(--primary-light); color: var(--primary); padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; margin-bottom: 8px; }
.blog-card h4 { font-size: 0.95rem; margin-bottom: 6px; line-height: 1.4; flex: 1; }
.blog-card p  { font-size: 0.84rem; margin-bottom: 12px; }
.blog-meta { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--gray); padding-top: 12px; border-top: 1px solid var(--light-gray); flex-wrap: wrap; margin-top: auto; }
.blog-meta .author { display: flex; align-items: center; gap: 5px; }
.blog-meta .author img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

/* ── CONTACT ─────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.contact-info { display: flex; flex-direction: column; gap: 12px; }
.contact-info-card { background: white; border-radius: var(--radius-md); padding: 16px; border: 1px solid var(--light-gray); display: flex; gap: 14px; align-items: flex-start; }
.contact-info-card .ci2-icon { width: 40px; height: 40px; background: var(--primary-light); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--primary); flex-shrink: 0; }
.contact-info-card h4 { font-size: 0.875rem; font-weight: 600; margin-bottom: 3px; }
.contact-info-card p  { font-size: 0.84rem; }
.contact-form-main { background: white; border-radius: var(--radius-md); padding: 20px; border: 1px solid var(--light-gray); }
.contact-form-main h3 { font-size: 1.05rem; margin-bottom: 16px; }
.form-row   { display: grid; grid-template-columns: 1fr; gap: 0; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 5px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm); font-size: 0.875rem; color: var(--dark);
  background: white; transition: border-color var(--transition); resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(94,111,94,0.12); }

/* Newsletter */
.newsletter-wrap { display: flex; max-width: 480px; margin: 0 auto; gap: 10px; flex-wrap: wrap; }
.newsletter-wrap input {
  flex: 1; padding: 13px 18px; border-radius: 8px; border: none;
  font-size: 0.9rem; min-width: 180px; font-family: inherit;
}

/* ── AZIENDA – TIMELINE ─────────────────────────────────────── */
.timeline { max-width: 680px; margin: 0 auto; position: relative; }
.timeline::before { content: ''; position: absolute; left: 22px; top: 0; bottom: 0; width: 2px; background: var(--light-gray); }
.timeline-item { display: flex; gap: 16px; margin-bottom: 24px; align-items: flex-start; position: relative; }
.timeline-dot {
  width: 44px; height: 44px; background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.72rem;
  flex-shrink: 0; z-index: 1; border: 3px solid white;
  box-shadow: 0 0 0 3px var(--primary-light);
}
.timeline-body { padding-top: 8px; flex: 1; }
.timeline-year { font-weight: 700; color: var(--primary); font-size: 1rem; margin-bottom: 3px; }
.timeline-text { font-size: 0.875rem; color: var(--gray); }

/* Timeline centrata (azienda page) – su mobile diventa verticale lineare */
.timeline-center { position: relative; max-width: 700px; margin: 0 auto; }
.timeline-center::before { content: ''; position: absolute; left: 22px; top: 0; bottom: 0; width: 2px; background: var(--light-gray); }
.timeline-center .tc-item { display: flex; gap: 16px; margin-bottom: 28px; align-items: flex-start; position: relative; }
.timeline-center .tc-dot {
  width: 44px; height: 44px; background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.8rem;
  flex-shrink: 0; z-index: 1; border: 3px solid white;
  box-shadow: 0 0 0 3px var(--primary-light);
}
.timeline-center .tc-body { padding-top: 8px; flex: 1; }
.timeline-center .tc-year { font-weight: 700; color: var(--primary); font-size: 1rem; }
.timeline-center .tc-text { font-size: 0.875rem; color: var(--gray); margin-top: 3px; }

/* ── MISC ────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--light-gray); margin: 20px 0; }
.badge-accent  { background: var(--accent-light); color: var(--accent); padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.78rem; font-weight: 600; }
.badge-primary { background: var(--primary-light); color: var(--primary); padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.78rem; font-weight: 600; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ── ADMIN PANEL ─────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; position: relative; }

/* Sidebar */
.admin-sidebar {
  background: var(--dark); display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
  z-index: 1001; overflow-y: auto; -webkit-overflow-scrolling: touch;
  transform: translateX(-100%); transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}
.admin-sidebar.open { transform: translateX(0); }
.admin-sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; }
.admin-sidebar-overlay.open { display: block; }
.admin-sidebar-logo { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.admin-logo-img { max-height: 40px; max-width: 130px; object-fit: contain; }
.admin-sidebar-close { background: rgba(255,255,255,0.1); border: none; color: white; width: 30px; height: 30px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.9rem; flex-shrink: 0; transition: background var(--transition); }
.admin-sidebar-close:hover { background: rgba(255,255,255,0.2); }
.sidebar-nav { padding: 8px; flex: 1; }
.sidebar-section-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #4B5563; padding: 10px 10px 5px; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: #9CA3AF; font-size: 0.875rem; transition: all var(--transition); margin-bottom: 2px; -webkit-tap-highlight-color: transparent; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(94,111,94,0.18); color: var(--primary); }
.sidebar-nav a .nav-icon { font-size: 0.95rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-nav a .nav-badge { margin-left: auto; background: var(--primary); color: white; padding: 2px 7px; border-radius: var(--radius-full); font-size: 0.65rem; font-weight: 600; }

/* Admin main */
.admin-main { flex: 1; background: #F1F5F9; display: flex; flex-direction: column; min-width: 0; width: 100%; }

/* Topbar */
.admin-topbar { background: white; padding: 0 16px; height: 56px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--light-gray); position: sticky; top: 0; z-index: 100; gap: 12px; }
.admin-topbar h1 { font-size: 0.95rem; font-weight: 600; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.admin-hamburger { display: flex; flex-direction: column; gap: 4px; background: var(--bg); border: 1px solid var(--light-gray); padding: 7px; border-radius: var(--radius-sm); cursor: pointer; flex-shrink: 0; }
.admin-hamburger span { display: block; width: 18px; height: 2px; background: var(--dark); border-radius: 2px; }
.admin-avatar { width: 34px; height: 34px; background: var(--primary); border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; font-size: 0.82rem; cursor: pointer; flex-shrink: 0; }
.admin-brand-name { font-size: 0.8rem; font-weight: 600; color: var(--dark); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Content */
.admin-content { padding: 14px; flex: 1; }

/* Stat cards */
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-card { background: white; border-radius: var(--radius-md); padding: 14px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--light-gray); transition: all var(--transition); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon { width: 42px; height: 42px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.stat-icon-green  { background: var(--primary-light); color: var(--primary); }
.stat-icon-blue   { background: #EFF6FF; color: #2563EB; }
.stat-icon-orange { background: var(--accent-light); color: var(--accent); }
.stat-icon-purple { background: #F5F3FF; color: #7C3AED; }
.stat-info .si-value { font-size: 1.3rem; font-weight: 700; color: var(--dark); line-height: 1; margin-bottom: 3px; }
.stat-info .si-label { font-size: 0.72rem; color: var(--gray); }
.stat-info .si-trend { font-size: 0.68rem; color: #15803D; font-weight: 600; }
.stat-info .si-trend.down { color: #DC2626; }

/* Admin card */
.admin-card { background: white; border-radius: var(--radius-md); border: 1px solid var(--light-gray); overflow: hidden; margin-bottom: 16px; }
.admin-card-header { padding: 12px 16px; border-bottom: 1px solid var(--light-gray); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.admin-card-header h3 { font-size: 0.9rem; color: var(--dark); font-weight: 600; }

/* Table */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 10px 12px; text-align: left; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray); background: var(--bg); border-bottom: 1px solid var(--light-gray); white-space: nowrap; }
.admin-table td { padding: 10px 12px; font-size: 0.84rem; color: var(--dark); border-bottom: 1px solid var(--light-gray); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }

/* ── RESPONSIVE TABLE → CARD (mobile < 768px) ───────────────── */
@media (max-width: 767px) {
  /* Nasconde lo thead – le etichette le mostriamo via data-label */
  .admin-table thead { display: none; }

  /* Ogni riga diventa un blocco card */
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
    display: block;
    width: 100%;
  }
  .admin-table tr {
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    background: white;
    overflow: hidden;
  }
  .admin-table tr:hover td { background: white; }
  .admin-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--light-gray);
    font-size: 0.83rem;
    text-align: right;
    min-height: 38px;
  }
  .admin-table td:last-child { border-bottom: none; }

  /* Etichetta a sinistra generata dal data-label */
  .admin-table td[data-label]::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray);
    white-space: nowrap;
    flex-shrink: 0;
    text-align: left;
  }
  /* Prima cella (titolo/nome) – occupa tutta la larghezza */
  .admin-table td.td-main {
    justify-content: flex-start;
    background: var(--bg);
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
  }
  .admin-table td.td-main::before { display: none; }
  /* Cella azioni: centrata */
  .admin-table td.td-actions {
    justify-content: flex-end;
    background: var(--bg);
  }
  .admin-table td.td-actions::before { display: none; }
  /* Elimina il wrapper overflow-x su mobile */
  .table-responsive { overflow-x: visible; }
}
.table-avatar { width: 28px; height: 28px; border-radius: var(--radius-full); object-fit: cover; }
.table-actions { display: flex; gap: 4px; }
.ta-btn { padding: 5px 10px; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all var(--transition); border: none; }
.ta-edit   { background: var(--primary-light); color: var(--primary); }
.ta-edit:hover { background: var(--primary); color: white; }
.ta-delete { background: #FEE2E2; color: #DC2626; }
.ta-delete:hover { background: #DC2626; color: white; }
.ta-view   { background: #EFF6FF; color: #2563EB; }
.ta-view:hover { background: #2563EB; color: white; }
.status-badge { display: inline-flex; padding: 3px 8px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.sb-green  { background: #DCFCE7; color: #15803D; }
.sb-red    { background: #FEE2E2; color: #DC2626; }
.sb-yellow { background: #FEF9C3; color: #A16207; }
.sb-blue   { background: #EFF6FF; color: #2563EB; }
.sb-gray   { background: #F3F4F6; color: #6B7280; }

/* Admin form */
.admin-form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.admin-form-group { margin-bottom: 0; }
.admin-form-group label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 5px; }
.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm); font-size: 0.875rem; color: var(--dark);
  background: white; transition: border-color var(--transition); resize: vertical;
}
.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(94,111,94,0.08); }
.admin-form-full { grid-column: 1 / -1; }

/* Dashboard grid */
.admin-dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }

/* Chart */
.chart-placeholder { height: 150px; background: var(--bg); border-radius: var(--radius-sm); display: flex; align-items: flex-end; gap: 4px; padding: 12px; overflow: hidden; }
.chart-bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; opacity: 0.7; transition: opacity var(--transition); min-width: 0; }
.chart-bar:hover { opacity: 1; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 2000; display: none; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: var(--radius-lg); padding: 20px; max-width: 540px; width: 100%; position: relative; box-shadow: var(--shadow-lg); animation: modalIn 0.25s ease; margin: auto; }
.modal-close { position: absolute; top: 12px; right: 12px; background: var(--bg); border: none; width: 30px; height: 30px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.9rem; color: var(--gray); transition: all var(--transition); }
.modal-close:hover { background: var(--light-gray); color: var(--dark); }
.modal h2 { font-size: 1.05rem; margin-bottom: 14px; padding-right: 28px; }

/* Toast */
#toast { position: fixed; bottom: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: calc(100vw - 32px); }
.toast-item { background: var(--dark); color: white; padding: 10px 14px; border-radius: var(--radius-md); font-size: 0.84rem; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease; pointer-events: all; max-width: 300px; word-break: break-word; }
.toast-item.success { border-left: 4px solid var(--primary); }
.toast-item.error   { border-left: 4px solid #DC2626; }
.toast-item.info    { border-left: 4px solid #2563EB; }

/* Admin body */
body[data-admin-page] { padding-bottom: 0; background: #F1F5F9; }

/* ── ADMIN RESPONSIVE UTILITIES ─────────────────────────────── */

/* Barra filtri: su mobile stack verticale, su tablet+ inline */
.admin-filters-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.admin-filters-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
/* Input e select filtri: full-width su mobile, auto su tablet */
.admin-filter-input,
.admin-filter-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: white;
  color: var(--dark);
  -webkit-appearance: none;
  appearance: none;
}
.admin-filters-bar > .btn,
.admin-filters-bar > button {
  flex-shrink: 0;
  width: 100%;
}

/* Layout form+lista (professionisti / certificazioni):
   colonna singola su mobile, 2 colonne su 768px+ */
.admin-form-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

/* Grid inline a 2 colonne: 1 col su mobile, 2 col su 480px+ */
.admin-inline-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Stat cards 3 colonne: adatta come le 4 colonne */
.stat-cards-3 { grid-template-columns: repeat(2, 1fr); }

/* Settings grid: 1 col su mobile, 2 col su 768px+ */
.admin-settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* Welcome banner: padding ridotto su mobile */
.admin-welcome-banner h2 { font-size: clamp(0.95rem, 3vw, 1.25rem) !important; }
.admin-welcome-banner p  { font-size: 0.85rem; }

/* ── MEDIA CARD (admin) ──────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.media-item { position: relative; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 1; background: var(--bg); border: 1px solid var(--light-gray); }
.media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px; }
.media-item:hover .media-item-overlay { opacity: 1; }

/* ── PROFESSIONISTI ADMIN (cards) ───────────────────────────── */
.prof-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.prof-card { background: white; border-radius: var(--radius-md); padding: 16px; border: 1px solid var(--light-gray); display: flex; gap: 14px; align-items: flex-start; transition: all var(--transition); }
.prof-card:hover { box-shadow: var(--shadow-md); }
.prof-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary-light); flex-shrink: 0; }
.prof-info { flex: 1; min-width: 0; }
.prof-info h4 { font-size: 0.9rem; margin-bottom: 3px; }
.prof-info .prof-role { font-size: 0.78rem; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.prof-info p { font-size: 0.8rem; color: var(--gray); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prof-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── CERTIFICAZIONI ADMIN ───────────────────────────────────── */
.cert-admin-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.cert-admin-card { background: white; border-radius: var(--radius-md); padding: 16px; border: 1px solid var(--light-gray); transition: all var(--transition); }
.cert-admin-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.cert-admin-card .ca-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.cert-admin-card .ca-icon { width: 44px; height: 44px; background: var(--primary-light); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.cert-admin-card .ca-title h4 { font-size: 0.9rem; margin-bottom: 3px; }
.cert-admin-card .ca-title p { font-size: 0.78rem; }
.cert-admin-card .ca-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes bounce   { 0%, 100% { transform: translateX(-50%) translateY(0); }    50% { transform: translateX(-50%) translateY(8px); } }
@keyframes slideIn  { from { opacity: 0; transform: translateX(20px); }  to { opacity: 1; transform: translateX(0); } }
@keyframes modalIn  { from { opacity: 0; transform: scale(0.96) translateY(-8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(20px); }  to { opacity: 1; transform: translateY(0); } }
.animate-fadeup { animation: fadeUp 0.5s ease forwards; }

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--light-gray); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray); }

/* ══════════════════════════════════════════════════════════════
   ADMIN INLINE: 480px+ (grid 2 col in modali/form)
══════════════════════════════════════════════════════════════ */
@media (min-width: 480px) {
  .admin-inline-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════════
   SMALL MOBILE: 375px+ (fix per iphone SE e simili)
══════════════════════════════════════════════════════════════ */
@media (min-width: 375px) {
  .hero-stat .num { font-size: 1.45rem; }
  .hero-btns { gap: 10px; }
  .hero-btns .btn-lg { padding: 11px 20px; font-size: 0.88rem; }
}

/* ══════════════════════════════════════════════════════════════
   TABLET: 640px+
══════════════════════════════════════════════════════════════ */
@media (min-width: 640px) {
  :root { --navbar-h: 64px; }
  .container  { padding: 0 24px; }
  .section    { padding: 60px 0; }
  .section-sm { padding: 36px 0; }

  /* Grids */
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  /* Hero */
  .hero-stat .num { font-size: 1.65rem; }
  .hero-scroll    { display: flex; }
  .hero p         { font-size: 1rem; }
  .hero-content   { padding: 40px 0 90px; }
  .hero-stats     { gap: 24px; }

  /* Page hero */
  .page-hero { min-height: 320px; }
  .page-hero .container { padding: 90px 24px 52px; }

  /* Section header */
  .section-header { margin-bottom: 40px; }

  /* Cards */
  .cert-grid   { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .blog-grid   { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .props-grid  { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }

  /* Blog featured */
  .blog-featured { flex-direction: row; }
  .blog-featured img { width: 42%; height: auto; min-height: 240px; flex-shrink: 0; object-fit: cover; }
  .blog-featured-body { padding: 26px 28px; }
  .blog-featured-body h2 { font-size: 1.35rem; }

  /* Masonry 2 cols */
  .masonry-grid, .works-masonry { -webkit-columns: 2; columns: 2; gap: 16px; }

  /* Tender */
  .tender-card { flex-direction: row; }
  .tender-actions { flex-direction: column; align-items: flex-end; flex-shrink: 0; }

  /* Contact */
  .form-row { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  /* Footer */
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }

  /* Property */
  .prop-gallery .main-img { height: 300px; }
  .prop-detail-grid { grid-template-columns: 1fr; }

  /* Admin */
  .admin-content   { padding: 20px; }
  .admin-form-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .stat-cards      { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .media-grid      { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .prof-grid       { grid-template-columns: repeat(2, 1fr); }
  .cert-admin-grid { grid-template-columns: repeat(2, 1fr); }

  /* Admin responsive utilities */
  .admin-filter-input,
  .admin-filter-select { width: auto; min-width: 160px; flex: 1; }
  .admin-filters-bar > .btn,
  .admin-filters-bar > button { width: auto; }
  .admin-inline-grid { grid-template-columns: repeat(2, 1fr); }

  /* Business card grid */
  .bc-admin-grid { grid-template-columns: repeat(2, 1fr); }

  /* Newsletter */
  .newsletter-wrap { flex-wrap: nowrap; }

  /* CTA */
  .cta-btns { gap: 14px; }

  /* Sticky CTA hidden on tablet+ */
  .sticky-cta { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   DESKTOP: 1024px+
══════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  :root { --navbar-h: 72px; }
  .container  { padding: 0 32px; }
  .section    { padding: 80px 0; }
  .section-sm { padding: 44px 0; }

  /* Grids */
  .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); gap: 24px; }

  /* Navbar – desktop */
  .navbar-inner      { height: var(--navbar-h); padding: 0 32px; }
  .navbar-menu       { display: flex; align-items: center; gap: 2px; }
  .navbar-menu a     { padding: 8px 12px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; color: var(--dark); transition: all var(--transition); white-space: nowrap; }
  .navbar-menu a:hover, .navbar-menu a.active { background: var(--primary-light); color: var(--primary); }
  .navbar-cta        { display: flex; align-items: center; gap: 8px; }
  .navbar-hamburger  { display: none; }
  .mobile-menu       { display: none !important; }
  .sticky-cta        { display: none; }

  /* Hero */
  .hero-content { padding: 48px 0 100px; }
  .hero p { font-size: 1.05rem; }
  .hero-stat .num { font-size: 2rem; }
  .hero-stats { gap: 36px; }

  /* Page hero */
  .page-hero { min-height: 380px; }
  .page-hero .container { padding: 110px 32px 64px; }

  /* Footer */
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 48px; }
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }

  /* Properties */
  .props-layout  { grid-template-columns: 240px 1fr; gap: 28px; }
  .filters-panel { position: sticky; top: calc(var(--navbar-h) + 16px); }
  .props-grid    { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

  /* Property detail */
  .prop-detail-grid { grid-template-columns: 1fr 320px; gap: 28px; }
  .prop-gallery .main-img { height: 380px; }
  .prop-info-panel { position: sticky; top: calc(var(--navbar-h) + 16px); }

  /* Masonry 3 cols */
  .masonry-grid, .works-masonry { -webkit-columns: 3; columns: 3; gap: 18px; }

  /* Services */
  .services-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; }

  /* Blog */
  .blog-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr 1.5fr; gap: 48px; }
  .contact-form-main { padding: 32px; }

  /* Energy */
  .energy-content { grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }

  /* Cert */
  .cert-grid     { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .section-header { margin-bottom: 52px; }

  /* Admin sidebar always visible */
  .admin-sidebar { position: sticky; transform: translateX(0); width: var(--sidebar-width); min-height: 100vh; box-shadow: none; }
  .admin-sidebar-close   { display: none; }
  .admin-sidebar-overlay { display: none !important; }
  .admin-hamburger       { display: none; }
  .admin-content         { padding: 28px; }
  .admin-topbar          { height: 64px; padding: 0 28px; }
  .admin-topbar h1       { font-size: 1.1rem; }
  .stat-cards            { grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
  .stat-cards-3          { grid-template-columns: repeat(3, 1fr); }
  .stat-card             { padding: 20px; gap: 14px; }
  .stat-icon             { width: 48px; height: 48px; font-size: 1.3rem; }
  .stat-info .si-value   { font-size: 1.55rem; }
  .admin-table           { min-width: unset; }
  .admin-dashboard-grid  { grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 24px; }
  .chart-placeholder     { height: 180px; }
  .media-grid            { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .prof-grid             { grid-template-columns: repeat(3, 1fr); }
  .cert-admin-grid       { grid-template-columns: repeat(3, 1fr); }

  /* Admin form layout + settings 2 cols */
  .admin-form-layout     { grid-template-columns: 1fr 1fr; gap: 24px; }
  .admin-settings-grid   { grid-template-columns: 1fr 1fr; gap: 24px; }
  .admin-welcome-banner  { padding: 28px 32px; }

  /* Business card grid 3 col desktop */
  .bc-admin-grid         { grid-template-columns: repeat(3, 1fr); }

  /* Timeline centrata (desktop: alterna sinistra/destra) */
  .timeline-center::before { left: 50%; }
  .timeline-center .tc-item {
    width: 50%; margin-bottom: 32px;
  }
  .timeline-center .tc-item:nth-child(odd)  { margin-left: 0; flex-direction: row; }
  .timeline-center .tc-item:nth-child(even) { margin-left: 50%; flex-direction: row-reverse; }
}

/* ══════════════════════════════════════════════════════════════
   WIDE: 1280px+
══════════════════════════════════════════════════════════════ */
@media (min-width: 1280px) {
  .container { padding: 0 24px; }
  .navbar-menu a { padding: 8px 14px; font-size: 0.9rem; }
  .grid-4 { gap: 28px; }
  .admin-content { padding: 32px; }
  .prop-detail-grid { grid-template-columns: 1fr 360px; gap: 32px; }
  .prop-gallery .main-img { height: 420px; }
}

/* ══════════════════════════════════════════════════════════════
   EXTRA WIDE: 1536px+
══════════════════════════════════════════════════════════════ */
@media (min-width: 1536px) {
  :root { --max-width: 1400px; }
  .container { padding: 0 40px; }
}

/* ── TOUCH DEVICES ───────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Show overlays on touch without hover */
  .card-project .overlay { opacity: 1; background: linear-gradient(to top, rgba(20,90,74,0.80) 0%, transparent 55%); }
  .work-overlay { opacity: 1; background: linear-gradient(to top, rgba(20,90,74,0.80) 0%, transparent 50%); }
  /* Larger tap targets */
  .btn { padding: 12px 22px; }
  .btn-sm { padding: 9px 16px; }
  .ta-btn { padding: 7px 12px; }
  .sidebar-nav a { padding: 12px 14px; }
  .mobile-menu a { padding: 14px; }
  /* Disable hover transforms */
  .card-service:hover, .card-property:hover, .blog-card:hover,
  .cert-card:hover, .service-detail-card:hover { transform: none; }
}

/* ── PRINT ───────────────────────────────────────────────────── */
@media print {
  #navbar, #footer, .sticky-cta, #cta-section, .admin-sidebar, .mobile-menu, .hero-scroll, .cta-btns { display: none !important; }
  body   { padding-top: 0; background: white; color: black; }
  .hero  { min-height: auto; padding: 40px 0; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.7em; }
  .container { max-width: 100%; padding: 0 12px; }
}

/* ── HIGH CONTRAST / ACCESSIBILITY ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .hero-scroll { display: none !important; }
}
@media (prefers-color-scheme: dark) {
  /* Minimal dark mode hint - mantiene brand colors */
  body[data-admin-page] .admin-main { background: #1a1f2e; }
}
