/* ═══════════════════════════════════════════════════════════
   ChecklistSystem — app.css
   Design System: Clean SaaS — Navy + Teal accent
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --primary: #22D3EE;
    --primary-light: #34D399;
    --accent: #22D3EE;
    --success: #34D399;
    --warning: #FBBF24;
    --danger: #FB7185;
    --purple: #A78BFA;
    --teal: #2DD4BF;
    --bg: #0B1120;
    --surface: #131B2E;
    --border: rgba(255,255,255,.06);
    --text: #F1F5F9;
    --text-muted: #64748B;
    --sidebar-w: 240px;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,.25);
}

/* ── Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap');


/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    font-family: 'Sora', 'Segoe UI', sans-serif;
    letter-spacing: -.02em;
}

/* ── Layout ────────────────────────────────────────────────── */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(200deg, #0d1526 0%, #111d35 45%, #0f1729 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: 4px 0 30px rgba(0,0,0,.4);
    border-right: 1px solid rgba(255,255,255,.03);
}

/* ── Brand ─────────────────────────────────────────────────── */
.sidebar-brand {
    padding: 22px 16px 20px;
    display: flex;
    align-items: center;
    gap: 13px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #22D3EE 0%, #34D399 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    color: #0B1120;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(34,211,238,.3);
    letter-spacing: 0;
}

.brand-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name-main {
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    line-height: 1;
}

.brand-name-sub {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #22D3EE;
    opacity: .8;
    line-height: 1;
}

/* ── Nav list ──────────────────────────────────────────────── */
.nav-list {
    list-style: none;
    padding: 12px 10px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .nav-list li a,
    .nav-list li .nav-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 11px 13px;
        color: rgba(255,255,255,.5);
        text-decoration: none;
        font-size: 10.5px;
        font-weight: 800;
        letter-spacing: 1px;
        text-transform: uppercase;
        border-radius: 9px;
        border-left: 3px solid transparent;
        transition: background .15s, color .15s, border-color .15s;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .nav-list li a:hover,
        .nav-list li .nav-link:hover {
            background: rgba(255,255,255,.05);
            color: rgba(255,255,255,.88);
            border-left-color: rgba(34,211,238,.4);
        }

        .nav-list li a.active,
        .nav-list li .nav-link.active {
            background: linear-gradient(90deg, rgba(34,211,238,.12) 0%, rgba(34,211,238,.02) 100%);
            color: #fff;
            border-left-color: #22D3EE;
            font-weight: 900;
            letter-spacing: 1.1px;
        }

/* ── Nav Groups (Submenus) ─────────────────────────────────── */
.nav-group {
    margin-bottom: 2px;
}

.nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 13px;
    color: rgba(255,255,255,.6);
    cursor: pointer;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 9px;
    transition: background .15s, color .15s;
    user-select: none;
}

    .nav-group-header:hover {
        background: rgba(255,255,255,.05);
        color: rgba(255,255,255,.9);
    }

.nav-group-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-group-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.nav-group.expanded .nav-group-icon {
    transform: rotate(90deg);
}

.nav-group-items {
    list-style: none;
    padding-left: 20px;
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

    .nav-group-items li a,
    .nav-group-items li .nav-link {
        font-size: 10px;
        padding: 9px 13px;
    }

.nav-separator {
    height: 1px;
    background: rgba(255,255,255,.07);
    margin: 6px 4px;
    list-style: none;
}

/* ── Nav Section Label (Super Admin sidebar) ─────────── */
.nav-section-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,.25);
    padding: 14px 13px 6px;
    list-style: none;
}

/* ── Super Admin Avatar ──────────────────────────────── */
.super-avatar {
    background: linear-gradient(135deg, #FB7185, #F472B6) !important;
    color: #fff !important;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.version {
    font-size: 10px;
    color: rgba(255,255,255,.25);
    letter-spacing: .5px;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-container {
    padding: 32px 36px;
    max-width: 1200px;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

/* ── Global Footer ─────────────────────────────────────────── */
.app-footer {
    padding: 20px 36px;
    color: #6b7280;
    font-size: 13px;
    text-align: center;
    line-height: 1.6;
    margin-top: auto;
}

    .app-footer span {
        display: inline-block;
        margin: 0 4px;
    }

    .app-footer a {
        color: var(--primary);
        text-decoration: none;
        font-weight: 600;
    }

        .app-footer a:hover {
            text-decoration: underline;
        }

@media (max-width: 768px) {
    .app-footer {
        font-size: 11.5px;
        padding: 16px 20px;
    }
}

/* ── Page Header ───────────────────────────────────────────── */
.page-header {
    margin-bottom: 28px;
}

    .page-header h1 {
        font-size: 26px;
        font-weight: 700;
        color: var(--primary);
    }

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* ── KPI Grid ──────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    border-top: 4px solid transparent;
}

.kpi-blue {
    border-top-color: var(--primary-light);
}

.kpi-red {
    border-top-color: var(--danger);
}

.kpi-orange {
    border-top-color: var(--warning);
}

.kpi-green {
    border-top-color: var(--success);
}

.kpi-yellow {
    border-top-color: var(--warning);
}

.kpi-purple {
    border-top-color: var(--purple);
}

.kpi-teal {
    border-top-color: var(--teal);
}

.kpi-icon {
    font-size: 28px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
}

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Dashboard Actions ─────────────────────────────────────── */
.dashboard-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ── Template Grid ─────────────────────────────────────────── */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.template-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 600;
}

.template-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.template-card p {
    font-size: 13px;
    color: var(--text-muted);
    flex: 1;
}

.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

/* ── Section Card ──────────────────────────────────────────── */
.section-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.section-header {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--bg);
    padding-bottom: 12px;
}

    .section-header h2 {
        font-size: 17px;
        font-weight: 700;
        color: var(--primary);
    }

.section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Fields ────────────────────────────────────────────────── */
.field-wrapper {
    margin-bottom: 18px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: border-color .2s;
}

    .field-wrapper:hover {
        border-color: var(--border);
    }

.field-success {
    background: rgba(6,214,160,.05);
    border-color: rgba(6,214,160,.3) !important;
}

.field-danger {
    background: rgba(239,35,60,.05);
    border-color: rgba(239,35,60,.3) !important;
}

.field-label {
    display: block;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text);
    margin-bottom: 8px;
}

.required-badge {
    color: var(--danger);
    margin-left: 4px;
}

.field-input, .field-select, .field-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s;
}

    .field-input:focus, .field-select:focus, .field-textarea:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(0,180,216,.12);
    }

/* ── Select/Option Dark Theme Fix ─────────────────────── */
select, .field-select, .adm-fi, .off-select, .usr-field select {
    color: var(--text);
    background-color: var(--surface);
}

    select option, .field-select option, .adm-fi option, .off-select option {
        background-color: #1C2A45;
        color: #F1F5F9;
        padding: 8px;
    }

/* ── Sim/Não Buttons ───────────────────────────────────────── */
.btn-group {
    display: flex;
    gap: 10px;
}

.btn-sim.btn-selected {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-nao.btn-selected {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* ── NC Badge ──────────────────────────────────────────────── */
.nc-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(239,35,60,.08);
    border: 1px solid rgba(239,35,60,.3);
    border-radius: 6px;
    font-size: 12px;
    color: var(--danger);
    font-weight: 600;
}

.nc-sub {
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-bar-wrapper {
    background: var(--border);
    border-radius: 20px;
    height: 8px;
    margin-bottom: 24px;
    position: relative;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    height: 100%;
    border-radius: 20px;
    transition: width .3s ease;
}

.progress-label {
    position: absolute;
    right: 0;
    top: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Errors ────────────────────────────────────────────────── */
.errors-box {
    background: rgba(239,35,60,.06);
    border: 1px solid rgba(239,35,60,.3);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

    .errors-box p {
        font-size: 13px;
        color: var(--danger);
        margin-bottom: 4px;
    }

/* ── Form Actions ──────────────────────────────────────────── */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ── Success Screen ────────────────────────────────────────── */
.success-screen {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    font-size: 72px;
    margin-bottom: 16px;
}

.success-screen h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.success-screen p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 6px;
    border: 1.5px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}

    .btn:disabled {
        opacity: .55;
        cursor: not-allowed;
    }

.btn-primary {
    background: linear-gradient(135deg, #22D3EE, #34D399);
    color: #0B1120;
    border-color: transparent;
    font-weight: 700;
}

    .btn-primary:hover:not(:disabled) {
        box-shadow: 0 4px 20px rgba(34,211,238,.25);
        transform: translateY(-1px);
    }

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

    .btn-secondary:hover:not(:disabled) {
        border-color: rgba(255,255,255,.15);
        background: rgba(255,255,255,.04);
    }

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-selected {
    background: var(--primary);
    color: #0B1120;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
}

.badge-active {
    background: rgba(52,211,153,.12);
    color: #34D399;
}

.badge-inactive {
    background: rgba(100,116,139,.15);
    color: #94A3B8;
}

.badge-warning {
    background: rgba(251,191,36,.12);
    color: #FBBF24;
}

.badge-danger {
    background: rgba(251,113,133,.12);
    color: #FB7185;
}

.badge-info {
    background: rgba(34,211,238,.12);
    color: #22D3EE;
}

/* ── Data Table ────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

    .data-table th {
        padding: 12px 16px;
        text-align: left;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .7px;
        color: var(--text-muted);
        background: var(--bg);
        border-bottom: 2px solid var(--border);
    }

    .data-table td {
        padding: 12px 16px;
        font-size: 13.5px;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
    }

    .data-table tr:last-child td {
        border-bottom: none;
    }

    .data-table tr:hover td {
        background: rgba(0,180,216,.03);
    }

.row-danger td {
    background: rgba(239,35,60,.04);
}

/* ── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    font-weight: 500;
    color: var(--text-muted);
}

    .filter-btn.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

/* ── States ────────────────────────────────────────────────── */
.loading, .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 15px;
}

    .empty-state small {
        display: block;
        margin-top: 8px;
        font-size: 12px;
    }

/* ── Foto field ────────────────────────────────────────────── */
.foto-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.foto-preview {
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* ── Not found ─────────────────────────────────────────────── */
.not-found {
    text-align: center;
    padding: 80px 20px;
}

    .not-found h2 {
        font-size: 22px;
        color: var(--primary);
        margin-bottom: 12px;
    }

    .not-found a {
        color: var(--accent);
    }

/* ── Login ─────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E3A5F 0%, #2E86AB 60%, #00B4D8 100%);
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 48px 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 80px rgba(0,0,0,.25);
    animation: fadeUp .4s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Brand */
.login-brand {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #1E3A5F, #00B4D8);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    font-weight: 900;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0,180,216,.35);
}

.login-brand h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 6px;
    letter-spacing: -.3px;
}

.login-brand p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Form */
.login-form .form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

    .form-input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(34,211,238,.15);
        background: var(--surface);
    }

    .form-input::placeholder {
        color: var(--text-muted);
    }

/* Error */
.login-erro {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(251,113,133,.06);
    border: 1.5px solid #FFCCD5;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    color: #EF233C;
    margin-bottom: 16px;
}

/* Button */
.login-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #1E3A5F, #2E86AB);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .1s;
    margin-top: 4px;
    letter-spacing: .2px;
}

    .login-btn:hover:not(:disabled) {
        opacity: .9;
        transform: translateY(-1px);
    }

    .login-btn:active:not(:disabled) {
        transform: translateY(0);
    }

    .login-btn:disabled {
        opacity: .65;
        cursor: not-allowed;
    }

/* Spinner */
.login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Hint */
.login-hint {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

    .login-hint p {
        font-size: 12px;
        color: var(--text-muted);
        line-height: 1.9;
    }

    .login-hint strong {
        color: var(--text);
    }

/* ── Sidebar user ──────────────────────────────────────────── */
.sidebar-user {
    padding: 13px 14px;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(0,0,0,.22);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #00B4D8 0%, #0077A8 100%);
    color: #fff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,180,216,.35);
    text-transform: uppercase;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.user-name {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: .7px;
}

.user-role {
    font-size: 9.5px;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: .8px;
    font-weight: 700;
}

.btn-logout {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255,255,255,.38);
    font-size: 15px;
    padding: 6px 9px;
    line-height: 1;
    transition: all .15s;
    flex-shrink: 0;
}

    .btn-logout:hover {
        background: rgba(239,35,60,.15);
        border-color: rgba(239,35,60,.35);
        color: var(--danger);
    }

/* ── Audit table ───────────────────────────────────────────── */
.audit-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    font-family: monospace;
}

.audit-user {
    display: flex;
    flex-direction: column;
}

.user-nome {
    font-weight: 600;
    font-size: 13px;
}

.user-email {
    font-size: 11px;
    color: var(--text-muted);
}

.valor-anterior {
    color: var(--danger);
    text-decoration: line-through;
    font-size: 12px;
}

.valor-novo {
    color: var(--success);
    font-weight: 600;
    font-size: 12px;
}

.text-muted {
    color: var(--text-muted);
}

.audit-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.search-bar {
    margin-bottom: 16px;
}


/* ── Action buttons ─────────────────────────────────────────── */
.action-btns {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    transition: opacity .2s;
}

    .btn-danger:hover {
        opacity: .85;
    }

.text-success {
    color: var(--success);
    font-weight: 700;
}

.text-danger {
    color: var(--danger);
    font-weight: 700;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: var(--surface);
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

    .modal-box h3 {
        margin: 0 0 12px;
        color: var(--primary);
        font-size: 18px;
    }

    .modal-box p {
        margin: 0 0 8px;
        font-size: 14px;
    }

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ── Period Filter ──────────────────────────────────────────── */
.period-filter-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.period-filter-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.period-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.preset-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

    .preset-btn:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

    .preset-btn.active {
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
        font-weight: 600;
    }

.period-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.period-input-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .period-input-group label {
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: .5px;
    }

.period-input {
    padding: 7px 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    outline: none;
    cursor: pointer;
    transition: border-color .15s;
}

    .period-input:focus {
        border-color: var(--accent);
    }

.period-sep {
    font-size: 18px;
    color: var(--text-muted);
    margin-top: 14px;
}

/* ══════════════════════════════════════════════════════════════
   Inspeções Realizadas
   ══════════════════════════════════════════════════════════════ */

/* Header */
.inspecoes-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.btn-nova-inspecao {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(30,58,95,.3);
    transition: transform .15s, box-shadow .15s;
}

    .btn-nova-inspecao:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(30,58,95,.4);
    }

.btn-nova-icon {
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

/* ── Painel Nova Inspeção ───────────────────────────────────── */
.nova-inspecao-form {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 40px rgba(0,0,0,.1);
    margin-bottom: 28px;
    overflow: hidden;
    animation: slideDown .2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nova-inspecao-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: rgba(34,211,238,.04);
    border-bottom: 1px solid var(--border);
}

.nova-inspecao-form-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nova-inspecao-form-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(30,58,95,.25);
}

.nova-inspecao-form-title h2 {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.nova-inspecao-form-title p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.btn-fechar-form {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

    .btn-fechar-form:hover {
        background: var(--danger);
        color: #fff;
        border-color: var(--danger);
    }

/* Grid de tipos */
.nova-inspecao-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    padding: 24px;
}

.tipo-checklist-card {
    position: relative;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 18px 16px;
    text-align: left;
    cursor: pointer;
    transition: all .18s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .tipo-checklist-card:hover {
        border-color: var(--accent);
        background: rgba(34,211,238,.06);
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0,180,216,.15);
    }

    .tipo-checklist-card.selected {
        border-color: var(--accent);
        background: rgba(34,211,238,.08);
        box-shadow: 0 4px 20px rgba(0,180,216,.2);
    }

.tipo-checklist-categoria {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
}

.tipo-checklist-nome {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.3;
}

.tipo-checklist-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.tipo-checklist-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
}

.nova-inspecao-loading, .nova-inspecao-empty {
    padding: 32px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.nova-inspecao-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.btn-iniciar {
    padding: 11px 28px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

    .btn-iniciar:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Toolbar ────────────────────────────────────────────────── */
.inspecoes-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ── Lista de inspeções (cards) ─────────────────────────────── */
.inspecoes-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inspecao-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow .15s, transform .15s;
}

    .inspecao-card:hover {
        box-shadow: 0 4px 20px rgba(0,0,0,.08);
        transform: translateY(-1px);
    }

.inspecao-card-left {
    flex-shrink: 0;
}

.inspecao-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
}

.dot-green {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(6,214,160,.2);
}

.dot-yellow {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(255,183,3,.2);
}

.dot-red {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239,35,60,.2);
}

.inspecao-card-body {
    flex: 1;
    min-width: 0;
}

.inspecao-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.inspecao-nome {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

.inspecao-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.inspecao-taxa {
    font-weight: 700;
}

.inspecao-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-acao {
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.btn-acao-primary {
    background: var(--primary);
    color: #fff;
}

    .btn-acao-primary:hover {
        background: var(--primary-light);
    }

.btn-acao-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

    .btn-acao-secondary:hover {
        background: rgba(255,255,255,.05);
    }

.btn-acao-danger {
    background: rgba(239,35,60,.08);
    color: var(--danger);
    border: 1px solid rgba(239,35,60,.2);
    padding: 7px 10px;
}

    .btn-acao-danger:hover {
        background: var(--danger);
        color: #fff;
    }

/* ── Empty state ────────────────────────────────────────────── */
.inspecoes-empty {
    text-align: center;
    padding: 64px 32px;
    color: var(--text-muted);
}

.inspecoes-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.inspecoes-empty h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.inspecoes-empty p {
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
   Responsável NC — Estilos
   ═══════════════════════════════════════════════════════════ */

/* ── Seletor de responsável inline (DynamicChecklist) ──── */
.nc-responsavel-box {
    background: rgba(239,35,60,.04);
    border: 1px solid rgba(239,35,60,.15);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nc-responsavel-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--danger);
    letter-spacing: .3px;
}

.nc-responsavel-select {
    max-width: 380px;
}

/* ── Tag de responsável na tabela ──────────────────────── */
.responsavel-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(30,58,95,.06);
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.responsavel-vazio {
    color: var(--text-muted);
    background: transparent;
    font-weight: 400;
    font-style: italic;
}

/* ── Actions cell ──────────────────────────────────────── */
.actions-cell {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Botão accent ──────────────────────────────────────── */
.btn-accent {
    background: var(--accent);
    color: #fff;
    border: none;
    font-weight: 600;
}

    .btn-accent:hover {
        background: var(--primary-light);
    }

/* ── Modal overlay ─────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn .15s ease;
}

.modal-card {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: 95%;
    max-width: 500px;
    overflow: hidden;
    animation: slideUp .2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

    .modal-header h3 {
        font-size: 17px;
        font-weight: 800;
        color: var(--primary);
    }

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: all .15s;
}

    .modal-close:hover {
        background: var(--bg);
        color: var(--danger);
    }

.modal-body {
    padding: 22px;
}

.modal-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ════════════════════════════════════════════════════
   CRIAR TEMPLATE — NOVO DESIGN 
   ════════════════════════════════════════════════════ */

/* ── Sticky header bar ────────────────────────────── */
.ct-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(19,27,46,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 0;
    margin: -24px -32px 24px;
    padding-left: 32px;
    padding-right: 32px;
    border-bottom: 1px solid var(--border);
}

.ct-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ct-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ct-header-back {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}

    .ct-header-back:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

.ct-header-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.ct-header-right {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ct-btn {
    padding: 9px 20px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}

.ct-btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

    .ct-btn-ghost:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

.ct-btn-primary {
    background: var(--primary);
    color: #fff;
}

    .ct-btn-primary:hover {
        background: var(--primary-light);
    }

/* ── Two-column layout ────────────────────────────── */
.ct-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 920px) {
    .ct-grid {
        grid-template-columns: 1fr;
    }

    .ct-panel {
        position: static !important;
    }
}

/* ── Left panel (sticky) ──────────────────────────── */
.ct-panel {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ct-panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.ct-panel-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 16px 18px 0;
}

.ct-panel-body {
    padding: 12px 18px 18px;
}

/* ── Panel form fields ────────────────────────────── */
.ct-pf {
    margin-bottom: 14px;
}

    .ct-pf:last-child {
        margin-bottom: 0;
    }

    .ct-pf label {
        display: block;
        font-size: 12px;
        font-weight: 700;
        color: var(--text);
        margin-bottom: 6px;
    }

        .ct-pf label .req {
            color: var(--danger);
        }

    .ct-pf input, .ct-pf textarea, .ct-pf select {
        width: 100%;
        padding: 9px 12px;
        border: 1.5px solid var(--border);
        border-radius: 8px;
        font-size: 13px;
        font-family: inherit;
        color: var(--text);
        background: rgba(255,255,255,.03);
        transition: all .15s;
    }

        .ct-pf input:focus, .ct-pf textarea:focus, .ct-pf select:focus {
            outline: none;
            border-color: var(--accent);
            background: var(--surface);
            box-shadow: 0 0 0 3px rgba(0,180,216,.08);
        }

    .ct-pf textarea {
        resize: vertical;
        min-height: 64px;
    }

/* ── Mini stat counters ───────────────────────────── */
.ct-counters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 14px 18px 18px;
}

.ct-counter {
    text-align: center;
    padding: 10px 8px;
    background: rgba(255,255,255,.03);
    border-radius: 8px;
}

.ct-counter-val {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

    .ct-counter-val.danger {
        color: var(--danger);
    }

.ct-counter-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Seção index nav ──────────────────────────────── */
.ct-secnav {
    padding: 8px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ct-secnav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all .12s;
    text-align: left;
    width: 100%;
    font-family: inherit;
}

    .ct-secnav-item:hover {
        background: rgba(255,255,255,.03);
    }

.ct-secnav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.ct-secnav-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-secnav-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255,255,255,.05);
    padding: 2px 7px;
    border-radius: 6px;
}

/* ════════════════════════════════════════════════════
   MAIN — SEÇÕES E PERGUNTAS
   ════════════════════════════════════════════════════ */
.ct-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* ── Seção container ──────────────────────────────── */
.ct-sec {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color .2s;
}

    .ct-sec:hover {
        border-color: var(--text-muted);
    }

/* ── Seção header ─────────────────────────────────── */
.ct-sec-head {
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.ct-sec-num {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ct-sec-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ct-sec-title-input {
    border: none;
    background: transparent;
    font-size: 17px;
    font-weight: 800;
    color: var(--primary);
    width: 100%;
    padding: 2px 0;
    font-family: inherit;
}

    .ct-sec-title-input:focus {
        outline: none;
    }

    .ct-sec-title-input::placeholder {
        color: #B8C4D0;
        font-weight: 700;
    }

.ct-sec-desc-input {
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-muted);
    width: 100%;
    padding: 2px 0;
    font-family: inherit;
}

    .ct-sec-desc-input:focus {
        outline: none;
        color: var(--text);
    }

    .ct-sec-desc-input::placeholder {
        color: var(--text-muted);
    }

.ct-sec-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding-top: 4px;
}

.ct-sec-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255,255,255,.05);
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.ct-sec-del {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

    .ct-sec-del:hover {
        background: rgba(239,35,60,.06);
        border-color: rgba(239,35,60,.2);
        color: var(--danger);
    }

/* ── Pergunta list ────────────────────────────────── */
.ct-questions {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Pergunta item ────────────────────────────────── */
.ct-q {
    display: flex;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: all .2s;
    background: var(--surface);
}

    .ct-q:hover {
        border-color: var(--text-muted);
        box-shadow: 0 2px 8px rgba(0,0,0,.04);
    }

    .ct-q.nc {
        border-color: rgba(239,35,60,.18);
    }

        .ct-q.nc:hover {
            border-color: rgba(239,35,60,.3);
        }

/* Barra de tipo lateral */
.ct-q-bar {
    width: 5px;
    flex-shrink: 0;
    border-radius: 0;
}

    .ct-q-bar.tipo-simnao {
        background: var(--success);
    }

    .ct-q-bar.tipo-texto {
        background: var(--primary-light);
    }

    .ct-q-bar.tipo-numero {
        background: var(--warning);
    }

    .ct-q-bar.tipo-foto {
        background: var(--teal, #0D9488);
    }

    .ct-q-bar.tipo-selecao {
        background: var(--purple, #7B2D8B);
    }

    .ct-q-bar.tipo-multi {
        background: #4338CA;
    }

    .ct-q-bar.tipo-data {
        background: #F97316;
    }

.ct-q-body {
    flex: 1;
    padding: 16px 18px;
    min-width: 0;
}

/* Linha 1: numeração + input de pergunta + actions */
.ct-q-row1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ct-q-num {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    background: rgba(255,255,255,.03);
    padding: 3px 9px;
    border-radius: 6px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.ct-q-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    padding: 4px 0;
    font-family: inherit;
    min-width: 0;
}

    .ct-q-input:focus {
        outline: none;
    }

    .ct-q-input::placeholder {
        color: var(--text-muted);
        font-weight: 500;
    }

.ct-q-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s;
    flex-shrink: 0;
}

.ct-q:hover .ct-q-actions {
    opacity: 1;
}

.ct-q-act {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .1s;
    font-size: 12px;
}

    .ct-q-act:hover {
        background: rgba(255,255,255,.05);
        color: var(--primary);
    }

    .ct-q-act.del:hover {
        background: rgba(239,35,60,.06);
        color: var(--danger);
    }

/* Linha 2: tipo + criticidade + toggles */
.ct-q-row2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Compact select pill */
.ct-sel-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 4px 0 10px;
    gap: 4px;
    height: 32px;
}

.ct-sel-pill-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    white-space: nowrap;
}

.ct-sel-pill select {
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    padding: 4px 2px;
    cursor: pointer;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

    .ct-sel-pill select:focus {
        outline: none;
    }

/* Toggle switch */
.ct-sw {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    transition: background .12s;
}

    .ct-sw:hover {
        background: rgba(255,255,255,.03);
    }

    .ct-sw input {
        display: none;
    }

.ct-sw-track {
    width: 34px;
    height: 18px;
    border-radius: 9px;
    background: rgba(255,255,255,.1);
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}

    .ct-sw-track::after {
        content: "";
        position: absolute;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: var(--surface);
        top: 2px;
        left: 2px;
        transition: transform .2s;
        box-shadow: 0 1px 3px rgba(0,0,0,.12);
    }

.ct-sw input:checked + .ct-sw-track {
    background: var(--accent);
}

    .ct-sw input:checked + .ct-sw-track::after {
        transform: translateX(16px);
    }

.ct-sw.nc-toggle input:checked + .ct-sw-track {
    background: var(--danger);
}

.ct-sw-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Opções (tipo seleção) ────────────────────────── */
.ct-opts {
    margin-top: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}

.ct-opts-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.ct-opt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ct-opt-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    flex-shrink: 0;
}

.ct-opt-input {
    flex: 1;
    border: 1.5px solid var(--border);
    background: var(--surface);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    transition: border-color .15s;
}

    .ct-opt-input:focus {
        outline: none;
        border-color: var(--accent);
    }

.ct-opt-nc {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

    .ct-opt-nc input {
        width: 14px;
        height: 14px;
        accent-color: var(--danger);
        cursor: pointer;
    }

    .ct-opt-nc span {
        font-size: 9px;
        font-weight: 900;
        color: var(--danger);
        letter-spacing: .3px;
    }

.ct-opt-del {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all .1s;
}

    .ct-opt-del:hover {
        color: var(--danger);
        background: rgba(239,35,60,.04);
    }

.ct-opt-add {
    border: none;
    background: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0 0;
    font-family: inherit;
}

    .ct-opt-add:hover {
        color: var(--primary-light);
    }

/* ── NC auto-hint ─────────────────────────────────── */
.ct-nc-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(239,35,60,.03);
    border: 1px solid rgba(239,35,60,.1);
    border-radius: 7px;
    font-size: 12px;
    color: var(--danger);
    font-weight: 500;
}

/* ── Add question button ──────────────────────────── */
.ct-add-q {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: transparent;
    border: none;
    border-top: 1px dashed #E2E8F0;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}

    .ct-add-q:hover {
        background: rgba(0,180,216,.03);
        color: var(--primary-light);
    }

/* ── Add section button ───────────────────────────── */
.ct-add-sec {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 22px;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: 14px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}

    .ct-add-sec:hover {
        border-color: var(--primary);
        background: rgba(30,58,95,.015);
    }

/* ── Errors ────────────────────────────────────────── */
.ct-errors {
    background: rgba(239,35,60,.04);
    border: 1px solid rgba(239,35,60,.15);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

    .ct-errors p {
        font-size: 13px;
        color: var(--danger);
        margin-bottom: 2px;
    }
