* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #eaf3fb;
  color: #333;
  min-height: 100vh;
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #d0e3f3;
  margin-bottom: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
}

.header-title {
  display: flex;
  flex-direction: column;
}

.header-title strong {
  font-size: 15px;
  color: #1a3a5c;
  letter-spacing: 0.5px;
}

.header-title span {
  font-size: 11px;
  color: #5a8ab5;
}

.nav-tabs {
  display: flex;
  gap: 4px;
}

.tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  color: #4a7a9b;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab.active {
  color: #0d6ebd;
  border-bottom-color: #0d6ebd;
}

.tab:hover:not(.active) {
  color: #1a5a8a;
  border-bottom-color: #b0d4f1;
}

.btn-admin {
  padding: 8px 20px;
  background: #fff;
  color: #1a3a5c;
  border: 2px solid #1a3a5c;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  border-radius: 4px;
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn-admin:hover {
  background: #1a3a5c;
  color: #fff;
}

.btn-admin.logged-in {
  background: #0d6ebd;
  color: #fff;
  border-color: #0d6ebd;
}

/* Social icons */
.header-social {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-social a {
  color: #1a3a5c;
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
}

.header-social a:hover {
  color: #0d6ebd;
  transform: scale(1.15);
}

/* ===== HERO ===== */
.hero {
  border-radius: 16px;
  padding: 60px 45px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  position: relative;
  overflow: hidden;
  background: url('/hero-bg.webp') center/cover no-repeat;
  min-height: 280px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(20, 50, 80, 0.55);
  pointer-events: none;
}

.hero-text {
  position: relative;
  z-index: 1;
  max-width: 450px;
}

.hero-text h1 {
  font-size: 30px;
  margin-bottom: 12px;
  font-weight: 700;
}

.hero-text p {
  font-size: 16px;
  opacity: 0.9;
  line-height: 1.5;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 11px 24px;
  background: #fff;
  color: #1a3a5c;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-hero:hover {
  background: #eaf3fb;
  transform: translateY(-2px);
}

.hero-logo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  position: relative;
  z-index: 1;
}

/* Hero small variant for inner sections */
.hero.hero-small {
  padding: 30px 40px;
  min-height: 120px;
  margin-bottom: 24px;
}

.hero.hero-small h1 {
  font-size: 24px;
}

.hero.hero-small .hero-logo {
  width: 80px;
  height: 80px;
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.dashboard-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.dashboard-card h3 {
  font-size: 17px;
  color: #1a3a5c;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dashboard news items */
.dash-news-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f4f8;
  cursor: pointer;
  transition: background 0.2s;
}

.dash-news-item:last-child {
  border-bottom: none;
}

.dash-news-item:hover {
  background: #f8fbfe;
  border-radius: 8px;
  padding-left: 8px;
}

.dash-news-img {
  width: 70px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.dash-news-info {
  flex: 1;
}

.dash-news-date {
  font-size: 11px;
  color: #0d6ebd;
  font-weight: 600;
}

.dash-news-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 2px 0;
}

.dash-news-desc {
  font-size: 12px;
  color: #777;
}

.dash-news-arrow {
  color: #0d6ebd;
  font-size: 18px;
}

/* Dashboard photos */
.dash-photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-photos img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

/* Dashboard docs */
.dash-doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f4f8;
}

.dash-doc-item:last-child {
  border-bottom: none;
}

.dash-doc-icon {
  width: 36px;
  height: 36px;
  background: #fdeaea;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.dash-doc-info {
  flex: 1;
}

.dash-doc-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.dash-doc-size {
  font-size: 11px;
  color: #999;
}

.dash-doc-download {
  color: #0d6ebd;
  text-decoration: none;
  font-size: 16px;
}

.link-more {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: #0d6ebd;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

.link-more:hover {
  text-decoration: underline;
}

/* ===== CONTENT ===== */
#content {
  min-height: 400px;
  padding: 24px 0;
}

/* ===== NEWS GRID ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.news-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.news-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.news-card-body {
  padding: 16px 20px;
}

.news-card .news-date {
  font-size: 12px;
  color: #0d6ebd;
  font-weight: 600;
  margin-bottom: 4px;
}

.news-card .news-title {
  font-weight: 600;
  font-size: 17px;
  color: #1a3a5c;
}

/* ===== NEWS DETAIL ===== */
.news-detail {
  background: #fff;
  border-radius: 12px;
  padding: 35px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.news-detail h1 {
  margin-bottom: 20px;
  font-size: 26px;
  color: #1a3a5c;
}

.news-detail img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 20px;
}

.news-detail .description {
  line-height: 1.7;
  font-size: 16px;
  color: #444;
  white-space: pre-wrap;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 8px 18px;
  background: #0d6ebd;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.btn-back:hover {
  background: #0a5a9e;
}

/* ===== PHOTOGALLERY ===== */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.folder-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.folder-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.folder-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.folder-card-noimg {
  width: 100%;
  height: 200px;
  background: #e0eef8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.folder-card-body {
  padding: 14px 18px;
}

.folder-card-name {
  font-weight: 600;
  font-size: 16px;
  color: #1a3a5c;
}

.folder-card-count {
  font-size: 12px;
  color: #5a8ab5;
  margin-top: 3px;
}

.folders-list {
  list-style: none;
}

.folders-list li {
  padding: 16px 20px;
  background: #fff;
  margin-bottom: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  color: #1a3a5c;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.folders-list li:hover {
  background: #f0f8ff;
  transform: translateX(4px);
}

.folders-list li::before {
  content: "📁";
  font-size: 20px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.photo-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.photo-grid img:hover {
  transform: scale(1.03);
}

/* ===== REELS ===== */
.reels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.reel-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.reel-card video {
  width: 100%;
  height: 250px;
  object-fit: cover;
  background: #000;
}

.reel-card-body {
  padding: 14px 18px;
}

.reel-title {
  font-weight: 600;
  font-size: 16px;
  color: #1a3a5c;
}

.reel-date {
  font-size: 12px;
  color: #5a8ab5;
  margin-top: 4px;
}

/* ===== DOCUMENTS ===== */
.documents-list {
  list-style: none;
}

.documents-list li {
  padding: 16px 20px;
  background: #fff;
  margin-bottom: 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.documents-list li .doc-name {
  font-weight: 600;
  font-size: 15px;
  color: #1a3a5c;
}

.documents-list li .doc-name::before {
  content: "📄 ";
}

.doc-actions a {
  padding: 7px 14px;
  background: #0d6ebd;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  margin-left: 8px;
  font-weight: 600;
}

.doc-actions a:hover {
  background: #0a5a9e;
}

.doc-actions a.download-btn {
  background: #27ae60;
}

.doc-actions a.download-btn:hover {
  background: #1e8e4e;
}

/* ===== CHI SIAMO ===== */
.chi-siamo {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chi-siamo h1 {
  color: #1a3a5c;
  margin-bottom: 20px;
}

.chi-siamo p {
  line-height: 1.8;
  font-size: 16px;
  color: #444;
  margin-bottom: 14px;
}

/* ===== CONTATTI ===== */
.contatti {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.contatti h1 {
  color: #1a3a5c;
  margin-bottom: 24px;
}

.contatti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.contatto-card {
  background: #f8fbfe;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #e0eef8;
}

.contatto-card h3 {
  color: #1a3a5c;
  margin-bottom: 10px;
}

.contatto-card p {
  font-size: 14px;
  color: #555;
  margin: 5px 0;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  padding: 40px;
  border-radius: 14px;
  width: 380px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-content h2 {
  margin-bottom: 20px;
  text-align: center;
  color: #1a3a5c;
}

.modal-content input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 2px solid #e0eef8;
  border-radius: 8px;
  font-size: 14px;
}

.modal-content input:focus {
  outline: none;
  border-color: #0d6ebd;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #0d6ebd;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
}

.btn-primary:hover {
  background: #0a5a9e;
}

.btn-close {
  position: absolute;
  top: 12px;
  right: 18px;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #999;
}

.error {
  color: #e74c3c;
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
}

.hidden {
  display: none;
}

/* ===== ADMIN PANEL ===== */
.admin-panel {
  background: #fff;
  border-radius: 12px;
  padding: 35px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-panel h2 {
  margin-bottom: 20px;
  color: #1a3a5c;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid #eaf3fb;
  padding-bottom: 0;
  flex-wrap: wrap;
}

.admin-tab {
  padding: 10px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #4a7a9b;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  margin-bottom: -2px;
}

.admin-tab.active {
  color: #0d6ebd;
  border-bottom-color: #0d6ebd;
}

.admin-tab:hover:not(.active) {
  color: #1a5a8a;
  border-bottom-color: #b0d4f1;
}

.admin-section {
  margin-bottom: 28px;
  padding: 20px;
  background: #f8fbfe;
  border-radius: 10px;
  border: 1px solid #e0eef8;
}

.admin-section h3 {
  margin-bottom: 14px;
  color: #1a3a5c;
  font-size: 16px;
}

.admin-section input[type="text"],
.admin-section textarea,
.admin-section select {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 10px;
  border: 2px solid #e0eef8;
  border-radius: 8px;
  font-size: 14px;
}

.admin-section input[type="text"]:focus,
.admin-section textarea:focus,
.admin-section select:focus {
  outline: none;
  border-color: #0d6ebd;
}

.admin-section textarea {
  height: 100px;
  resize: vertical;
}

.admin-section input[type="file"] {
  margin-bottom: 10px;
}

.admin-section input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 10px;
  border: 2px solid #e0eef8;
  border-radius: 8px;
  font-size: 14px;
}

.admin-section input[type="password"]:focus {
  outline: none;
  border-color: #0d6ebd;
}

.btn-submit {
  padding: 10px 24px;
  background: #0d6ebd;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
}

.btn-submit:hover {
  background: #0a5a9e;
}

.success-msg {
  color: #27ae60;
  font-weight: bold;
  margin-top: 10px;
  display: none;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e0eef8;
  border-radius: 8px;
  margin-bottom: 8px;
}

.admin-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
}

.admin-item-actions {
  display: flex;
  gap: 8px;
}

.btn-edit {
  padding: 6px 12px;
  background: #0d6ebd;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.btn-edit:hover {
  background: #0a5a9e;
}

.btn-delete {
  padding: 6px 12px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.btn-delete:hover {
  background: #c0392b;
}

.error-msg {
  color: #e74c3c;
  font-weight: bold;
  margin-top: 10px;
  display: none;
  font-size: 13px;
}

.photo-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.photo-admin-item {
  position: relative;
}

.photo-admin-item img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 8px;
}

.btn-delete-photo {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(231, 76, 60, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-delete-photo:hover {
  background: #c0392b;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

/* ===== FOOTER ===== */
.footer {
  margin-top: 40px;
  padding: 18px 0;
  border-top: 1px solid #d0e3f3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #5a8ab5;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-link {
  color: #0d6ebd;
  text-decoration: none;
  cursor: pointer;
}

.footer-link:hover {
  text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .nav-tabs {
    flex-wrap: wrap;
  }
  .tab {
    padding: 6px 10px;
    font-size: 11px;
  }
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 35px 20px;
  }
  .hero-logo {
    width: 110px;
    height: 110px;
    margin-top: 20px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .footer {
    flex-direction: column;
    text-align: center;
  }
}
