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

body {
    background-color: #b26464;
}

#wrapper {
    max-width: 90%;
    margin: 0px auto;
    background-color: #ffffff;
    border-radius: 0 0 35px 35px;
    box-shadow: 0px 25px 40px 40px #b26464 inset;
    display: block;
    text-align: center;
}

img {
    width: 70%;
    padding-top: 3%;
}

header {
    width: auto;
    text-align: center;
    padding-top: 7%;
}

.log {
    padding-top: 0;
    padding-bottom: 0;
}

footer {
    height: 40px;
    background-color: #b92b2b;
    color: white;
    line-height: 40px;
    text-align: center;
    margin-top: 40px;
    margin-left: auto;
    margin-right: auto;
    font-weight: bold;
    border-radius: 35px 35px;
    box-shadow: 0px -25px 37px 5px #581e1e inset;
}

/* ==========================================================================
   NAWIGACJA GŁÓWNA (1. POZIOM)
   ========================================================================== */
nav {
    padding: 1%;
    height: auto;
    width: 60%;
    margin: 0px auto;
    display: flex;
    align-items: inherit;
    justify-content: center;
    border-radius: 50px 50px;
    background-color: #b92b2b;
    box-shadow: 0px -25px 37px 5px #581e1e inset;
    font-size: 20px;
    text-decoration: none;
}

nav ul {
    list-style: none;
    margin: 0px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

nav ul > li {
    margin: 0;
    padding: 0;
    position: relative;
    height: 30px;
}

nav ul > li > a {
    padding: 10px; 
    margin: auto;
    height: 80px;
    color: #fff;
    text-decoration: none;
}

nav ul > li > a:hover, 
nav ul > li:hover > a {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    background-color: #bd6b1e;
    box-shadow: 0px -25px 37px 5px #532e0c inset;
}

/* ==========================================================================
   SPRAWDZONE, SFORMATOWANE PODMENU (2. I 3. POZIOM) - MODEL TABELARYCZNY
   ========================================================================== */

/* --- DRUGI POZIOM (np. Podmenu rozwijane pod SUROWIEC / Debug) --- */
nav ul > li > ul {
    padding: 0;
    margin: 0;
    position: absolute; 
    left: 0px; 
    top: 30px; 
    min-width: 240px;       
    width: max-content !important; /* Rozszerza bordowy pasek pod najdłuższy tekst */
    text-align: left;
    border: 1px solid #ccc;
    list-style: none;
    display: none; 
    z-index: 999;           
    overflow: visible !important;  /* Pozwala podmenu bocznemu wysunąć się poza krawędź */
}

/* Pokazywanie drugiego poziomu jako tabela */
nav ul > li:hover > ul {
    display: table !important;
}

nav ul > li > ul > li {
    margin: 0; 
    padding: 0;
    display: table-row !important; /* Układ wiersza tabeli */
    width: 100% !important;
    background-color: #b92b2b;
    box-shadow: 0px -25px 37px 5px #581e1e inset;
}

/* Specjalne wymuszenie pozycji relatywnej dla elementu z klasą .has-submenu (Analiza) */
nav ul > li > ul > li.has-submenu {
    position: relative !important;
}

nav ul > li > ul > li > a {
    padding: 18px 35px !important; /* Twoja idealna wysokość pionowa */
    margin: 0; 
    display: table-cell !important; /* Zachowuje się jak komórka tabeli i rozpycha wiersz */
    width: max-content !important; 
    white-space: nowrap !important; /* Absolutny zakaz łamania linii */
    color: #fff !important; 
    text-decoration: none;
}

/* --- TRZECI POZIOM (Boczne podmenu wysuwane dla Analizy) --- */
nav ul > li > ul > li.has-submenu > ul {
    display: none !important;       
    position: absolute !important; 
    
    /* Poprawione na dynamiczne 100% - teraz Analiza doklei się idealnie do krawędzi Debug */
    left: 100% !important;         
    top: 0px !important;            
    
    min-width: 200px;
    width: max-content !important; /* Pozwala podmenu Analizy rosnąć tak szeroko, jak tekst */
    border: 1px solid #ccc;
    list-style: none;
    z-index: 1000;
    overflow: visible !important;  
}

/* Pokazywanie 3. poziomu jako tabela po najechaniu na Analizę */
nav ul > li > ul > li.has-submenu:hover > ul {
    display: table !important; 
}

/* Elementy i linki wewnątrz trzeciego poziomu */
nav ul > li > ul > li.has-submenu > ul > li {
    display: table-row !important;
    width: 100% !important;
    border-radius: 0px !important;
    background-color: #b92b2b;
    box-shadow: 0px -25px 37px 5px #581e1e inset;
}

nav ul > li > ul > li.has-submenu > ul > li > a {
    padding: 18px 35px !important; 
    margin: 0;
    display: table-cell !important;
    width: max-content !important; 
    white-space: nowrap !important; 
    color: #fff !important;
    text-decoration: none;
}

/* --- EFEKTY HOVER (Z izolacją kaskady, aby style nie wyciekały) --- */
nav ul > li > ul > li:hover > a,
nav ul > li > ul > li > ul > li:hover > a {
    text-decoration: none !important;
    color: #fff !important;
    background-color: #bd6b1e !important;
    box-shadow: 0px -25px 37px 5px #532e0c inset !important;
}

/* --- ESTETYKA I ZAOKRĄGLENIA ROGÓW --- */
nav ul > li > ul > li:first-child,
nav ul > li > ul > li:first-child > a {
    border-radius: 15px 15px 0 0 !important;
}
nav ul > li > ul > li:last-child,
nav ul > li > ul > li:last-child > a {
    border-radius: 0 0 15px 15px !important;
}
/* Zaokrąglenie dołu dla samego bocznego podmenu Analizy */
nav ul > li > ul > li.has-submenu > ul > li:last-child,
nav ul > li > ul > li.has-submenu > ul > li:last-child > a {
    border-radius: 0 0 15px 15px !important;
}

/* ==========================================================================
   POZOSTAŁE STYLE (FORMULARZE, GRID, ASIDE)
   ========================================================================== */
aside {
    display: flex;
    width: 70%;
}

aside > nav a {
    display: block;
    padding: 16px 30px;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    -webkit-transition: all 1s ease;
    transition: all 1s ease;
    font-size: 20px;
    border-radius: 50px 50px;
}

aside > nav a:hover {
    background-color: #bd6b1e;
    box-shadow: 0px -25px 37px 5px #532e0c inset;
    cursor: pointer;
    padding: 16px 30px;
    width: 100%;
}

.grid-container2 aside {
    padding-top: 10%;
}

.grid-container2 > aside > nav a {
    display: block;
    padding: 16px 30px;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    -webkit-transition: all 1s ease;
    transition: all 1s ease;
    font-size: 20px;
    border-radius: 50px 50px;
}

.grid-container2 > aside > nav a:hover {
    background-color: #bd6b1e;
    box-shadow: 0px -25px 37px 5px #532e0c inset;
    cursor: pointer;
    padding: 16px 30px;
}

main {
    display: flex;
    width: 70%;
    text-align: right;
}

.form {
    margin: 20px 0 0 26%;
    font-family: sans-serif;
    max-width: 40rem;
    padding: 0 5%;
    display: flex;
    flex-direction: row;
    align-content: stretch;
    align-items: baseline;
    justify-content: center;
}

.form .form-row {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
}

.form .form-row:last-child {
    margin-bottom: 0;
}

.form input,
.form textarea {
    font-family: sans-serif;
    padding: 0.8rem;
    border: 1px solid #bbb;
    display: block;
    width: 100%;
    color: #666;
}

.form label {
    display: flex;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding: 5px;
    width: 330px;
    text-align: center;
}

.form .submit-btn {
    font-family: sans-serif;
    padding: 1rem 2rem;
    cursor: pointer;
    background-color: #b92b2b;
    box-shadow: 0px -25px 37px 5px #581e1e inset;
    border: 0;
    border-radius: 0.2rem;
    color: #FFF;
    font-size: 1.1rem;
    font-weight: bold;
    transition: 0.3s background-color;
}

.form2 {
    margin: 20px 0 0 26%;
    font-family: sans-serif;
    max-width: 40rem;
    padding: 0 5%;
    display: flexbox;
}

.form2 .form-row2 {
    margin-bottom: 1rem;
    display: flex;
}

.form2 input,
.form2 textarea {
    font-family: sans-serif;
    padding: 0.8rem;
    border: 1px solid #bbb;
    display: block;
    width: 100%;
    color: #666;
}

.form2 label {
    display: flex;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding: 5px;
    width: 330px;
    text-align: center;
}

.form2 .submit-btn {
    font-family: sans-serif;
    padding: 1rem 2rem;
    cursor: pointer;
    background-color: #b92b2b;
    box-shadow: 0px -25px 37px 5px #581e1e inset;
    border: 0;
    border-radius: 0.2rem;
    color: #FFF;
    font-size: 1.1rem;
    font-weight: bold;
    transition: 0.3s background-color;
}

textarea:valid, input:valid {
    background-color: rgb(201, 255, 201);
}
  
.form2 textarea:invalid, input:invalid {
    background-color: rgb(249, 225, 228);
}

select:valid {
    background-color: rgb(201, 255, 201);
    font-size: 20px;
    padding: 1%;
}
  
select:invalid {
    background-color: rgb(255, 197, 205);
    font-size: 20px;
    padding: 1%;
}

.form input.field-error,
.form textarea.field-error {
    border-color: tomato;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,99,71, 0.3);
}
.form-error-text {
    color: tomato;
    font-size: 0.8rem;
    margin-top: 5px;
}
.form-error-inline .form-error-text {
    display: none;
}

textarea {
    height: 300px;
}

.form-send-success,
.form-send-error {
    font-family: sans-serif;
    padding: 3em;
    border: 1px solid #ddd;
}

.form-send-success strong,
.form-send-error strong {
    display: block;
    font-size: 1.5em;
    color: tomato;
    margin-bottom: 0.3em;
}

.left {
    text-align: left;
    padding: 10px;
    padding-left: 30%;
    display: block;
}

.right {
    text-align: right;
    padding: 0;
    display: flow;
}

.center {
    text-align: center;
    padding: 10px;
    display: flex;
}

h1 {
    text-align: center;
    margin: 10px;
    padding: 10px;
    background-color: #b92b2b;
    color: white;
    font-weight: bold;
    border-radius: 35px 35px;
    box-shadow: 0px -25px 37px 5px #581e1e inset;
    width: 40%;
    display: inline-block;
    align-items: center;
    justify-content: center;
}

h2 {
    padding: 1%;
    margin: 0;
    text-decoration: none;
    color: #fff;
    background-color: #bd6b1e;
    box-shadow: 0px -25px 37px 5px #532e0c inset;
    border-radius: 35px 35px;
    display: inline-block;
}

h4 {
    padding: 5px;
    text-align: center;
    display: inline-block;
}

td {
    padding: 5px;
}

.grid-container {
    display: grid;
    grid-template-columns: 40% 40%;
    gap: 10px;
    padding: 10px;
    text-align: center;
}
.grid-container > div {
    text-align: center;
    padding: 20px 0;
    font-size: 30px;
}
  
.grid-item1 {
    grid-column-start: 1;
    grid-column-end: 3;
}

.grid-container2 {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: 25% 75%;
    gap: 10px;
    padding-top: 0px;
    padding-bottom: 3%;
    text-align: center;
}
.grid-container2 > div {
    text-align: center;
    padding: 0;
    font-size: 30px;
    display: inline;
}
  
.grid-container2 .grid-item1 aside nav a {
    padding-top: 0%;
    display: flex;
    grid-column-start: 1;
    grid-column-end: 2;
}

.grid-container2 > .grid-item2 {
    display: flex;
    grid-column-start: 2;
    grid-column-end: 4;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
}

.data, thead tr th, .data > tbody tr td {
    text-align: center;
    padding: 5px;
    font-size: 20px;
    border-collapse: collapse;
}

.data {
    border-radius: 35px 0 0 0;
}

thead tr th {
    font-size: 20px;
    background-color: #b92b2b;
    box-shadow: 0px -25px 37px 5px #581e1e inset;
    color: #FFF;
}

thead tr th:first-child {
    border-radius: 35px 0 0 0;
}

thead tr th:last-child {
    border-radius: 0 35px 0 0;
}

tbody tr th {
    background-color: rgb(255, 34, 0);
}

.data > tbody > tr:nth-child(odd) {
    background-color: rgb(237, 154, 75);
}

.data > tbody > tr:nth-child(even) {
    background-color: rgb(255, 180, 127);
}

.data > tbody > tr:hover {
    background-color: rgb(199, 242, 162);
}

.dataGate, .dataGate > tr th, .dataGate > tbody tr td {
    text-align: center;
    padding: 5px;
    font-size: 20px;
    border-collapse: collapse;
}

.dataGate {
    border-radius: 35px 0 0 0;
    margin: 0 auto;
}

.dataGate > thead tr {
    padding: 50px;
}

.dataGate tr th {
    font-size: 20px;
    background-color: #b92b2b;
    box-shadow: 0px -25px 37px 5px #581e1e inset;
    color: #FFF;
}

.dataGate tr th:first-child {
    border-radius: 35px 0 0 0;
}

.dataGate tr th:last-child {
    border-radius: 0 35px 0 0;
}

.dataGate tr th {
    background-color: rgb(255, 34, 0);
}

.dataGate > tbody > tr:nth-child(odd) {
    background-color: gray;
}

.dataGate > tbody > tr:nth-child(even) {
    background-color: rgb(255, 180, 127);
}

.dataGate > tbody > tr:hover {
    background-color: rgb(199, 242, 162);
}

section {
    padding-top: 5%;
    width: 90%;
    padding-left: 7%;
    align-content: center;
}

iframe {
    width: 100%;
    border: none;
    background-color: white;
    height: 550px;
}