:root {
    --bg: #07120d;
    --panel: #0d2b1d;
    --panel-soft: #1f2937;
    --line: rgba(255,255,255,.11);
    --text: #f3f4f6;
    --muted: #c8d2cc;
    --green: #16b364;
    --green-light: #8ed600;
    --green-dark: #0d2b1d;
    --graphite: #1f2937;
    --soft: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 22px 70px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 76% 8%, rgba(142,214,0,.15), transparent 28rem),
        radial-gradient(circle at 30% 16%, rgba(22,179,100,.14), transparent 26rem),
        linear-gradient(135deg, #020704 0%, var(--bg) 46%, #102018 100%);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(440px, 100%);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(13,43,29,.9);
    box-shadow: var(--shadow);
}

.login-card h1, .topbar h1 {
    margin: 20px 0 6px;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1;
}

.login-card h1 span, .topbar h1 span {
    background: linear-gradient(90deg, var(--green), var(--green-light));
    -webkit-background-clip: text;
    color: transparent;
}

.login-card p, .topbar p, .welcome p, .module-card p, .notice span, .footer { color: var(--muted); }

.login-card form, .compact-form {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

label { display: grid; gap: 8px; color: #d8e2ee; }
input, select {
    width: 100%;
    min-height: 46px;
    color: var(--text);
    background: rgba(5,17,31,.74);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px;
    padding: 0 14px;
    outline: none;
}
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,179,100,.18); }

.btn {
    border: 0;
    border-radius: 8px;
    padding: 13px 18px;
    color: var(--white);
    cursor: pointer;
    background: var(--panel-soft);
}
.btn.primary { background: linear-gradient(90deg, var(--green), var(--green-light)); color: #07120d; font-weight: 900; }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand strong { display: block; font-size: 1.05rem; }
.brand small { color: var(--green-light); }
.brand.big strong { font-size: 1.35rem; }
.brand-logo {
    width: 62px;
    max-height: 62px;
    object-fit: contain;
}
.brand-mark {
    position: relative;
    width: 48px;
    height: 48px;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.brand-mark i { border-radius: 999px 999px 999px 2px; display: block; }
.brand-mark i:nth-child(1) { background: var(--green); transform: rotate(35deg); }
.brand-mark i:nth-child(2) { background: var(--green-light); transform: rotate(65deg); }
.brand-mark i:nth-child(3) { background: var(--green-dark); transform: rotate(-20deg); }
.brand-mark i:nth-child(4) { background: var(--green); transform: rotate(20deg); }

.app-shell {
    display: grid;
    grid-template-columns: 286px 1fr;
}
.sidebar {
    min-height: 100vh;
    padding: 28px 18px;
    border-right: 1px solid var(--line);
    background: rgba(3,12,7,.82);
    position: sticky;
    top: 0;
}
.sidebar nav {
    display: grid;
    gap: 8px;
    margin-top: 34px;
}
.sidebar nav a {
    padding: 15px 18px;
    border-radius: 8px;
    color: #dfe8f4;
}
.sidebar nav a:hover {
    background: linear-gradient(90deg, rgba(22,179,100,.24), rgba(142,214,0,.1));
}
.sidebar-footer {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 24px;
    padding: 18px;
    border-radius: 8px;
    background: rgba(255,255,255,.04);
    color: var(--muted);
}
.sidebar-footer span { color: var(--green-light); }

.content { min-width: 0; padding: 26px 32px; }
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 3.2rem); }
.user-pill {
    min-width: 240px;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 4px 12px;
    align-items: center;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(31,41,55,.72);
    color: var(--text);
    text-align: left;
}
.user-pill span {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: #07120d;
    font-weight: 900;
}
.user-pill small { color: var(--muted); }

.welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin: 28px 0;
}
.welcome h2, .panel h2 { margin: 0 0 8px; font-size: 1.55rem; }
.search { width: min(340px, 100%); }

.notice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.notice, .panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(13,43,29,.72);
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.notice { padding: 18px; }
.notice strong { display: block; font-size: 1.35rem; }

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.module-card {
    min-height: 248px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(31,41,55,.88), rgba(13,43,29,.94));
    text-align: center;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.module-card:hover { transform: translateY(-3px); border-color: rgba(142,214,0,.7); }
.module-icon {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--green-light));
    color: #07120d;
    font-size: 2.4rem;
}
.module-icon.module-icon-logo {
    width: 124px;
    height: 78px;
    border-radius: 8px;
    padding: 6px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(7,18,13,.08), 0 10px 26px rgba(0,0,0,.18);
}
.module-icon-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.module-card h3 { margin: 4px 0 0; font-size: 1.35rem; }
.module-card p { margin: 0; line-height: 1.45; }
.module-card b { color: var(--green-light); }

.panel { padding: 24px; margin-top: 28px; }
.two-cols {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 360px);
    gap: 24px;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--green-light); font-weight: 800; }

.alert {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(22,179,100,.16);
}
.alert.danger { background: rgba(220,38,38,.16); }
.alert.success { background: rgba(22,179,100,.18); }
.fade-out { opacity: .25; transition: opacity .4s ease; }
.empty { grid-column: 1 / -1; color: var(--muted); }
.footer { padding: 28px 0 8px; text-align: center; }

@media (max-width: 920px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { min-height: auto; position: static; padding: 18px 14px; }
    .sidebar nav {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        margin-top: 20px;
    }
    .sidebar nav a {
        display: grid;
        place-items: center;
        min-height: 48px;
        padding: 12px;
        text-align: center;
    }
    .sidebar-footer { position: static; margin-top: 20px; }
    .topbar, .welcome { align-items: flex-start; flex-direction: column; }
    .user-pill { width: 100%; }
    .content { padding: 20px; }
    .notice-grid, .two-cols { grid-template-columns: 1fr; }
    .module-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .module-card { min-height: 214px; padding: 20px; }
    .module-icon { width: 72px; height: 72px; font-size: 2rem; }
    .module-icon.module-icon-logo { width: 112px; height: 72px; }
}

@media (max-width: 560px) {
    .login-page { padding: 16px; }
    .login-card { padding: 24px; }
    .content { padding: 16px 14px; }
    .notice-grid,
    .module-grid { gap: 12px; }
    .module-grid { grid-template-columns: 1fr; }
    .module-card { min-height: 190px; }
    .topbar h1 { font-size: 2rem; }
    .welcome { gap: 12px; }
}

.desk-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin: 28px 0;
}
.desk-head h2 { margin: 0 0 6px; font-size: 1.7rem; }
.desk-head p { margin: 0; color: var(--muted); }
.desk-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.desk-stats article {
    min-height: 104px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(31,41,55,.86), rgba(13,43,29,.9));
}
.desk-stats span {
    display: block;
    color: var(--muted);
    font-weight: 800;
}
.desk-stats strong {
    display: block;
    margin-top: 10px;
    font-size: 2rem;
    color: var(--white);
}
.desk-stats .critical {
    border-color: rgba(220,38,38,.55);
    background: linear-gradient(145deg, rgba(127,29,29,.72), rgba(13,43,29,.9));
}
.desk-filter,
.desk-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    align-items: end;
}
.desk-form.single {
    grid-template-columns: 1fr;
}
.desk-full,
.desk-actions {
    grid-column: 1 / -1;
}
.desk-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.desk-panels,
.desk-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.desk-table-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.desk-table-head span,
.desk-mini-list small {
    color: var(--muted);
}
.desk-mini-list {
    display: grid;
    gap: 10px;
}
.desk-mini-list span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.04);
}
.desk-mini-list span small {
    display: block;
    margin-top: 4px;
}
.desk-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 900;
    white-space: nowrap;
}
.badge-aberto { background: #dbeafe; color: #1e3a8a; }
.badge-em-andamento { background: #ffedd5; color: #9a3412; }
.badge-aguardando-solicitante,
.badge-aguardando-terceiro { background: #f3e8ff; color: #6b21a8; }
.badge-resolvido { background: #dcfce7; color: #14532d; }
.badge-encerrado { background: #e5e7eb; color: #374151; }
.badge-cancelado { background: #fee2e2; color: #991b1b; }
.badge-baixa { background: #e0f2fe; color: #075985; }
.badge-media { background: #ecfccb; color: #365314; }
.badge-alta { background: #fed7aa; color: #9a3412; }
.badge-critica { background: #fecaca; color: #991b1b; }
.desk-dl {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px 14px;
    margin: 0 0 18px;
}
.desk-dl dt {
    color: var(--muted);
    font-weight: 800;
}
.desk-dl dd {
    margin: 0;
}
.desk-text {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.04);
    color: var(--text);
    line-height: 1.5;
}
.desk-timeline {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}
.desk-event {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.04);
}
.desk-event.internal {
    border-color: rgba(142,214,0,.48);
    background: rgba(142,214,0,.08);
}
.desk-event strong,
.desk-event span {
    display: block;
}
.desk-event span {
    margin-top: 4px;
    color: var(--muted);
    font-size: .9rem;
}
.desk-event p {
    margin: 10px 0 0;
    color: var(--text);
}
.desk-check {
    display: flex;
    align-items: center;
    gap: 10px;
}
.desk-check input {
    width: auto;
    min-height: auto;
}
.btn.small {
    min-height: 34px;
    padding: 8px 10px;
    font-size: .86rem;
}
.desk-login-card {
    width: min(560px, 100%);
}
.desk-login-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 24px;
}
@media (max-width: 920px) {
    .desk-head,
    .desk-table-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .desk-panels,
    .desk-detail-grid {
        grid-template-columns: 1fr;
    }
    .desk-dl {
        grid-template-columns: 1fr;
    }
}
