*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #e9f5e5;
    color: #123016;
}

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

img {
    max-width: 100%;
    display: block;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: #326F00;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-circle {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: #FCDF5B;
    color: #326F00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    overflow: hidden;
}

.logo-circle.small {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
}

.logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title h1 {
    margin: 0;
    font-size: 1.2rem;
}

.title small {
    font-size: 0.8rem;
    opacity: 0.9;
}

.main-menu {
    display: flex;
    gap: 0.5rem;
}

.main-menu a {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #f1ffe9;
}

.main-menu a:hover {
    background: rgba(252,223,91,0.2);
}

.main-menu a.active {
    background: #FCDF5B;
    color: #326F00;
}

.right-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.social-icons a {
    margin-left: 0.35rem;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.social-icons a:hover {
    background: rgba(0,0,0,0.1);
}

.btn {
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary {
    background: #5271FF;
    color: #fff;
}

.btn-primary:hover {
    background: #405ae0;
}

.btn-outline {
    background: transparent;
    border: 1px solid #5271FF;
    color: #5271FF;
}

.btn-outline:hover {
    background: #5271FF;
    color: #fff;
}

.btn-danger {
    background: #AA511D;
    color: #fff;
}

.btn-danger:hover {
    background: #8b3f14;
}

.section-title {
    font-size: 1.2rem;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.muted {
    color: #6b7c65;
    font-size: 0.9rem;
}

.table-basic {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.table-basic th,
.table-basic td {
    border: 1px solid #c7d8c5;
    padding: 0.4rem 0.5rem;
}

.table-basic th {
    background: #3A9725;
    color: #fff;
    text-align: left;
}

.table-basic tr:nth-child(even) {
    background: #f4fbf2;
}

.badge-date {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #FCDF5B;
    color: #3b3b10;
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

.cards-grid-4,
.cards-grid-3,
.cards-grid-2 {
    display: grid;
    gap: 1rem;
}

.cards-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.cards-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.cards-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    position: relative;
}

.card img {
    border-radius: 0.6rem;
    margin-bottom: 0.4rem;
}

/* Dashboard layout */
.dashboard-body {
    background: #dbead7;
}

.topbar-dashboard {
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - 64px);
}

.sidebar {
    background: #254b05;
    color: #e7ffe7;
    padding: 0.75rem;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-menu a {
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.08);
}

.sidebar-menu a.active {
    background: #3A9725;
    color: #fff;
}

.dashboard-main {
    padding: 1rem 1.25rem;
    background: linear-gradient(to bottom, #f3fff0, #e1f0de);
}

/* Footer */
.site-footer {
    background: #326F00;
    color: #fff;
    padding: 1rem 1.5rem;
    text-align: center;
    margin-top: 2rem;
}

.site-footer .footer-img img {
    max-height: 60px;
    margin: 0.5rem auto;
}

.badge-estado {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.badge-ok {
    background: #3A9725;
    color: #fff;
}

.badge-warn {
    background: #FCDF5B;
    color: #5c4b00;
}

.badge-low {
    background: #ffb347;
    color: #5b3b02;
}

.badge-critical {
    background: #ff6961;
    color: #5b0800;
}

.badge-off {
    background: #999;
    color: #fff;
}

.section-filters {
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.section-filters input,
.section-filters select {
    padding: 0.25rem 0.4rem;
    border-radius: 0.4rem;
    border: 1px solid #c7d8c5;
    font-size: 0.85rem;
    min-width: 140px;
}
