:root {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-element: #cbd5e1;
    --bg-disabled: #e7e7e7;
    --bg-invalid: #fff0f0;
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent: #0f766e;
    --main-button: #57de39;
    --main-button-hover: #369420;
    --sec-button: #1277f2;
    --sec-button-hover: #3f6da7;
    --discret-button: #cbd5e1;
    --discret-button-hover: #8d959f;
    --border: #cbd5e1;
    --border-strong: #8a9097;
    --border-invalid: 1px solid #FF9999;
    --table-border: 1px solid #808080;
    --table-header: #cbd5e1;
    --table-body: #f8fafc;
    --radius: 8px;
    --shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.1);
    --font-main: system-ui, -apple-system, sans-serif;
}



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

html {
    font-size: 62.5%;
}

body {
    font-size: 1.6rem;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
}

main {
    display: flex;
    justify-content: center;
    padding: 0 2.5rem 10rem  2.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 1.4rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 600px;
}

thead tr {
    background-color: var(--table-header);
    color: var(--text-main);
    text-align: left;
    text-transform: uppercase;
}

th {
    padding: 1.2rem 1.5rem;
    font-weight: 700;
    border: var(--table-border);
}

td {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    color: var(--text-muted);
}

select option[value=""][disabled] {
    display: none;
}

select:invalid {
    color: #94a3b8;
}

.table-container {
    width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 2rem;
}

.table-id-cell {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.table-id-cell svg {
    height: 1.6rem;
}

.table-id-cell span{
    display: flex;
    flex-direction: row;
    gap: 0.4rem;
}

.table-id-cell span:nth-child(1){
    color: #0000AA;
}

.table-id-cell span:nth-child(2){
    color: #00AA00;
}

.table-actions-cell {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.table-actions-cell svg {
    height: 2rem;
}

.table-actions-cell button:nth-child(1):hover  {
    color: #0000AA;
    cursor: pointer;
}
.table-actions-cell button:nth-child(2):hover  {
    color: #BB0000;
    cursor: pointer;
}

.hidden {
    display: none;
}

.btn-primary {
    background-color: var(--main-button);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-weight: bold;
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: var(--main-button-hover);
    cursor: pointer;
}

.btn-primary:disabled {
    background-color: var(--bg-disabled);
}

.btn-primary:disabled svg {
    color: #000000;
}

.btn-secondary {
    background-color: var(--sec-button);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-weight: bold;
    color: #FFFFFF;
}

.btn-secondary:hover {
    background-color: var(--sec-button-hover);
    cursor: pointer;
}

.btn-discret {
    background-color: var(--discret-button);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
}

.btn-discret:hover {
    background-color: var(--discret-button-hover);
    cursor: pointer;
}

.btn-discret:disabled {
    background-color: var(--discret-button);
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: 0.7;
}

.btn-icon {
    background-color: transparent;
    border: none;
}

.main-header {
    height: 60px;
    background-color: var(--bg-card);
    box-shadow: var(--shadow);

    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    z-index: 10;
}

.main-header a {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-header img {
    height: 75%;
    width: auto;
    display: block;
}

.main-container {
    max-width: 900px;
    width: 100%;
}

.page-title {
    padding: 3rem 0rem;
}

.page-title h1 {
    color: var(--text-main);
    font-size: 2.5rem;
}

.page-title p {
    color: var(--text-muted);
}

.main-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 3rem;
}

.card-legend {
    color: var(--accent);
    display: flex;
    align-items: center; 
    gap: 0.8rem;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
    margin-left: -1rem;
}

.card-legend h2 {
    font-size: 1.4rem;
    margin: 0;
    line-height: 1;
}

.card-legend svg {
    height: 2rem;
    width: auto;
}

form fieldset {
    border: none;
    border-top: 1px solid var(--border);
    margin-bottom: 4rem;
    padding: 2rem;
}

fieldset, .form-grid {
    min-width: 0;
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.form-group label {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-muted);
}

.form-checkbox {
    display: flex;
    gap: 1rem;
    padding: 0.7rem;
    margin-bottom: 2rem;
    width: fit-content;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: #EFEFEF;
}

.form-checkbox label {
    font-size: 1.0rem;
    font-weight: bold;
    color: var(--text-muted);
}

.input-field {
    padding: 1rem;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s ease-in-out;
}

.input-field:focus {
    outline: none;
    border: 1px solid var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
    background-color: var(--bg-card);
}

input.input-field:read-only {
    background-color: var(--bg-disabled);
}

.input-field:disabled, .input-field.disabled {
    background-color: var(--bg-disabled);
    pointer-events: none;
    opacity: 0.8;
}

.input-group {
    width: 100%;
    display: flex;
    gap: 0.5rem;
}

.input-group button {
    aspect-ratio: 1/1;
    height: 100%;
    display: flex;
    align-items: center; 
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.input-file {
    width: 100%;
    padding: 3rem;
    background-color: var(--bg-body);
    border: 2px dashed var(--border); /* Borda tracejada é o padrão para uploads */
    border-radius: var(--radius);
    cursor: pointer;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.input-file:hover {
    border-color: var(--accent);
    background-color: rgba(15, 118, 110, 0.05);
}

.input-file i {
    color: var(--accent);
    margin-bottom: 1.5rem;
    width: 4rem;
    height: 4rem;
}

.input-file p {
    font-size: 1.4rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.input-file p span {
    color: var(--accent);
    font-weight: 700;
}

.input-file.active {
    border-style: solid;
    background-color: #EDFFED;
}

.input-file.dragover {
    border-color: #F59E0B;
    background-color: rgba(245, 158, 11, 0.05);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.input-container {
  position: relative;
  display: inline-block;
}

.input-container input {
  padding-right: 40px;
}

.input-container::after {
  content: attr(data-unit);
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  pointer-events: none;
}

.input-field.invalid {
    border: var(--border-invalid);
    background-color: var(--bg-invalid);
}

.input-file.invalid {
    border-color: #FF9999;
    background-color: var(--bg-invalid);
}

footer {
    background-color: var(--bg-card);
    height: 8rem;
    border-top: 1px solid var(--border); 
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
    
    padding: 0 1.5rem;
    width: 100%;
}

footer p {
    color: var(--text-main);
    font-weight: bold;
}

footer small {
    color: var(--text-muted);
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .main-container {
        width: 100%;
        padding: 0 1rem;
    }

    .main-card {
        padding: 2rem 1.5rem;
        width: 100%;
        max-width: calc(100vw - 2rem); 
        overflow-x: hidden; 
    }

    .table-container {
        width: 100%;
        display: block;
        overflow-x: auto;
        border-right: 1px solid var(--border);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.icons.spin {
    animation: spin 1s linear infinite;
}