:root {
    --suip-blue: #020B5C;
    --suip-blue-2: #0056B3;
    --suip-green: #1B8A5A;
    --suip-bg: #F5F7FA;
    --suip-text: #1F2937;
    --suip-muted: #6B7280;
    --suip-border: #E5E7EB;
}

body { background: var(--suip-bg); }

.topbar-brand img { max-height: 40px; object-fit: contain; }

.os-sidebar-card {
    margin-top: auto;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.07);
    border-radius: 16px;
    display: grid;
    gap: 6px;
}

.os-sidebar-card strong { color: #fff; font-size: 14px; }
.os-sidebar-card span { color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.4; }

.os-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    margin-bottom: 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, #ffffff, #eef6ff);
    border: 1px solid #e5eefb;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .06);
}

.os-hero.compact { margin-bottom: 18px; }
.os-hero h2 { margin: 4px 0 4px; font-size: 28px; color: var(--suip-text); }
.os-hero p { margin: 0; color: var(--suip-muted); max-width: 780px; line-height: 1.5; }
.hero-kicker { color: var(--suip-blue-2); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }

.os-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.alert-ok,
.alert-erro {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-weight: 600;
    line-height: 1.45;
}
.alert-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-erro { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-erro ul { margin: 8px 0 0 18px; padding: 0; font-weight: 500; }

.os-toolbar { margin-bottom: 16px; }
.os-actions-top { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.global-filter-input {
    min-width: 260px;
    height: 42px;
    border: 1px solid var(--suip-border);
    background: #fff;
    border-radius: 12px;
    padding: 0 13px;
    outline: none;
}
.global-filter-input:focus { border-color: var(--suip-blue-2); box-shadow: 0 0 0 3px rgba(0,86,179,.12); }

.os-table-card { padding: 0; overflow: hidden; }
.os-table-card .table-responsive { padding: 0; overflow-x: auto; }
.os-number {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 800;
    white-space: nowrap;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-muted { background: #f3f4f6; color: #4b5563; }

.actions-cell { min-width: 150px; white-space: nowrap; }
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 13px;
    font-weight: 800;
}
.action-btn.danger { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.inline-form { display: inline; margin-left: 6px; }
.inline-form button { font-family: inherit; }
.empty-state { padding: 28px !important; text-align: center; color: var(--suip-muted); }

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--suip-border);
    color: var(--suip-muted);
    font-size: 14px;
}
.pagination-bar div { display: flex; gap: 8px; }

.os-form-card { padding: 24px; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--suip-border);
}
.section-head h3 { margin: 0; color: var(--suip-text); }
.section-head p { margin: 4px 0 0; color: var(--suip-muted); }

.form-grid-os {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field.span-2 { grid-column: span 2; }
.form-field.span-3 { grid-column: 1 / -1; }
.form-field label { font-size: 13px; font-weight: 800; color: #374151; }
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    color: var(--suip-text);
    font: inherit;
    padding: 11px 12px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-field input,
.form-field select { min-height: 44px; }
.form-field textarea { resize: vertical; min-height: 100px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--suip-blue-2); box-shadow: 0 0 0 3px rgba(0,86,179,.12); }
.form-field input[readonly] { background: #f9fafb; color: #4b5563; }
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea { border-color: #ef4444; }
.field-error { color: #dc2626; font-weight: 700; }
.helper-text { color: var(--suip-muted); font-size: 12px; }

.input-with-action { display: flex; gap: 8px; }
.input-with-action input { flex: 1; }
.mini-btn {
    min-width: 78px;
    border-radius: 12px;
    background: #eef2ff;
    color: #1e40af;
    border: 1px solid #c7d2fe;
    font-weight: 800;
}
.check-line {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #4b5563 !important;
    margin-top: 2px;
}
.check-line input { width: 16px; height: 16px; min-height: 0; }

.attachments-box {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--suip-border);
}
.attachments-box h4 { margin: 0 0 10px; }
.attachments-list { display: grid; gap: 8px; }
.attachments-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--suip-border);
    border-radius: 12px;
    background: #f9fafb;
    color: #1d4ed8;
    font-weight: 700;
}
.attachments-list small { color: var(--suip-muted); font-weight: 600; }
.form-actions-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--suip-border);
}

.table-filter-button strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
}

@media (max-width: 1100px) {
    .os-summary-grid { grid-template-columns: 1fr; }
    .form-grid-os { grid-template-columns: 1fr; }
    .form-field.span-2,
    .form-field.span-3 { grid-column: auto; }
    .os-hero,
    .section-head,
    .pagination-bar { flex-direction: column; align-items: stretch; }
    .os-actions-top { justify-content: flex-start; }
    .global-filter-input { min-width: 100%; }
}

/* ============================================================
   Ajuste visual SGI: padrão do print 2
   ============================================================ */
:root {
    --sgi-sidebar: #172944;
    --sgi-sidebar-soft: #213653;
    --sgi-sidebar-active: #344963;
    --sgi-bg: #f4f8ff;
    --sgi-border: #d7e1ee;
    --sgi-text: #0b1f3a;
    --sgi-muted: #66758c;
    --sgi-blue: #0056b3;
    --sgi-dark-btn: #0b1f3a;
}

html, body {
    background: var(--sgi-bg) !important;
    color: var(--sgi-text);
}

.app-shell.sgi-layout {
    min-height: 100vh;
    background: var(--sgi-bg);
}

.sgi-main.app-main {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    background: var(--sgi-bg);
}

.sgi-page-content.page-content {
    padding: 22px 24px 34px;
    max-width: none;
}

.sgi-sidebar.sidebar {
    width: 260px;
    background: var(--sgi-sidebar);
    color: #fff;
    box-shadow: none;
    border-right: 1px solid rgba(255,255,255,.08);
}

.sgi-sidebar-head.sidebar-head {
    min-height: 96px;
    padding: 22px 14px 14px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.sgi-logo img {
    width: 178px;
    max-height: 58px;
    object-fit: contain;
    object-position: left center;
}

.sgi-sidebar-nav.sidebar-nav {
    padding: 14px 10px;
    gap: 4px;
}

.sgi-main-link.sidebar-main-link,
.sgi-sub-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f8fbff;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s ease, color .18s ease;
}

.sgi-main-link.sidebar-main-link:hover,
.sgi-sub-link:hover,
.sgi-main-link.sidebar-main-link.is-active,
.sgi-sub-link.is-active {
    background: var(--sgi-sidebar-active);
    color: #fff;
}

.sgi-main-link .sidebar-menu-icon,
.sgi-sub-link .sidebar-menu-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.sgi-main-link svg,
.sgi-sub-link svg,
.sgi-logout-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sgi-menu-group {
    margin: 4px 0;
}

.sgi-group-title {
    cursor: default;
    background: transparent;
}

.sgi-menu-group.is-open > .sgi-group-title {
    background: var(--sgi-sidebar-active);
}

.sgi-chevron {
    margin-left: auto;
    display: inline-flex;
    opacity: .85;
}

.sgi-menu-group.is-open .sgi-chevron {
    transform: rotate(90deg);
}

.sgi-submenu {
    margin: 4px 0 8px 18px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,.18);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sgi-sub-link {
    min-height: 38px;
    font-size: 13px;
    padding: 9px 10px;
    border-radius: 9px;
}

.sgi-sidebar-footer.sidebar-footer {
    margin-top: auto;
    padding: 10px 10px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.sgi-user-card {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    color: #fff;
}

.sgi-user-card span,
.sgi-user-card small {
    display: block;
    color: rgba(255,255,255,.75);
    font-size: 12px;
}

.sgi-user-card strong {
    display: block;
    font-size: 14px;
    margin: 3px 0;
}

.sgi-logout-form {
    margin: 0;
}

.sgi-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: #fff;
    font-weight: 800;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
}

.sgi-logout-btn:hover {
    background: rgba(255,255,255,.10);
}

.sgi-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.sgi-page-head h1 {
    margin: 0 0 5px;
    color: var(--sgi-text);
    font-size: 24px;
    line-height: 1.15;
    font-weight: 800;
}

.sgi-page-head p {
    margin: 0;
    color: var(--sgi-muted);
    font-size: 13px;
}

.sgi-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.sgi-search-input {
    width: min(360px, 34vw);
    min-width: 260px;
    height: 42px;
    border-radius: 16px;
    border: 1px solid var(--sgi-border);
    background: #fff;
    padding: 0 16px;
    color: var(--sgi-text);
    outline: none;
}

.sgi-search-input:focus {
    border-color: #9bbdf0;
    box-shadow: 0 0 0 3px rgba(0,86,179,.10);
}

.sgi-btn-primary.btn-primary,
.sgi-btn-dark.btn-secondary {
    min-height: 42px;
    border-radius: 18px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    white-space: nowrap;
}

.sgi-btn-primary.btn-primary,
.sgi-btn-dark.btn-secondary {
    background: var(--sgi-dark-btn);
    color: #fff;
    border-color: var(--sgi-dark-btn);
    box-shadow: 0 8px 20px rgba(11,31,58,.15);
}

.sgi-table-card.content-card {
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(12, 37, 71, .05);
    border: 1px solid var(--sgi-border);
    background: #fff;
}

.sgi-table-responsive.table-responsive {
    overflow: auto;
    max-height: calc(100vh - 142px);
}

.sgi-data-table.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    font-size: 13px;
}

.sgi-data-table.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    color: #233854;
    border-bottom: 1px solid var(--sgi-border);
    padding: 14px 14px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .02em;
    white-space: nowrap;
}

.sgi-data-table.data-table tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--sgi-border);
    color: var(--sgi-text);
    vertical-align: middle;
}

.sgi-data-table.data-table tbody tr:nth-child(even) {
    background: #fbfdff;
}

.sgi-data-table.data-table tbody tr:hover {
    background: #eef6ff;
}

.sgi-actions-cell.actions-cell {
    gap: 8px;
    white-space: nowrap;
}

.sgi-pagination-bar.pagination-bar {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid var(--sgi-border);
}

.sgi-form-card.content-card {
    border-radius: 12px;
    border: 1px solid var(--sgi-border);
    box-shadow: 0 8px 22px rgba(12, 37, 71, .06);
}

.sgi-alert {
    margin-bottom: 12px;
}

.permissions-panel > label {
    margin-bottom: 10px;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.permission-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--sgi-border);
    border-radius: 12px;
    background: #fff;
    font-weight: 700;
    color: var(--sgi-text);
}

.permission-check input {
    width: 16px;
    height: 16px;
}

.user-active-line {
    margin-top: 28px;
    min-height: 42px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top left, rgba(0,86,179,.14), transparent 34%), var(--sgi-bg);
}

.login-card {
    width: min(440px, 100%);
    background: #fff;
    border: 1px solid var(--sgi-border);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(12,37,71,.12);
    padding: 28px;
}

.login-logo-wrap img {
    width: 190px;
    max-height: 70px;
    object-fit: contain;
    object-position: left center;
    margin-bottom: 16px;
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 24px;
    color: var(--sgi-text);
}

.login-card p {
    margin: 0 0 18px;
    color: var(--sgi-muted);
}

.login-submit {
    width: 100%;
    margin-top: 10px;
}

.empty-page {
    padding: 24px;
}

@media (max-width: 980px) {
    .sgi-main.app-main {
        margin-left: 0;
        width: 100%;
    }

    .sgi-page-content.page-content {
        padding: 72px 14px 24px;
    }

    .sgi-page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .sgi-page-actions {
        justify-content: flex-start;
    }

    .sgi-search-input {
        width: 100%;
        min-width: 0;
    }

    .permissions-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   Ajuste final da sidebar - nomes corretos e sem blocos brancos
   ========================================================= */
.sgi-sidebar.sidebar {
    width: 250px !important;
    min-width: 250px !important;
    padding: 16px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.sgi-main.app-main {
    margin-left: 0 !important;
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.sgi-sidebar-head.sidebar-head {
    min-height: 70px !important;
    padding: 6px 4px 14px !important;
}

.sgi-sidebar-nav.sidebar-nav.sgi-nav-clean {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
    padding: 6px 4px 0 !important;
}

.sgi-nav-clean .sgi-main-link,
.sgi-nav-clean .sgi-sub-link,
.sgi-logout-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    min-height: 40px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    border: 0 !important;
}

.sgi-nav-clean .sgi-main-link:hover,
.sgi-nav-clean .sgi-main-link.is-active,
.sgi-nav-clean .sgi-sub-link:hover,
.sgi-nav-clean .sgi-sub-link.is-active,
.sgi-logout-btn:hover {
    background: rgba(255,255,255,.10) !important;
    color: #ffffff !important;
}

.sgi-nav-clean .sidebar-menu-icon,
.sgi-logout-btn .sidebar-menu-icon {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    flex: 0 0 18px !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.sgi-nav-clean .sidebar-menu-icon svg,
.sgi-logout-btn .sidebar-menu-icon svg {
    width: 18px !important;
    height: 18px !important;
    stroke: currentColor !important;
}

.sgi-nav-clean .menu-label,
.sgi-logout-btn span:last-child {
    display: block !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.sgi-nav-section {
    margin: 12px 0 4px !important;
    padding: 0 12px !important;
    color: rgba(255,255,255,.74) !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: .02em !important;
    text-transform: none !important;
}

.sgi-settings-link {
    margin-left: 0 !important;
    padding-left: 12px !important;
    border-left: 0 !important;
}

/* Neutraliza qualquer bloco antigo de agrupamento visual */
.sgi-menu-group,
.sgi-group-title,
.sgi-chevron,
.sidebar-group,
.sidebar-group-toggle,
.sidebar-group-chevron,
.sidebar-subnav {
    all: unset;
}

.sgi-sidebar-footer.sidebar-footer {
    margin-top: auto !important;
    padding: 12px 4px 0 !important;
    border-top: 1px solid rgba(255,255,255,.10) !important;
}

.sgi-user-card {
    margin-bottom: 10px !important;
    padding: 12px !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,.08) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
}

.sgi-user-card strong {
    margin: 3px 0 2px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.sgi-logout-btn {
    width: 100% !important;
}

@media (max-width: 1180px) {
    .sgi-sidebar.sidebar {
        width: min(290px, 88vw) !important;
        min-width: 0 !important;
    }

    .sgi-main.app-main {
        width: 100% !important;
    }
}

/* =========================================================
   Correção: nomes dos campos no menu lateral
   O CSS antigo tratava todos os <span> do link como ícone.
   Estas regras separam definitivamente ícone e texto.
   ========================================================= */
.sgi-nav-clean .menu-label,
.sgi-sidebar .menu-label,
.sgi-logout-btn span:last-child {
    display: inline-block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.sgi-nav-clean .sidebar-menu-icon,
.sgi-sidebar .sidebar-menu-icon,
.sgi-logout-btn .sidebar-menu-icon {
    flex: 0 0 18px !important;
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
}

.sgi-nav-clean .sgi-main-link,
.sgi-nav-clean .sgi-sub-link,
.sgi-logout-btn {
    overflow: visible !important;
}

/* ===== OS / SM / SO + Mapa geral ===== */
.geo-helper-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
}

.geo-btn {
    width: 100%;
    justify-content: center;
}

.location-map-panel {
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    background: #f8fafc;
    padding: 14px;
}

.location-map-panel[hidden] {
    display: none !important;
}

.location-map-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.location-map-head strong,
.location-map-head small {
    display: block;
}

.location-map-head strong {
    color: #172944;
    font-size: 15px;
}

.location-map-head small {
    color: #6b7280;
    margin-top: 3px;
}

.location-map-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.form-location-map {
    width: 100%;
    height: 380px;
    min-height: 320px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #eef4ff, #f8fafc);
}

.form-location-map .leaflet-control-attribution {
    font-size: 10px;
}

.muted-text {
    color: #6b7280;
    font-size: 12px;
}

.map-mini-link {
    color: #0056b3;
    font-weight: 700;
    text-decoration: none;
}

.map-page-head .sgi-page-actions {
    flex-wrap: wrap;
}

.map-info-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    border-left: 4px solid #0056b3;
}

.map-status-summary {
    padding: 10px 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: #173f7a;
    font-weight: 700;
    white-space: nowrap;
}

.map-shell-card {
    overflow: hidden;
    padding: 0;
}

.map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.map-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.type-legend strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    border-radius: 8px;
    background: #172944;
    color: #ffffff;
    font-size: 12px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(17, 24, 39, .12);
}

.status-aberta { background: #2563eb; }
.status-andamento { background: #f59e0b; }
.status-concluida { background: #16a34a; }
.status-cancelada { background: #64748b; }

.sgi-map {
    height: min(68vh, 720px);
    min-height: 520px;
    width: 100%;
    background: linear-gradient(135deg, #eef4ff, #f8fafc);
}

.map-popup-card {
    font-family: inherit;
    color: #111827;
}

.map-popup-card strong,
.map-popup-card span,
.map-popup-card p,
.map-popup-card a {
    display: block;
}

.map-popup-card strong {
    font-size: 15px;
    margin-bottom: 2px;
}

.map-popup-card span {
    color: #4b5563;
    font-size: 12px;
    margin-bottom: 8px;
}

.map-popup-card p {
    margin: 5px 0;
    line-height: 1.35;
}

.map-popup-card a {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #0056b3;
    color: #ffffff !important;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
}

.map-unavailable {
    height: 100%;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: #374151;
    font-weight: 700;
}

.map-fallback-list {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    border-top: 1px solid #e5e7eb;
}

.map-fallback-item {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    background: #ffffff;
}

.map-fallback-item strong,
.map-fallback-item span,
.map-fallback-item a {
    display: block;
}

.map-fallback-item span {
    margin: 4px 0 10px;
    color: #4b5563;
    font-size: 13px;
}

.map-fallback-item a {
    color: #0056b3;
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 900px) {
    .map-info-card,
    .map-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .map-status-summary {
        white-space: normal;
        border-radius: 14px;
    }

    .sgi-map {
        min-height: 420px;
        height: 62vh;
    }

    .location-map-head {
        flex-direction: column;
    }

    .location-map-actions {
        width: 100%;
        justify-content: stretch;
    }

    .location-map-actions .btn-light {
        flex: 1 1 180px;
    }

    .form-location-map {
        min-height: 300px;
        height: 52vh;
    }
}


/* Atualização: alteração rápida de status na listagem OS/SM/SO */
.status-quick-form {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

.status-quick-select {
    min-width: 135px;
    height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 999px;
    padding: 0 30px 0 12px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    outline: none;
    background-color: #eef6ff;
    color: #0f2a48;
}

.status-quick-select:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.status-quick-select.badge-warning {
    background-color: #fff7e6;
    color: #92400e;
}

.status-quick-select.badge-success {
    background-color: #e9f9ef;
    color: #166534;
}

.status-quick-select.badge-muted {
    background-color: #f1f5f9;
    color: #475569;
}

.status-quick-select.badge-danger {
    background-color: #fff1f2;
    color: #9f1239;
}

/* Atualização: datas de status, envio para execução e botão PDF */
.dates-cell {
    min-width: 190px;
    font-size: 12px;
    color: #31435a;
    line-height: 1.35;
}

.dates-cell span,
.status-date {
    display: block;
    white-space: nowrap;
}

.status-date {
    margin-top: 5px;
    font-size: 11px;
    color: #64748b;
}

.action-btn.pdf {
    background: #eef6ff;
    color: #0f4da2;
    border-color: rgba(15, 77, 162, .18);
}

.action-btn.sent {
    background: #ecfdf3;
    color: #166534;
    border-color: rgba(22, 101, 52, .18);
}

.action-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #166534;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.status-timeline-box {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(203, 213, 225, .9);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.status-timeline-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(203, 213, 225, .8);
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.status-timeline-head h4 {
    margin: 0 0 4px;
    color: #0f2a48;
    font-size: 16px;
}

.status-timeline-head p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.status-timeline-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 10px;
}

.status-timeline-grid div {
    border: 1px solid rgba(203, 213, 225, .85);
    border-radius: 14px;
    padding: 10px 12px;
    background: #fff;
}

.status-timeline-grid span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.status-timeline-grid strong {
    color: #0f2a48;
    font-size: 13px;
}

.status-history-list {
    margin-top: 14px;
    border-top: 1px dashed rgba(148, 163, 184, .7);
    padding-top: 10px;
}

.status-history-list div {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    font-size: 12px;
    color: #334155;
}

.status-history-list strong {
    min-width: 115px;
    color: #0f2a48;
}

@media (max-width: 960px) {
    .status-timeline-head {
        flex-direction: column;
    }

    .status-timeline-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .status-timeline-grid {
        grid-template-columns: 1fr;
    }

    .dates-cell span,
    .status-date {
        white-space: normal;
    }
}

.sgi-actions-cell.actions-cell {
    min-width: 250px;
    white-space: normal;
}

.sgi-actions-cell .inline-form {
    display: inline-flex;
    margin-left: 0;
}

/* Painel de Controle / Mapa OS-SM-SO */
.map-filter-card {
    margin-bottom: 16px;
    border-left: 4px solid #0056b3;
}

.map-filter-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.map-filter-head strong,
.map-filter-head span {
    display: block;
}

.map-filter-head strong {
    color: #10233d;
    font-size: 16px;
    font-weight: 900;
}

.map-filter-head span {
    margin-top: 3px;
    color: #5d6b80;
    font-size: 13px;
}

.map-filter-grid {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) minmax(310px, 1.3fr) minmax(260px, 1.2fr) auto;
    align-items: end;
    gap: 12px;
}

.map-filter-grid fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.map-filter-grid legend,
.map-search-filter span {
    width: 100%;
    margin-bottom: 6px;
    color: #10233d;
    font-size: 12px;
    font-weight: 900;
}

.map-check-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 11px;
    border: 1px solid #d7e4f5;
    border-radius: 999px;
    background: #f8fbff;
    color: #10233d;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    user-select: none;
}

.map-check-pill input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #0056b3;
}

.map-search-filter {
    display: block;
    min-width: 0;
}

.map-search-filter input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d7e4f5;
    border-radius: 12px;
    padding: 0 12px;
    color: #10233d;
    background: #fff;
    font-weight: 700;
}

.map-clear-filter {
    min-height: 42px;
    white-space: nowrap;
}

.map-type-marker-wrapper {
    background: transparent !important;
    border: 0 !important;
}

.map-type-marker {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffffff;
    border-radius: 16px 16px 16px 4px;
    background: var(--marker-color, #2563eb);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .28);
    color: #ffffff;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .2px;
    transform: rotate(-45deg);
}

.map-type-marker span {
    transform: rotate(45deg);
    line-height: 1;
}

.popup-type-badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 22px;
    margin: 0 6px 0 0 !important;
    padding: 2px 7px;
    border-radius: 8px;
    background: #10233d;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 900;
    vertical-align: middle;
}

@media (max-width: 1180px) {
    .map-filter-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .map-filter-head,
    .map-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .map-filter-grid {
        grid-template-columns: 1fr;
    }

    .map-clear-filter {
        width: 100%;
    }
}
