:root {
    --background: #07111f;
    --sidebar: #091525;
    --surface: #0d1b2d;
    --surface-light: #12243a;
    --border: #1d334a;
    --text: #f4f7fb;
    --muted: #8fa3b8;
    --primary: #22c55e;
    --primary-dark: #15803d;
    --warning: #f59e0b;
    --danger: #ef4444;
    --blue: #38bdf8;
    --sidebar-width: 260px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.07), transparent 28%),
        var(--background);
    color: var(--text);
    font-family: Inter, Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: rgba(9, 21, 37, 0.97);
    padding: 24px 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 26px;
}

.brand-mark,
.form-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #86efac);
    color: #052e16;
    font-size: 22px;
    font-weight: 900;
    box-shadow: 0 10px 26px rgba(34, 197, 94, 0.2);
}

.brand strong {
    display: block;
    font-size: 18px;
}

.brand span,
.user small,
.sidebar-footer small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.navigation {
    flex: 1;
    overflow-y: auto;
}

.menu-title {
    margin: 18px 10px 8px;
    color: #61768c;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
    border-radius: 10px;
    padding: 11px 12px;
    color: #bdc9d6;
    text-decoration: none;
    transition: 0.2s ease;
}

.menu-link span {
    width: 20px;
    text-align: center;
}

.menu-link:hover {
    background: var(--surface-light);
    color: var(--text);
}

.menu-link.active {
    background: rgba(34, 197, 94, 0.13);
    color: #7ee2a1;
}

.menu-link.disabled {
    opacity: 0.62;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 13px;
}

.system-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 14px var(--primary);
}

.sidebar-footer strong {
    display: block;
    font-size: 12px;
}

.page {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 17, 31, 0.9);
    padding: 0 34px;
    backdrop-filter: blur(16px);
}

.topbar-title {
    font-size: 15px;
    font-weight: 700;
}

.topbar-actions,
.user,
.environment {
    display: flex;
    align-items: center;
}

.topbar-actions {
    gap: 24px;
}

.environment {
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.environment span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.user {
    gap: 10px;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid #31506d;
    border-radius: 10px;
    background: var(--surface-light);
    font-size: 12px;
    font-weight: 800;
}

.user strong {
    display: block;
    font-size: 12px;
}

.mobile-menu {
    display: none;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 24px;
}

.content {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 34px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.eyebrow {
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.page-heading h1 {
    margin: 7px 0 8px;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1;
}

.page-heading p,
.panel-header p,
.form-panel-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0 17px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s ease;
}

.button-primary {
    background: var(--primary);
    color: #052e16;
}

.button-primary:hover {
    background: #4ade80;
    transform: translateY(-1px);
}

.button-secondary {
    border-color: var(--border);
    background: var(--surface-light);
    color: var(--text);
}

.button-secondary:hover {
    border-color: #34526f;
    background: #172c44;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 132px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(18, 36, 58, 0.78), rgba(13, 27, 45, 0.95));
    padding: 20px;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    font-weight: 900;
}

.stat-icon.success {
    background: rgba(34, 197, 94, 0.13);
    color: #4ade80;
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
}

.stat-icon.neutral {
    background: rgba(56, 189, 248, 0.13);
    color: #7dd3fc;
}

.stat-card span,
.stat-card small {
    display: block;
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin: 4px 0;
    font-size: 28px;
}

.stat-card small {
    font-size: 11px;
}

.panel,
.form-panel {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(13, 27, 45, 0.9);
    overflow: hidden;
}

.panel-header,
.form-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    padding: 22px 24px;
}

.panel-header h2,
.form-panel-header h2 {
    margin: 0 0 5px;
    font-size: 17px;
}

.search-box {
    display: flex;
    width: min(320px, 100%);
    align-items: center;
    gap: 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #091525;
    padding: 0 12px;
}

.search-box span {
    color: var(--muted);
}

.search-box input {
    width: 100%;
    height: 40px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #0a1727;
    color: #7890a8;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
}

th,
td {
    border-bottom: 1px solid rgba(29, 51, 74, 0.7);
    padding: 15px 18px;
    white-space: nowrap;
}

tbody tr {
    transition: 0.2s ease;
}

tbody tr:hover {
    background: rgba(18, 36, 58, 0.6);
}

td {
    color: #cbd7e4;
    font-size: 13px;
}

code {
    border: 1px solid #243e57;
    border-radius: 7px;
    background: #081321;
    color: #a7f3d0;
    padding: 5px 8px;
}

.equipment-name {
    display: flex;
    align-items: center;
    gap: 11px;
}

.equipment-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.12);
    color: #5ee68b;
    font-size: 10px;
    font-weight: 900;
}

.equipment-name strong,
.equipment-name small {
    display: block;
}

.equipment-name strong {
    color: var(--text);
}

.equipment-name small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 800;
}

.status-badge span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.12);
    color: #68e291;
}

.status-badge.active span {
    background: var(--primary);
}

.status-badge.maintenance {
    background: rgba(245, 158, 11, 0.13);
    color: #fbbf24;
}

.status-badge.maintenance span {
    background: var(--warning);
}

.status-badge.reserve {
    background: rgba(56, 189, 248, 0.13);
    color: #7dd3fc;
}

.status-badge.reserve span {
    background: var(--blue);
}

.status-badge.disabled {
    background: rgba(239, 68, 68, 0.13);
    color: #fca5a5;
}

.status-badge.disabled span {
    background: var(--danger);
}

.empty-state {
    height: 160px;
    color: var(--muted);
    text-align: center;
}

.form-panel {
    max-width: 1050px;
}

.form-panel-header {
    justify-content: flex-start;
}

.form-panel form {
    padding: 26px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-full {
    grid-column: 1 / -1;
}

.field label {
    color: #c5d1de;
    font-size: 12px;
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid #29435d;
    border-radius: 10px;
    outline: none;
    background: #091525;
    color: var(--text);
    padding: 12px 13px;
    transition: 0.2s ease;
}

.field input,
.field select {
    min-height: 45px;
}

.field textarea {
    min-height: 130px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 11px;
    margin-top: 26px;
    border-top: 1px solid var(--border);
    padding-top: 22px;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-100%);
        transition: 0.25s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .page {
        margin-left: 0;
    }

    .mobile-menu {
        display: inline-block;
        margin-right: 10px;
    }

    .topbar {
        padding: 0 18px;
    }

    .environment {
        display: none;
    }

    .content {
        padding: 22px 16px;
    }

    .page-heading,
    .panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .stats-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-full {
        grid-column: auto;
    }

    .search-box {
        width: 100%;
    }

    .user div:last-child {
        display: none;
    }
}

.event-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.event-info {
    color: #86efac;
    background: rgba(34, 197, 94, 0.14);
}

.event-aviso {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.14);
}

.event-erro {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.14);
}
