:root {
    --bg: #f4f6f8;
    --ink: #17202a;
    --muted: #667085;
    --line: #d8dee6;
    --panel: #ffffff;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --warning: #b45309;
    --danger: #b42318;
    --ok: #15803d;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
.topbar {
    min-height: 64px;
    padding: 0 28px;
    background: #101828;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.brand { color: #fff; font-size: 20px; font-weight: 700; }
.topbar nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar nav a { color: #e5e7eb; }
.container { width: min(1180px, calc(100% - 32px)); margin: 28px auto; }
.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    width: min(1440px, calc(100% - 32px));
    margin: 24px auto;
    align-items: start;
}
.app-content {
    width: 100%;
    margin: 0;
}
.sidebar {
    position: sticky;
    top: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.sidebar-user {
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}
.sidebar-user strong,
.sidebar-user span {
    display: block;
    overflow-wrap: anywhere;
}
.sidebar-user span {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}
.side-nav {
    display: grid;
    gap: 4px;
    padding: 10px;
}
.side-nav a {
    display: block;
    padding: 11px 12px;
    border-radius: 6px;
    color: #344054;
    font-weight: 700;
}
.side-nav a:hover,
.side-nav a.active {
    background: #ccfbf1;
    color: #115e59;
}
.side-label {
    display: block;
    padding: 14px 12px 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    gap: 28px;
    align-items: center;
    padding: 32px 0;
}
h1 { font-size: 38px; line-height: 1.12; margin: 0 0 12px; }
h2 { margin: 0 0 18px; }
p { color: var(--muted); line-height: 1.55; }
.panel, .card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
}
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat strong { display: block; font-size: 28px; margin-top: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.full { grid-column: 1 / -1; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: var(--primary);
    font-weight: 700;
    cursor: pointer;
}
.button:hover, button:hover { background: var(--primary-dark); }
.button.secondary { background: #344054; }
.button.small { min-height: 34px; padding: 0 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.inline-form {
    display: grid;
    gap: 8px;
    min-width: 240px;
}
.inline-form textarea {
    min-height: 76px;
}
.inline-form button {
    width: fit-content;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eef2f6; font-size: 13px; text-transform: uppercase; color: #344054; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #eef2f6; font-size: 12px; font-weight: 700; }
.status-concluido { color: var(--ok); }
.status-cancelado { color: var(--danger); }
.status-agendado, .status-em_execucao { color: var(--warning); }
.alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; background: #eef2f6; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.muted { color: var(--muted); }
.os-print { background: #fff; padding: 28px; border: 1px solid var(--line); }
.signature { height: 80px; border-bottom: 1px solid #111827; margin-top: 48px; }
@media (max-width: 820px) {
    .hero, .grid, .grid.two, .form-grid { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; padding: 18px; }
    .app-shell {
        grid-template-columns: 1fr;
        width: min(100% - 24px, 720px);
        margin-top: 16px;
    }
    .sidebar {
        position: static;
    }
    .side-nav {
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }
    .side-nav a {
        white-space: nowrap;
    }
    .side-label {
        display: none;
    }
    table { display: block; overflow-x: auto; }
    .inline-form {
        min-width: 220px;
    }
}
@media print {
    .topbar, .sidebar, .actions, .no-print { display: none; }
    .app-shell { display: block; width: 100%; margin: 0; }
    body { background: #fff; }
    .container { width: 100%; margin: 0; }
    .os-print { border: 0; }
}
