/* ==========================================================
   INDICATORI RESTYLED – Main Stylesheet
   Background : #ffffff
   Accent     : #4fa833
   Target     : 1920 × 1080 Full HD, centered
   ========================================================== */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

/* ── Base ── */
body {
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #222222;
    min-height: 100vh;
    max-width: 1920px;
    margin: 0 auto;
}

a { text-decoration: none; color: inherit; }

/* ==========================================================
   HEADER  (present on all non-fullscreen pages)
   ========================================================== */
.site-header {
    background: #4fa833;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 56px;
    height: 88px;
    border-bottom: 4px solid #3d8a28;
}

.site-header h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #ffffff;
}

.site-header .logo {
    height: 60px;
    width: auto;
}

/* ==========================================================
   NAVIGATION PAGE  (index.html)
   ========================================================== */
.nav-wrapper {
    max-width: 780px;
    margin: 64px auto;
    padding: 0 48px;
}

.nav-instruction {
    font-size: 17px;
    color: #666;
    line-height: 1.6;
    padding-bottom: 24px;
    border-bottom: 2px solid #e8f5e2;
    margin-bottom: 40px;
}

.nav-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nav-items a {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 20px;
    font-weight: 500;
    padding: 20px 28px;
    border-radius: 6px;
    border: 1.5px solid #d4edd0;
    background: #fff;
    color: #222;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.nav-items a:hover {
    border-color: #4fa833;
    background: #f4fcf1;
    color: #3d8a28;
}

.nav-arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2.5px solid #4fa833;
    border-bottom: 2.5px solid #4fa833;
    transform: rotate(-45deg);
    flex-shrink: 0;
    margin-top: -2px;
}

.nav-divider {
    height: 1px;
    background: #e8f5e2;
    margin: 28px 0;
}

.nav-link-overview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 20px;
    font-weight: 600;
    padding: 20px 28px;
    border-radius: 6px;
    background: #4fa833;
    color: #fff;
    transition: background 0.15s;
}

.nav-link-overview:hover { background: #3d8a28; }

.nav-arrow-white {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(-45deg);
    flex-shrink: 0;
    margin-top: -2px;
}

/* ==========================================================
   OVERVIEW DASHBOARD  (index-0.html)
   ========================================================== */
.overview-table {
    width: 100%;
    border-collapse: collapse;
}

.overview-table tr {
    border-bottom: 1px solid #e8f5e2;
}

.overview-table tr:last-child { border-bottom: none; }

.dept-label-cell {
    width: 180px;
    padding: 20px 14px;
    vertical-align: middle;
    border-right: 4px solid #4fa833;
    background: #f8fef6;
    text-align: center;
}

.dept-label-cell a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: inherit;
}

.dept-label-cell a:hover .dept-code { color: #3d8a28; }

.dept-code {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: #4fa833;
    line-height: 1;
}

.dept-name-small {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.dept-img-cell {
    padding: 10px 8px;
    vertical-align: middle;
    text-align: center;
}

.dept-img-cell img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ==========================================================
   INDICATOR DETAIL PAGES  (index-01 through index-04)
   1920×1080 viewport, 50 px safety margin on sides + bottom.
   Header: 88px height + 4px border = 92px.
   Available for content: 1080 - 92 = 988px.
   Padding top 28px + bottom 50px = 78px consumed by padding.
   Grid height: 988 - 78 = 910px.
   ========================================================== */
.indicators-page {
    padding: 28px 50px 50px;          /* sides 50px, bottom 50px safety */
    height: calc(100vh - 92px);       /* fill exactly below header */
    overflow: hidden;
}

.indicators-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 16px;
    height: 100%;
}

.indicators-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    height: 100%;
}

.indicator-card {
    border: 1px solid #e8f5e2;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    min-height: 0;          /* allow grid item to shrink */
}

.indicator-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

/* Quality page: 3 images – calendar left (full height), 2 charts stacked right */
.quality-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    height: 100%;
}

.quality-grid-3 .span-rows {
    grid-row: 1 / -1;   /* calendar spans both rows */
}

/* ==========================================================
   FULL-PAGE CONTENT  (index-05, 06, 08)
   ========================================================== */
.full-page-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 92px);  /* fill viewport below header */
    overflow: hidden;
}

.full-page-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* ==========================================================
   VIDEO PAGE  (index-07)
   ========================================================== */
.video-page {
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-page video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==========================================================
   CSS CAROUSEL  (no JavaScript)
   ========================================================== */
.carousel-wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #111;
    overflow: hidden;
}

.c-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.c-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ── index-20: 21 slides × 20 s = 420 s total ── */
@keyframes cs420 {
    0%      { opacity: 0; }
    0.01%   { opacity: 1; }
    4.52%   { opacity: 1; }
    4.76%   { opacity: 0; }
    100%    { opacity: 0; }
}

.carousel-20 .c-slide:nth-child(1)  { animation: cs420 420s   0s infinite; }
.carousel-20 .c-slide:nth-child(2)  { animation: cs420 420s  20s infinite; }
.carousel-20 .c-slide:nth-child(3)  { animation: cs420 420s  40s infinite; }
.carousel-20 .c-slide:nth-child(4)  { animation: cs420 420s  60s infinite; }
.carousel-20 .c-slide:nth-child(5)  { animation: cs420 420s  80s infinite; }
.carousel-20 .c-slide:nth-child(6)  { animation: cs420 420s 100s infinite; }
.carousel-20 .c-slide:nth-child(7)  { animation: cs420 420s 120s infinite; }
.carousel-20 .c-slide:nth-child(8)  { animation: cs420 420s 140s infinite; }
.carousel-20 .c-slide:nth-child(9)  { animation: cs420 420s 160s infinite; }
.carousel-20 .c-slide:nth-child(10) { animation: cs420 420s 180s infinite; }
.carousel-20 .c-slide:nth-child(11) { animation: cs420 420s 200s infinite; }
.carousel-20 .c-slide:nth-child(12) { animation: cs420 420s 220s infinite; }
.carousel-20 .c-slide:nth-child(13) { animation: cs420 420s 240s infinite; }
.carousel-20 .c-slide:nth-child(14) { animation: cs420 420s 260s infinite; }
.carousel-20 .c-slide:nth-child(15) { animation: cs420 420s 280s infinite; }
.carousel-20 .c-slide:nth-child(16) { animation: cs420 420s 300s infinite; }
.carousel-20 .c-slide:nth-child(17) { animation: cs420 420s 320s infinite; }
.carousel-20 .c-slide:nth-child(18) { animation: cs420 420s 340s infinite; }
.carousel-20 .c-slide:nth-child(19) { animation: cs420 420s 360s infinite; }
.carousel-20 .c-slide:nth-child(20) { animation: cs420 420s 380s infinite; }
.carousel-20 .c-slide:nth-child(21) { animation: cs420 420s 400s infinite; }

/* ── index-masa: 22 slides × 30 s = 660 s total ── */
@keyframes cs660 {
    0%      { opacity: 0; }
    0.01%   { opacity: 1; }
    4.39%   { opacity: 1; }
    4.55%   { opacity: 0; }
    100%    { opacity: 0; }
}

.carousel-masa .c-slide:nth-child(1)  { animation: cs660 660s   0s infinite; }
.carousel-masa .c-slide:nth-child(2)  { animation: cs660 660s  30s infinite; }
.carousel-masa .c-slide:nth-child(3)  { animation: cs660 660s  60s infinite; }
.carousel-masa .c-slide:nth-child(4)  { animation: cs660 660s  90s infinite; }
.carousel-masa .c-slide:nth-child(5)  { animation: cs660 660s 120s infinite; }
.carousel-masa .c-slide:nth-child(6)  { animation: cs660 660s 150s infinite; }
.carousel-masa .c-slide:nth-child(7)  { animation: cs660 660s 180s infinite; }
.carousel-masa .c-slide:nth-child(8)  { animation: cs660 660s 210s infinite; }
.carousel-masa .c-slide:nth-child(9)  { animation: cs660 660s 240s infinite; }
.carousel-masa .c-slide:nth-child(10) { animation: cs660 660s 270s infinite; }
.carousel-masa .c-slide:nth-child(11) { animation: cs660 660s 300s infinite; }
.carousel-masa .c-slide:nth-child(12) { animation: cs660 660s 330s infinite; }
.carousel-masa .c-slide:nth-child(13) { animation: cs660 660s 360s infinite; }
.carousel-masa .c-slide:nth-child(14) { animation: cs660 660s 390s infinite; }
.carousel-masa .c-slide:nth-child(15) { animation: cs660 660s 420s infinite; }
.carousel-masa .c-slide:nth-child(16) { animation: cs660 660s 450s infinite; }
.carousel-masa .c-slide:nth-child(17) { animation: cs660 660s 480s infinite; }
.carousel-masa .c-slide:nth-child(18) { animation: cs660 660s 510s infinite; }
.carousel-masa .c-slide:nth-child(19) { animation: cs660 660s 540s infinite; }
.carousel-masa .c-slide:nth-child(20) { animation: cs660 660s 570s infinite; }
.carousel-masa .c-slide:nth-child(21) { animation: cs660 660s 600s infinite; }
.carousel-masa .c-slide:nth-child(22) { animation: cs660 660s 630s infinite; }

/* ── index-pm: 5 slides × 15 s = 75 s total ── */
@keyframes cs75 {
    0%      { opacity: 0; }
    0.01%   { opacity: 1; }
    18.67%  { opacity: 1; }
    20%     { opacity: 0; }
    100%    { opacity: 0; }
}

.carousel-pm .c-slide:nth-child(1) { animation: cs75 75s  0s infinite; }
.carousel-pm .c-slide:nth-child(2) { animation: cs75 75s 15s infinite; }
.carousel-pm .c-slide:nth-child(3) { animation: cs75 75s 30s infinite; }
.carousel-pm .c-slide:nth-child(4) { animation: cs75 75s 45s infinite; }
.carousel-pm .c-slide:nth-child(5) { animation: cs75 75s 60s infinite; }

/* ==========================================================
   UPLOAD FORM PAGES
   ========================================================== */
.upload-wrapper {
    max-width: 920px;
    margin: 48px auto;
    padding: 0 48px;
}

.upload-title {
    font-size: 26px;
    font-weight: 700;
    color: #4fa833;
    margin-bottom: 20px;
}

.upload-info {
    background: #f4fcf1;
    border-left: 4px solid #4fa833;
    padding: 20px 24px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 32px;
    font-size: 15px;
    line-height: 1.9;
    color: #333;
}

.upload-info strong { color: #4fa833; }

.upload-form {
    background: #fff;
    border: 1.5px solid #d4edd0;
    border-radius: 8px;
    padding: 32px 40px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 0;
    border-bottom: 1px solid #f0faea;
}

.form-row:last-of-type { border-bottom: none; }

.form-label {
    flex: 0 0 360px;
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.form-field { flex: 1; }

.form-field input[type="file"] {
    width: 100%;
    font-size: 14px;
    padding: 7px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.form-submit {
    margin-top: 28px;
    text-align: center;
}

.btn-submit {
    background: #4fa833;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 56px;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.btn-submit:hover { background: #3d8a28; }

/* ── Upload result page ── */
.upload-result {
    max-width: 640px;
    margin: 80px auto;
    padding: 48px;
    border: 2px solid #4fa833;
    border-radius: 12px;
    text-align: center;
}

.upload-result .result-item {
    font-size: 17px;
    color: #4fa833;
    font-weight: 600;
    margin-bottom: 10px;
}

.upload-result .back-link {
    display: inline-block;
    margin-top: 24px;
    color: #4fa833;
    text-decoration: underline;
    font-size: 15px;
}
