/* =====================================================
   Ana Cristina Bem-Casados — Sistema de Gestão
   Regra: fundo colorido = letra branca | fundo branco = letra preta
   ===================================================== */

:root {
    --sidebar-w:        230px;
    --sidebar-bg:       #1e4a30;
    --sidebar-hover:    rgba(255,255,255,0.1);
    --sidebar-active:   rgba(255,255,255,0.18);
    --sidebar-border:   rgba(255,255,255,0.1);
    --accent:           #6dba90;
    --accent-light:     #c6e8d4;
    --accent-dark:      #3d8a60;
    --fundo:            #f2f8f4;
    --fundo-card:       #ffffff;
    --texto:            #000000;
    --subtexto:         #444444;
    --borda:            #c4ddd0;
    --topbar-h:         56px;
    --fonte:            Arial, sans-serif;
}

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

body {
    font-family: var(--fonte);
    background: var(--fundo);
    color: var(--texto);
    display: flex;
    min-height: 100vh;
}

/* =====================================================
   SIDEBAR — fundo colorido → letras brancas
   ===================================================== */

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 22px 18px 18px;
    border-bottom: 1px solid var(--sidebar-border);
}

.logo-mark {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--fonte);
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.logo-nome {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

.logo-sub {
    font-size: 10px;
    color: #ffffff;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.75;
}

/* Navegação */
.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group {
    margin-top: 10px;
}

.nav-group-label {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #ffffff;
    opacity: 1;
    padding: 10px 10px 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s;
}
.nav-group-label:hover { opacity: 1; }
.nav-group-label .group-chevron {
    font-size: 10px;
    transition: transform 0.2s;
}
.nav-group.collapsed .nav-group-label .group-chevron {
    transform: rotate(-90deg);
}
.nav-group-items {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease;
}
.nav-group.collapsed .nav-group-items {
    max-height: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: normal;
    transition: all 0.15s ease;
    cursor: pointer;
}

.nav-item i {
    font-size: 15px;
    width: 17px;
    text-align: center;
    color: #ffffff;
}

.nav-item.sub {
    padding: 8px 12px 8px 16px;
    font-size: 14px;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: #ffffff;
    font-weight: bold;
}

.nav-badge {
    background: #c0392b;
    color: #fff;
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: bold;
    margin-left: auto;
    line-height: 1.6;
}

/* ── Submenu expansível (Estoque) ── */
.nav-expandable {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 16px;
    color: #ffffff;
    font-size: 14px;
    user-select: none;
    transition: background 0.15s;
}
.nav-expandable:hover { background: var(--sidebar-hover); color: #fff; }
.nav-expandable.open  { color: #fff; }
.nav-expandable i.nav-chevron {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
}
.nav-expandable.open i.nav-chevron { transform: rotate(180deg); }
.nav-subitems {
    display: none;
    overflow: hidden;
}
.nav-subitems.open { display: block; }
.nav-item.sub2 {
    padding: 6px 12px 6px 36px;
    font-size: 12px;
}

/* Footer da sidebar */
.sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-nome {
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-tipo {
    font-size: 10px;
    color: #ffffff;
    opacity: 0.65;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.sidebar-logout {
    color: #ffffff;
    font-size: 15px;
    text-decoration: none;
    padding: 6px;
    border-radius: 6px;
    opacity: 0.6;
    transition: all 0.15s;
    flex-shrink: 0;
}

.sidebar-logout:hover {
    opacity: 1;
    background: var(--sidebar-hover);
    color: #ffffff;
}

/* =====================================================
   WRAPPER PRINCIPAL
   ===================================================== */

.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar — fundo branco → letras pretas */
.topbar {
    height: var(--topbar-h);
    background: #ffffff;
    border-bottom: 1px solid var(--borda);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 18px;
    font-weight: bold;
    color: #000000;
}

.topbar-date {
    font-size: 12px;
    color: #444444;
}

/* Conteúdo */
.main-content {
    padding: 28px 28px 48px;
    flex: 1;
}

/* =====================================================
   HOME — Cards → fundo branco → letras pretas
   ===================================================== */

.welcome-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #ffffff;
    border: 1px solid var(--borda);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    padding: 22px 24px;
    margin-bottom: 28px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.home-logo-centro {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 60px;
}

.home-logo-fundo {
    width: 320px;
    max-width: 60%;
    height: auto;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.welcome-text h2 {
    font-size: 18px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 4px;
}

.welcome-text p {
    font-size: 13px;
    color: #444444;
}

/* Grid de atalhos */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--borda);
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #000000;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(109,186,144,0.2);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--sidebar-bg);
}

.stat-icon i {
    font-size: 18px;
    color: #ffffff;
}

.stat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-label {
    font-size: 14px;
    font-weight: bold;
    color: #000000;
}

.stat-hint {
    font-size: 11.5px;
    color: #444444;
    margin-top: 2px;
}

.stat-arrow {
    font-size: 12px;
    color: #cccccc;
    flex-shrink: 0;
}

.stat-card:hover .stat-arrow {
    color: var(--accent);
}

/* =====================================================
   LOGIN — painel esquerdo colorido → branco
              painel direito branco → preto
   ===================================================== */

.login-page {
    background: var(--fundo);
    min-height: 100vh;
    display: block;
}

.login-split {
    display: flex;
    min-height: 100vh;
}

/* Painel esquerdo — fundo colorido → letras brancas */
.login-panel-left {
    width: 42%;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

.login-panel-left::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}

.login-panel-left::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
}

.login-logo-img {
    display: block;
    max-width: 260px;
    width: 80%;
    height: auto;
    object-fit: contain;
    margin: 0 auto 40px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.25));
}

.login-quote {
    font-size: 15px;
    color: #ffffff;
    text-align: center;
    line-height: 1.8;
    font-style: italic;
    opacity: 0.6;
    position: relative;
    z-index: 1;
}

/* Painel direito — fundo branco → letras pretas */
.login-panel-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: #ffffff;
}

.login-form-wrap {
    width: 100%;
    max-width: 360px;
}

.login-form-title {
    font-size: 22px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 6px;
}

.login-form-sub {
    font-size: 13px;
    color: #444444;
    margin-bottom: 28px;
}

.login-erro {
    background: #fde8e8;
    color: #a03030;
    border: 1px solid #f5c0c0;
    border-radius: 6px;
    padding: 11px 14px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000000;
    margin-bottom: 7px;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #bbbbbb;
    pointer-events: none;
    transition: color 0.2s;
}

.login-input-wrap input {
    width: 100%;
    padding: 11px 14px 11px 38px;
    border: 1px solid var(--borda);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--fonte);
    color: #000000;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.login-input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(109,186,144,0.2);
}

.login-input-wrap:focus-within i {
    color: var(--accent);
}

/* Botão login — fundo colorido → letra branca */
.login-btn {
    width: 100%;
    background: var(--sidebar-bg);
    color: #ffffff;
    border: none;
    padding: 13px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    font-family: var(--fonte);
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    transition: background 0.2s;
}

.login-btn:hover {
    background: var(--accent-dark);
    color: #ffffff;
}

.login-copy {
    text-align: center;
    font-size: 11px;
    color: #aaaaaa;
    margin-top: 28px;
}

/* =====================================================
   MÓDULOS — Barra de ações do módulo
   ===================================================== */

.modulo-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 18px;
    gap: 10px;
}

.modulo-acoes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Botão de ação (ex: Novo, Pesquisar) — fundo colorido → branco */
.btn-acao {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--sidebar-bg);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--fonte);
    font-weight: normal;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-acao:hover {
    background: var(--accent-dark);
    color: #ffffff;
}

/* =====================================================
   FORMULÁRIOS — form-card, form-grid, fg-col-*
   ===================================================== */

.form-card {
    background: #ffffff;
    border: 1px solid var(--borda);
    border-radius: 10px;
    padding: 14px 16px 6px;
    margin-bottom: 14px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.form-card-title {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sidebar-bg);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--borda);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.fg-col-1  { grid-column: span 1; }
.fg-col-2  { grid-column: span 2; }
.fg-col-3  { grid-column: span 3; }
.fg-col-4  { grid-column: span 4; }
.fg-col-5  { grid-column: span 5; }
.fg-col-6  { grid-column: span 6; }
.fg-col-7  { grid-column: span 7; }
.fg-col-8  { grid-column: span 8; }
.fg-col-9  { grid-column: span 9; }
.fg-col-full { grid-column: 1 / -1; }

/* Labels e inputs nos formulários */
.form-card label,
.form-grid label {
    display: block;
    font-size: 10.5px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #000000;
    margin-bottom: 3px;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="date"],
.form-card input[type="time"],
.form-card input[type="number"],
.form-card input[type="password"],
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--borda);
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--fonte);
    color: #000000;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(109,186,144,0.18);
}

.form-card textarea {
    resize: vertical;
    min-height: 60px;
}

.input-readonly {
    background: var(--fundo) !important;
    color: #666666 !important;
    cursor: default !important;
}

.obrig {
    color: #c0392b;
    font-size: 13px;
}

/* Checkbox "Endereço sem CEP" */
.sem-cep-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-family: var(--fonte);
    color: #555;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.sem-cep-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-dark);
    cursor: pointer;
    flex-shrink: 0;
}

/* Badge de desconto antecipado (Pagamento x Data do Evento) */
.pag-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: bold;
    padding: 7px 12px;
    border-radius: 6px;
    line-height: 1.3;
}
.pag-badge-ok {
    color: #1e5e3a;
    background: #d1f0e0;
    border: 1.5px solid #3d8a60;
}
.pag-badge-warn {
    color: #7a4100;
    background: #fde9cc;
    border: 1.5px solid #d97b10;
}
.pag-badge-block {
    color: #7b1a1a;
    background: #fde8e8;
    border: 1.5px solid #e53935;
}

/* Aviso compacto de preenchimento automático (CEP) */
.campo-aviso {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: bold;
    color: #7b1a1a;
    background: #fde8e8;
    border: 1.5px solid #e53935;
    border-left: 5px solid #e53935;
    border-radius: 5px;
    padding: 6px 12px;
    line-height: 1.4;
    margin: 4px 0 8px;
    box-shadow: 0 1px 4px rgba(229,57,53,.15);
}

/* Feedback visual de campo inválido */
.campo-invalido {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.18) !important;
}

/* ── Autocomplete de Cliente (Contratos) ── */
.cliente-autocomplete { position: relative; }

.cliente-input-busca {
    display: flex;
    align-items: center;
    border: 1px solid var(--borda);
    border-radius: 7px;
    background: #ffffff;
    padding: 0 12px;
    gap: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: text;
}

.cliente-input-busca:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(109,186,144,0.18);
}

.cliente-input-busca i { color: #888; font-size: 13px; flex-shrink: 0; }

.cliente-input-busca input {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 10px 0 !important;
    flex: 1;
    background: transparent !important;
    font-size: 13px;
    font-family: var(--fonte);
    color: #000;
    min-width: 0;
}

.cliente-dropdown {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #ffffff;
    border: 1px solid var(--borda);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 400;
    box-shadow: 0 8px 24px rgba(0,0,0,0.13);
}

.cliente-dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--fonte);
    border-bottom: 1px solid #f5f5f5;
    color: #000;
    line-height: 1.4;
}
.cliente-dropdown-item:last-child { border-bottom: none; }
.cliente-dropdown-item b { color: var(--sidebar-bg); }
.cliente-dropdown-item:hover { background: var(--accent-light); }

.cliente-nenhum {
    padding: 12px 14px;
    font-size: 13px;
    color: #888;
    font-style: italic;
}

.cliente-selecionado-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 11px 16px;
    font-size: 13px;
    font-family: var(--fonte);
    color: var(--sidebar-bg);
    margin-top: 6px;
}
.cliente-selecionado-card .cs-icone { font-size: 16px; flex-shrink: 0; color: var(--accent-dark); }
.cliente-selecionado-card .cs-nome  { flex: 1; font-weight: bold; color: #000; }
.cliente-selecionado-card .cs-cod   {
    background: var(--sidebar-bg); color: #fff;
    border-radius: 4px; padding: 2px 9px;
    font-size: 11px; font-weight: bold; letter-spacing: 0.5px; flex-shrink: 0;
}
.btn-trocar-cliente {
    background: none;
    border: 1px solid var(--accent-dark);
    color: var(--accent-dark);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-family: var(--fonte);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}
.btn-trocar-cliente:hover { background: var(--accent-dark); color: #fff; }

/* ── Forma de Pagamento — pills ── */
.forma-pag-grupo { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.forma-pag-opcao { display: none; }
.forma-pag-label {
    padding: 7px 16px;
    border: 1px solid var(--borda);
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--fonte);
    color: #555;
    transition: all 0.18s;
    user-select: none;
    white-space: nowrap;
}
.forma-pag-label:hover { border-color: var(--accent-dark); color: var(--accent-dark); }
.forma-pag-nenhuma { font-style: italic; color: #999; }
.forma-pag-opcao:checked + .forma-pag-label {
    background: var(--sidebar-bg);
    border-color: var(--sidebar-bg);
    color: #fff;
    font-weight: bold;
}
.forma-pag-opcao:checked + .forma-pag-nenhuma {
    background: #e5e5e5;
    border-color: #bbb;
    color: #888;
    font-weight: normal;
    font-style: italic;
}

/* Botões de ação do formulário */
.form-botoes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn-salvar {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--sidebar-bg);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--fonte);
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-salvar:hover { background: var(--accent-dark); color: #ffffff; }

.btn-continuar {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--accent-dark);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--fonte);
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-continuar:hover { background: var(--sidebar-bg); color: #ffffff; }

.btn-limpar {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #f39c12;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--fonte);
    font-weight: normal;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-limpar:hover { background: #d68910; color: #ffffff; }

.btn-excluir {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #c0392b;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--fonte);
    font-weight: normal;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-excluir:hover { background: #96281b; color: #ffffff; }

.btn-cancelar {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #ffffff;
    color: #000000;
    border: 1px solid var(--borda);
    padding: 10px 20px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--fonte);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-cancelar:hover {
    background: var(--fundo);
    color: #000000;
}

/* =====================================================
   PESQUISA — barra de busca e tabela de resultados
   ===================================================== */

.pesquisa-card {
    background: #ffffff;
    border: 1px solid var(--borda);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.pesquisa-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pesquisa-input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid var(--borda);
    border-radius: 7px;
    font-size: 14px;
    font-family: var(--fonte);
    color: #000000;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pesquisa-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(109,186,144,0.18);
}

.btn-pesquisar {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--sidebar-bg);
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--fonte);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-pesquisar:hover { background: var(--accent-dark); }

.tabela-card {
    background: #ffffff;
    border: 1px solid var(--borda);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.tabela-info {
    padding: 12px 20px;
    font-size: 12px;
    color: #444444;
    border-bottom: 1px solid var(--borda);
    background: var(--fundo);
}

.tabela-wrap {
    overflow-x: auto;
}

.tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #000000;
}

.tabela thead tr {
    background: var(--sidebar-bg);
}

.tabela thead th {
    padding: 11px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #ffffff;
    white-space: nowrap;
}

.tabela tbody tr {
    border-bottom: 1px solid var(--borda);
    transition: background 0.1s;
}

.tabela tbody tr:last-child { border-bottom: none; }

.tabela tbody tr:hover { background: var(--fundo); }

.tabela tbody td {
    padding: 10px 14px;
    color: #000000;
}

.td-acao {
    text-align: right;
    white-space: nowrap;
}

.link-abrir {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.15s;
}

.link-abrir:hover {
    background: var(--accent-light);
    color: var(--sidebar-bg);
}

.sem-resultado {
    text-align: center;
    padding: 40px 20px;
    color: #666666;
    font-size: 14px;
    background: #ffffff;
    border: 1px solid var(--borda);
    border-radius: 10px;
}

/* =====================================================
   TABS (Bootstrap override) — abas de formulário
   ===================================================== */

.nav-tabs {
    border-bottom: 2px solid var(--borda);
    margin-bottom: 20px;
    gap: 4px;
}

.nav-tabs .nav-link {
    color: #444444;
    font-size: 13px;
    font-family: var(--fonte);
    border: 1px solid transparent;
    border-radius: 7px 7px 0 0;
    padding: 9px 18px;
    font-weight: normal;
}

.nav-tabs .nav-link:hover {
    color: var(--sidebar-bg);
    background: var(--fundo);
    border-color: var(--borda);
}

.nav-tabs .nav-link.active {
    color: #ffffff;
    background: var(--sidebar-bg);
    border-color: var(--sidebar-bg);
    font-weight: bold;
}

/* Badge de status */
.badge-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ativo    { background: #d4edda; color: #155724; }
.badge-inativo  { background: #f8d7da; color: #721c24; }
.badge-aberto   { background: #cce5ff; color: #004085; }
.badge-fechado  { background: #d4edda; color: #155724; }
.badge-cancelado { background: #f8d7da; color: #721c24; }
.badge-finalizado { background: #e2e3e5; color: #383d41; }
.badge-admin    { background: var(--sidebar-bg); color: #ffffff; }
.badge-usuario  { background: var(--accent-light); color: var(--sidebar-bg); }

/* =====================================================
   CONFIGURAÇÕES — página de configuração do sistema
   ===================================================== */

.cfg-logo-preview {
    width: 160px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border: 1px solid var(--borda);
    border-radius: 8px;
    padding: 10px;
    background: var(--fundo);
}

.cfg-file-input {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-family: var(--fonte);
    color: #444;
}

.cfg-slider {
    display: block;
    width: 100%;
    margin-top: 8px;
    accent-color: var(--accent-dark);
}

.cfg-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.cfg-frase-preview {
    background: var(--sidebar-bg);
    color: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-style: italic;
    text-align: center;
    line-height: 1.6;
    min-width: 120px;
}

/* =====================================================
   MODO VISUALIZAR — campos somente-leitura
   ===================================================== */

.modo-visualizar input:not([type="hidden"]):not([type="submit"]):not(.input-readonly),
.modo-visualizar textarea {
    background: var(--fundo) !important;
    color: #444 !important;
    cursor: default !important;
    user-select: text !important;
}

.modo-visualizar select:disabled,
.modo-visualizar input[type="date"]:disabled,
.modo-visualizar input[type="time"]:disabled {
    background: var(--fundo) !important;
    color: #444 !important;
    cursor: default !important;
    opacity: 1 !important;
}

/* ── Botão Editar ── */
.btn-editar {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #e67e22;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--fonte);
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-editar:hover { background: #ca6f1e; color: #ffffff; }

/* =====================================================
   MODAL DE CONFIRMAÇÃO DE EDIÇÃO
   ===================================================== */

.mc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mc-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 28px 30px 24px;
    max-width: 680px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mc-titulo {
    font-size: 16px;
    font-family: var(--fonte);
    font-weight: bold;
    color: var(--sidebar-bg);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mc-sub {
    font-size: 13px;
    color: #444;
    font-family: var(--fonte);
    margin: 0;
}

.mc-tabela-wrap {
    overflow-y: auto;
    border: 1px solid var(--borda);
    border-radius: 8px;
    flex: 1;
}

.mc-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: var(--fonte);
}

.mc-tabela thead tr {
    background: var(--sidebar-bg);
}

.mc-tabela thead th {
    padding: 9px 14px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    text-align: left;
}

.mc-tabela tbody tr {
    border-bottom: 1px solid var(--borda);
}
.mc-tabela tbody tr:last-child { border-bottom: none; }
.mc-tabela tbody tr:hover { background: var(--fundo); }

.mc-campo { padding: 9px 14px; color: #333; font-weight: bold; white-space: nowrap; width: 30%; }
.mc-de    { padding: 9px 14px; color: #888; width: 30%; }
.mc-seta  { padding: 9px 6px; color: var(--accent-dark); font-size: 15px; text-align: center; }
.mc-para  { padding: 9px 14px; color: var(--sidebar-bg); width: 30%; }

.mc-botoes {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.mc-btn-ok {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--sidebar-bg);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--fonte);
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.mc-btn-ok:hover { background: var(--accent-dark); }

.mc-btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: #444;
    border: 1px solid var(--borda);
    padding: 10px 22px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--fonte);
    cursor: pointer;
    transition: background 0.2s;
}
.mc-btn-cancel:hover { background: var(--fundo); }

/* =====================================================
   ITENS DO CONTRATO — LAYOUT CARD
   ===================================================== */

.itens-body {
    margin-bottom: 10px;
}

.item-card {
    background: #ffffff;
    border: 1px solid #e4e7e6;
    border-radius: 8px;
    padding: 10px 14px 2px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.03);
}

.item-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid #edefee;
}

.item-card-num {
    font-size: 10.5px;
    font-weight: 700;
    color: #5c6864;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Agrupamento por seção dentro do item (rótulo discreto + separador fino) */
.item-section {
    padding: 7px 0;
    border-bottom: 1px dashed #edefee;
}
.item-section:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}
.item-section-title {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #a3aba8;
    margin-bottom: 5px;
}

/* Itens do Contrato — campos compactos dentro de cada seção */
#itens-body .item-section .form-grid {
    gap: 6px;
    margin-bottom: 0;
}
#itens-body .item-section label {
    font-size: 9.5px;
    margin-bottom: 2px;
}
#itens-body .item-section input[type="text"],
#itens-body .item-section input[type="number"],
#itens-body .item-section select {
    padding: 5px 8px;
    font-size: 12px;
}

/* Bloco de Solicitações Adicionais — visual neutro e discreto */
.solicitacoes-wrap {
    background: #fbfbfb;
    border: 1px solid #edefee;
    border-radius: 6px;
    padding: 7px 8px;
}
.solicitacoes-wrap-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.solicitacoes-wrap-head span {
    font-size: 10.5px;
    color: #6b746f;
}
.solicitacao-row {
    margin-bottom: 3px !important;
}
.btn-add-solicitacao {
    background: #ffffff;
    color: #5c6864;
    border: 1px solid #d8dbda;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 10.5px;
    cursor: pointer;
}
.btn-add-solicitacao:hover {
    background: #f2f4f3;
}

/* Botão adicionar item */
.btn-add-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--accent-light);
    color: var(--sidebar-bg);
    border: 1px solid var(--accent);
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--fonte);
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 2px;
}
.btn-add-item:hover { background: var(--accent); color: #fff; }

/* Esconde botão adicionar / remover no modo visualizar */
.modo-visualizar .btn-add-item,
.modo-visualizar .btn-del-item { display: none; }

/* ── Visualização somente leitura dos itens ─────────────── */
#itens-view { display: none; margin-bottom: 10px; }
.modo-visualizar #itens-view { display: block; }
.modo-visualizar #itens-body { display: none; }
.modo-visualizar .itens-edit-sep { display: none; }

.item-view-card {
    background: #f8fbf9;
    border: 1.5px solid #c6e8d4;
    border-radius: 8px;
    padding: 10px 14px 12px;
    margin-bottom: 8px;
}
.item-view-num {
    font-size: 11px;
    font-weight: 700;
    color: #1e4a30;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid #d5ede2;
}
.item-view-campos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-bottom: 10px;
}
.item-view-campo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
}
.item-view-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.3px;
}
.item-view-val {
    font-size: 13px;
    color: #1a1a1a;
    font-weight: 500;
}
.item-view-totais {
    display: flex;
    gap: 24px;
    padding-top: 8px;
    border-top: 1px solid #d5ede2;
    flex-wrap: wrap;
}
.item-view-totais > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 80px;
}
.item-view-totais strong {
    font-size: 13px;
    color: #1e4a30;
    font-weight: 700;
}
.itens-edit-sep {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 6px 0 8px;
}
.modo-visualizar .itens-edit-sep { display: none; }

/* Botão remover item */
.btn-del-item {
    background: none;
    border: 1px solid #e0b0b0;
    color: #c0392b;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.btn-del-item:hover { background: #c0392b; color: #fff; border-color: #c0392b; }

.btn-del-item.btn-del-item-full {
    width: auto;
    height: auto;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    font-family: var(--fonte);
    gap: 5px;
}

/* =====================================================
   ABA FINALIZAR — RESUMO E GERAÇÃO DE CONTRATO
   ===================================================== */

.finalizar-resumo { margin-top: 6px; }

.res-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.res-card {
    background: var(--fundo);
    border: 1px solid var(--borda);
    border-radius: 8px;
    padding: 12px 14px;
}

.res-lbl {
    font-size: 10px;
    color: var(--subtexto);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
    margin-bottom: 5px;
}

.res-val {
    font-size: 15px;
    font-weight: bold;
    color: var(--texto);
    word-break: break-word;
}

.res-verde   { color: var(--accent-dark); }
.res-vermelho { color: #c0392b; }

.res-itens-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    font-family: var(--fonte);
}
.res-itens-tabela th, .res-itens-tabela td {
    border: 1px solid var(--borda);
    padding: 6px 9px;
    text-align: left;
}
.res-itens-tabela th {
    background: var(--sidebar-bg);
    color: #fff;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.res-itens-tabela tbody tr:hover { background: #f6fbf8; }

/* Botão Gerar Contrato */
.btn-gerar-contrato {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--sidebar-bg);
    color: #fff;
    border: none;
    padding: 11px 26px;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--fonte);
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-gerar-contrato:hover { background: var(--accent-dark); color: #fff; }
