* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 15px;
}

h3 {
    font-size: 18px;
    color: #555;
    margin-top: 15px;
}

h5 {
    text-align: left;
    padding: 5px 0;
}

body {
    background-color: #f4f4f9;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    height: 70px;
    padding: 0 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
    z-index: 10;
    width: 100%;
}

header > * {
    margin: 0 12px;
}

header form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

header a, header p {
    text-decoration: none;
    color: #777;
}

.topbar-spacer {
    flex: 1;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    margin-right: 5px;
    font-size: 28px;
}

.sidebar-toggle span {
    color: #333;
}

.manager-only {
    display: none;
}

#sidebar-toggle {
    max-width: 48px;
}

#warnings-btn, #logout-btn, #login-btn {
    color: #333;
    border: none;
    border-radius: 6px;
    width: 80px;
    font-size: 18px;
    margin-top: 0;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
    transition: background 0.2s;
}

#logout-btn, #login-btn {
    width: 120px;
}

#dismiss-all-btn {
    background: #666;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: inline-block;
    position: relative;
    transition: background 0.2s;
}

#dismiss-all-btn:hover {
    background: #444;
}

.main-container {
    flex: 1 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
}

/* Logótipos */
.logos {
    display: flex;
    margin: 40px;
    justify-content: center;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: left;
    cursor: pointer;
}

.logo-container img {
    width: 150px;
    height: auto;
}

/* Barra Lateral */
.side-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: top;
    width: 13%;
    margin: 20px;
    background-color: #444;
    height: 100%;
    border-radius: 24px;
    padding: 20px 5px;
}

button {
    background: none;
    border: none;
    box-shadow: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 10px;
    padding-top: 10px;
    padding-left: 30px;
    cursor: pointer;
    transition: background 0.2s;
}

.side-button:hover {
    background: #555;
}

#side-button-help {
    margin-top: 200px;
}

/* Relatórios */
#reports-dropdown {
    display: none;
    position: absolute;
    left: 14%;
    top: 250px;
    width: 13em;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 1001;
    border: 1px solid #e0e0e0;
    flex-direction: column;
    padding: 8px 0;
}

#reports-dropdown button {
    width: 100%;
    background: none;
    border: none;
    color: #333;
    font-size: 16px;
    padding: 14px 18px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}
#reports-dropdown button:hover {
    background: #f0f4fa;
}

#reports-dropdown-btn {
    position: relative;
}

/* Botões */
button {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    font-size: 16px;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}

.logo-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #dadada;
    color: rgb(0, 0, 0);
    padding: 10px 20px;
}

.container {
    display: flex;
    width: 100%;
}

.year-select select {
    width: 100px;
    padding: 10px;
    font-size: 16px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.year-select #semestre {
    width: 150px;
}

.dashboard-page {
    display: flex;
    flex-direction: column;
    width: calc(100vw - 240px);
    max-width: 100%;
    min-width: 0;
}

.dashboard-page h2, .dashboard-page p, .dashboard-page label {
    padding-left: 20px;
    max-width: 90%;
}

.dashboard-page p {
    padding-bottom: 10px;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 24px;
    align-items: top;
    justify-content: space-between;
    padding: 30px;
    margin: 20px;
    height: 100%;
}

.grafico-container {
    margin-bottom: 30px;
}

.grafico-container h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.grafico {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 350px;
    max-width: 420px;   /* Ajusta conforme necessário */
    margin: 0 auto;
    background: none;
}

canvas {
    max-width: 100%;
    max-height: 350px;
}

#grafico-ambito, #grafico-fonte {
    max-width: 600px;
}

#grafico-meses {
    height: 400px;
}

.tabela-grafico {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

#tabela-ambito, #tabela-fonte {
    width: 450px;
}

#tabela-ambito table, #tabela-fonte table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
}

#tabela-ambito th, #tabela-ambito td, #tabela-fonte th, #tabela-fonte td {
    padding: 10px 15px;
    border: 1px solid #ddd;
}

#tabela-ambito th, #tabela-fonte th {
    background-color: #36a2eb;
    color: white;
    font-weight: bold;
}

#tabela-ambito tbody tr:nth-child(even), #tabela-fonte tbody tr:nth-child(even) {
    background-color: #f1f1f1;
}

#tabela-ambito tbody tr:last-child, #tabela-fonte tbody tr:last-child {
    font-weight: bold;
    background-color: #e0f7fa;
}

#tabela-ambito tbody tr:last-child td, #tabela-fonte tbody tr:last-child td {
    border-top: 2px solid #36a2eb;
}

/* Avisos */
#warnings-btn {
    position: relative;
}

.warnings-badge {
    position: absolute;
    left: -10px;
    top: 7px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0 5px;
    box-sizing: border-box;
    pointer-events: none;
}

#warnings-btn span {
    font-size: 32px;
}

#warnings-count {
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    padding: 2px 8px;
    margin-left: 6px;
    font-size: 14px !important;
}

#warnings-dropdown {
    position: absolute;
    top: 76px;
    right: 0;
    width: 390px;
    background: #fff;
    border: none;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(30, 41, 59, 0.18), 0 1.5px 6px rgba(30,41,59,0.10);
    padding: 0;
    min-height: 120px;
    z-index: 1002;
    display: none;
    animation: fadeInDropdown 0.18s ease;
    font-family: 'Inter', sans-serif;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#warnings-dropdown button {
    width: auto;
    margin: 0;
    background: none;
    border: none;
    color: #1976d2;
    font-weight: 500;
    font-size: 16px;
    border-radius: 6px;
    transition: background 0.18s, color 0.18s;
    padding: 8px 14px;
}
#warnings-dropdown button:hover:not(:disabled) {
    background: #f0f4fa;
    color: #125ea2;
}

.warnings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px 10px 22px;
    border-bottom: 1.5px solid #e0e0e0;
    font-weight: 600;
    font-size: 18px;
    color: #222;
    background: #f8fafc;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

#dismiss-all-btn {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(231,76,60,0.08);
    transition: background 0.18s;
}
#dismiss-all-btn:hover {
    background: #c0392b;
}

#warnings-list {
    padding: 18px 22px 8px 22px;
    min-height: 60px;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
}

.warning-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #f8fafc 80%, #e3f2fd 100%);
    border-radius: 8px;
    padding: 10px 12px 10px 10px;
    margin-bottom: 10px;
    font-size: 15.5px;
    color: #333;
    box-shadow: 0 1px 4px rgba(30,41,59,0.06);
    border: 1px solid #e0e0e0;
    word-break: break-word;
    transition: box-shadow 0.18s, border 0.18s;
}
.warning-item:hover {
    box-shadow: 0 2px 8px rgba(30,41,59,0.13);
    border: 1.5px solid #1976d2;
}

.warning-x {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 20px;
    cursor: pointer;
    margin-left: 14px;
    border-radius: 50%;
    padding: 4px 7px 4px 7px;
    transition: background 0.18s;
}
.warning-x:hover {
    background: #ffeaea;
}

.warnings-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0 16px 0;
    border-top: 1.5px solid #e0e0e0;
    background: #f8fafc;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    gap: 10px;
}

.warnings-pagination button {
    background: none;
    border: none;
    font-size: 22px;
    color: #1976d2;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.18s, color 0.18s;
}
.warnings-pagination button:disabled {
    color: #bbb;
    background: none;
    cursor: default;
}
.warnings-pagination span#warning-index {
    font-size: 15px;
    color: #444;
    font-weight: 500;
    margin: 0 8px;
}

/* Footer */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    margin: 30px;
}

footer .logo-container {
    margin-bottom: 30px;
    width: 150px;
}

footer .language {
    margin-bottom: 30px;
}

footer .language * {
    display: none;
    text-decoration: none;
    color: #333;
}

.wiki-container h1, .about-container h1 {
    margin-bottom: 20px;
}

/* Ajuda */
.wiki-container, .about-container, .logs-container {
    width: calc(100vw - 280px);
    margin: 20px auto;
    background: #fff;
    border-radius: 18px;
    padding: 36px 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.wiki-nav {
    margin-bottom: 32px;
}
.wiki-nav ul {
    list-style: none;
    padding: 0;
}
.wiki-nav li {
    margin: 10px 0;
}
.wiki-nav a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
    font-size: 18px;
}
.wiki-nav a:hover {
    text-decoration: underline;
}
.wiki-topic {
    margin-bottom: 38px;
}
.wiki-topic h2 {
    color: #1976d2;
    margin-bottom: 12px;
}
.back-to-top {
    font-size: 14px;
    color: #888;
    margin-top: 18px;
    display: inline-block;
}
.back-to-top:hover {
    color: #1976d2;
    text-decoration: underline;
    cursor: pointer; }

/* Sobre */
.about-container h2 {
    color: #1976d2;
    margin-bottom: 18px;
}
.about-container p {
    margin-bottom: 18px;
}

.logs-container {
    height: 700px;
}

.logs-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    gap: 20px;
}

.log-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.log-filter label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.log-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    min-width: 120px;
}

.log-filter select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.clear-log {
    display: flex;
    justify-content: end;
}

#clear-log-btn {
    background:#e74c3c;
    color:#fff;
    border:none;
    border-radius:6px;
    padding:12px 24px;
    font-size:16px;
    font-weight:500;
    margin: 20px 0;
    width: 200px;
    cursor:pointer;
}

#log-reader {
    background:#f8f8f8;
    border-radius:12px;
    padding:18px;
    height: 80%;
    overflow:auto;
    font-family:monospace;
    font-size:15px;
    color:#222;
    margin-bottom:18px;
    border:1px solid #e0e0e0;
    white-space:pre-wrap;
}

.log-line {
    padding: 8px 0;
    border-bottom: 1px solid #e8e8e8;
    line-height: 1.4;
}

.log-line:last-child {
    border-bottom: none;
}

.log-line:hover {
    background-color: #f0f0f0;
}

.log-info {
    color: #222;
    background-color: transparent;
}

.log-warning {
    color: #f39c12;
    background-color: #fef9e7;
    border-left: 4px solid #f39c12;
    padding-left: 12px;
}

.log-error {
    color: #e74c3c;
    background-color: #fdf2f2;
    border-left: 4px solid #e74c3c;
    padding-left: 12px;
}

/* Design Responsivo */
@media (max-width: 900px) {
    body {
        flex-direction: column;
    }
    header {
        padding: 0 !important;
        width: 100%;
    }
    .logo-container {
        text-align: center;
        padding: 10px !important;
    }
    header h1, #upload-btn-container, header a, header p {
        display: none;
    }
    .sidebar-toggle {
        display: flex;
    }
    .side-bar {
        position: fixed;
        top: 70px;
        left: -260px;
        width: 200px !important;
        height: 600px !important;
        background: #444;
        z-index: 100;
        transition: left 0.3s;
        box-shadow: 2px 0 8px rgba(0,0,0,0.15);
        padding-top: 20px;
    }
    .side-bar.open {
        left: 0;
    }
    .main-container {
        margin-left: 0 !important;
    }
    .dashboard-page, .wiki-container, .about-container, .logs-container {
        width: 95%;
        padding: 20px;
        margin: 0;
    }

    .container {
        flex-direction: column;
    }

    .logo-bar {
        flex-direction: column;
        align-items: center;
    }

    .logo-bar h1 {
        font-size: 18px;
        padding: 15px 0;
    }

    #tabela-ambito, #tabela-fonte {
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .dashboard-container {
        padding: 10px !important;
        margin: 20px 0 !important;
    }

    .tabela-grafico {
        flex-direction: column;
        align-items: stretch;
    }
    #warnings-dropdown {
        width: 330px !important;
    }
        html, body {
        width: 100% !important;
    }
    #sidebar-toggle {
        margin-right: 0;
        margin-top: 0;
    }
    header .logo-container, #warnings-btn, header form {
        margin: 0;
    }
    header form {
        padding: 0;
        width: 60px;
    }
    #logout-btn, #login-btn {
    width: 80px !important;
    }
    #logout-btn span:last-child, #login-btn span:last-child {
        display: none;
    }
    footer .language * {
        display: unset !important;
    }
}

@media (min-width: 901px) {
    .sidebar-toggle {
        display: none;
    }
    .side-bar {
        position: static;
        width: 200px;
        height: auto;
        margin: 20px;
        border-radius: 24px;
        padding: 20px 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        background: #444;
        box-shadow: none;
        transition: none;
    }
    .main-container {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        width: 100%;
        padding-top: 20px;
    }
}
