/* ================================================================
   Variáveis
   ================================================================ */
:root {
    --blue-dark:     #0d3b6e;
    --blue-mid:      #1a5fa8;
    --blue-light:    #3a8fd4;
    --blue-pale:     #e8f2fb;
    --blue-border:   #b3d1ef;
    --success:       #5cefaa;
    --warning:       #ffd166;
    --error:         #ff7675;
    --sidebar-bg:    #0f172a;
    --sidebar-width: 240px;
}

/* ================================================================
   Base
   ================================================================ */
body {
    background: #f8fafc;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1c2e42;
    min-height: 100vh;
}

/* ================================================================
   Layout geral
   ================================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ================================================================
   Sidebar
   ================================================================ */
.app-sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 18px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}

.sidebar-brand:hover {
    text-decoration: none;
    opacity: .9;
}

.sidebar-brand-icon {
    font-size: 1.5rem;
    color: #60a5fa;
    flex-shrink: 0;
}

.sidebar-brand-name {
    display: block;
    font-size: .93rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.2;
    letter-spacing: .01em;
}

.sidebar-brand-sub {
    display: block;
    font-size: .7rem;
    color: #64748b;
    line-height: 1.4;
}

.sidebar-nav {
    padding: 10px 0 20px;
    flex: 1;
}

.sidebar-section-label {
    font-size: .67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #475569;
    padding: 18px 20px 5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    font-size: .855rem;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: color .15s, background .15s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,.05);
    text-decoration: none;
}

.sidebar-link.active {
    color: #fff;
    background: rgba(96,165,250,.12);
    border-left-color: #60a5fa;
}

.sidebar-link-icon {
    font-size: .875rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    color: inherit !important;
}

/* Overlay mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1029;
}

.sidebar-overlay.visible {
    display: block;
}

/* ================================================================
   App body
   ================================================================ */
.app-body {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ================================================================
   Topbar
   ================================================================ */
.app-topbar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    flex-shrink: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1rem;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    display: none;
    transition: background .15s;
    line-height: 1;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
    color: var(--blue-dark);
}

.topbar-title {
    font-size: .875rem;
    font-weight: 600;
    color: #64748b;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-user-btn {
    display: inline-flex;
    align-items: center;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--blue-dark);
    padding: 6px 14px;
    font-size: .855rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
    font-family: inherit;
}

.topbar-user-btn:hover,
.show > .topbar-user-btn {
    background: var(--blue-pale);
    border-color: var(--blue-border);
    color: var(--blue-dark);
}

.topbar-user-btn.dropdown-toggle::after {
    display: inline-block;
    margin-left: .5em;
    vertical-align: .15em;
    content: "";
    border-top: .33em solid;
    border-right: .33em solid transparent;
    border-left: .33em solid transparent;
    opacity: .5;
}

/* Dropdown do usuário (topbar) */
.header-dropdown-menu {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,.10);
    padding: 6px 0;
    min-width: 200px;
    margin-top: 6px;
}

.header-dropdown-menu .dropdown-divider {
    border-color: #f1f5f9;
    margin: 4px 0;
}

.header-dropdown-item {
    display: flex;
    align-items: center;
    color: var(--blue-dark) !important;
    font-size: .875rem;
    font-weight: 500;
    padding: 9px 18px !important;
    transition: background .15s;
}

.header-dropdown-item:hover {
    background: var(--blue-pale) !important;
    color: var(--blue-mid) !important;
    text-decoration: none;
}

/* ================================================================
   Main / Footer
   ================================================================ */
.app-content {
    flex: 1;
    padding: 28px 32px;
}

.app-footer {
    padding: 14px 32px;
    border-top: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: .8rem;
}

/* ================================================================
   Cards
   ================================================================ */
.card-custom {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05), 0 4px 16px rgba(26, 95, 168, .05);
    margin-bottom: 28px;
    overflow: hidden;
}

.card-custom .card-header {
    background: #fff;
    color: var(--blue-dark);
    font-weight: 700;
    font-size: .93rem;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.card-custom .card-body {
    padding: 28px;
}

/* Card base (listas, tabelas) */
.card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.04) !important;
}

/* ================================================================
   Tables
   ================================================================ */
.table thead.thead-dark th {
    background: #1e293b;
    color: #cbd5e1;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    border: none;
    padding: 12px 16px;
}

.table td {
    border-color: #f1f5f9;
    vertical-align: middle;
    color: #334155;
    padding: 12px 16px;
}

.table th {
    padding: 12px 16px;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* ================================================================
   Badges
   ================================================================ */
.badge {
    font-weight: 500;
    font-size: .71rem;
    letter-spacing: .02em;
    padding: .32em .7em;
    border-radius: 6px;
}

/* ================================================================
   Drop Zone
   ================================================================ */
#drop-zone {
    border: 2.5px dashed var(--blue-light);
    border-radius: 10px;
    background: var(--blue-pale);
    padding: 44px 20px;
    text-align: center;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .1s;
    outline: none;
}

#drop-zone:hover,
#drop-zone:focus,
#drop-zone.dragover {
    background: #d0e8f9;
    border-color: var(--blue-dark);
    transform: translateY(-1px);
}

.dz-icon {
    font-size: 3rem;
    color: var(--blue-light);
    margin-bottom: 12px;
}

.dz-text {
    color: var(--blue-mid);
    font-size: 1.05rem;
}

.dz-sub {
    color: #6c8daa;
    font-size: .85rem;
    margin-top: 4px;
}

/* ================================================================
   Badge de arquivo selecionado
   ================================================================ */
.file-info-badge {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--blue-border);
    border-radius: 8px;
    padding: 10px 16px;
    margin-top: 14px;
    gap: 10px;
    min-width: 0;
}

.file-info-badge .fa-file-excel {
    color: #1e7e34;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.file-info-badge .file-name {
    font-weight: 600;
    color: var(--blue-dark);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-info-badge .file-size {
    font-size: .85rem;
    flex-shrink: 0;
}

.btn-remove {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
    line-height: 1;
    transition: opacity .15s;
}

.btn-remove:hover { opacity: .75; }

/* ================================================================
   Botão principal
   ================================================================ */
.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: linear-gradient(135deg, var(--blue-mid), var(--blue-light));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 11px 32px;
    cursor: pointer;
    letter-spacing: .3px;
    transition: opacity .2s, transform .1s;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary-custom:hover:not(:disabled) {
    opacity: .9;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.btn-primary-custom:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-primary-custom--sm {
    font-size: .84rem;
    padding: .38rem .9rem;
}

.btn-secondary-custom {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem 1.2rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    background: #fff;
    color: #475569;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.btn-secondary-custom:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
    text-decoration: none;
}

.btn-secondary-custom--sm {
    font-size: .82rem;
    padding: .3rem .8rem;
}

/* Botões de ação (ícone) em linhas de tabela */
.btn-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: .8rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}

.btn-icon-action:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
    text-decoration: none;
}

.btn-icon-action--primary { color: var(--blue-mid); border-color: var(--blue-border); }
.btn-icon-action--primary:hover { background: var(--blue-pale); color: var(--blue-dark); border-color: var(--blue-mid); }

.btn-icon-action--danger { color: #dc2626; border-color: #fecaca; }
.btn-icon-action--danger:hover { background: #fef2f2; color: #b91c1c; border-color: #f87171; }

/* ================================================================
   File Picker — seletor de arquivo estilizado
   Uso: <label class="file-picker"><input type="file" class="sr-only" />
        <span class="file-picker__trigger">...</span>
        <span class="file-picker__name">Nenhum arquivo</span></label>
   ================================================================ */
.file-picker {
    display: inline-flex;
    align-items: center;
    height: 32px;
    border: 1.5px solid #cbd5e1;
    border-radius: 7px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    font-weight: normal;
    margin: 0;
    width: 17rem;
    transition: border-color .15s;
    vertical-align: middle;
}

.file-picker:hover { border-color: var(--blue-mid); }

.file-picker__trigger {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: 0 .65rem;
    height: 100%;
    background: var(--blue-pale);
    border-right: 1.5px solid #cbd5e1;
    color: var(--blue-mid);
    font-size: .8rem;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.file-picker:hover .file-picker__trigger { background: #dbeafe; color: var(--blue-dark); }

.file-picker__name {
    padding: 0 .65rem;
    font-size: .8rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.file-picker--has-file .file-picker__name { color: #334155; }

/* ================================================================
   Área de log (SSE)
   ================================================================ */
#log-area {
    background: #0d1b2a;
    color: #a8d8f0;
    border-radius: 10px;
    padding: 18px 22px;
    min-height: 120px;
    max-height: 340px;
    overflow-y: auto;
    font-family: 'Courier New', Consolas, monospace;
    font-size: .87rem;
    line-height: 1.8;
    scroll-behavior: smooth;
}

.log-line        { display: block; }
.log-info        { color: #a8d8f0; }
.log-success     { color: var(--success); }
.log-warning     { color: var(--warning); }
.log-error       { color: var(--error); }

/* ================================================================
   Downloads
   ================================================================ */
.downloads-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid var(--blue-border);
    border-radius: 8px;
    color: var(--blue-dark);
    padding: 11px 18px;
    font-weight: 600;
    font-size: .93rem;
    text-decoration: none;
    transition: background .2s, border-color .2s;
}

.download-btn:hover {
    background: var(--blue-pale);
    border-color: var(--blue-mid);
    color: var(--blue-dark);
    text-decoration: none;
}

.download-btn .icon-script  { color: var(--blue-light); font-size: 1.1rem; }
.download-btn .file-label   { flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.download-btn .file-title   { font-weight: 600; font-size: .95rem; color: var(--blue-dark); }
.download-btn .file-slug    { font-size: .78rem; color: #6c8daa; font-weight: 400; }
.download-btn .icon-dl      { color: var(--blue-light); margin-left: auto; }

/* ================================================================
   Animação de spinner
   ================================================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spinning { display: inline-block; animation: spin 1s linear infinite; }

/* ================================================================
   Breadcrumb
   ================================================================ */
.page-breadcrumb {
    font-size: .87rem;
    color: #6c8daa;
    margin-bottom: 22px;
}

.page-breadcrumb a {
    color: var(--blue-mid);
    text-decoration: none;
}

.page-breadcrumb a:hover {
    text-decoration: underline;
}

/* ================================================================
   Homepage — hero
   ================================================================ */
.home-hero {
    text-align: center;
    padding: 36px 0 28px;
}

.home-hero-icon {
    font-size: 3rem;
    color: var(--blue-light);
    margin-bottom: 14px;
    display: block;
}

.home-hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 6px;
}

.home-hero-sub {
    color: #6c8daa;
    font-size: 1rem;
    margin: 0;
}

/* ================================================================
   Homepage — cards de navegação
   ================================================================ */
.home-cards {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 360px));
    justify-content: start;
    gap: 20px;
    padding-bottom: 40px;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.home-cards--2col {
    grid-template-columns: repeat(2, 1fr);
}

.home-cards > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
}

.home-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0;
    text-decoration: none;
    color: var(--blue-dark);
    transition: box-shadow .2s, border-color .2s, transform .15s;
    overflow: hidden;
    height: 100%;
}

.home-card:hover {
    box-shadow: 0 6px 28px rgba(26, 95, 168, .14);
    border-color: var(--blue-mid);
    transform: translateY(-3px);
    text-decoration: none;
    color: var(--blue-dark);
}

.home-card-icon {
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-mid));
    color: #fff;
    font-size: 2.4rem;
    padding: 28px;
    text-align: center;
}

.home-card-icon--regras {
    background: linear-gradient(135deg, #1a3a5c, #2a7a9a);
}

.home-card-icon--depara {
    background: linear-gradient(135deg, #2c5f2e, #47a04b);
}

.home-card-icon--snapshot {
    background: linear-gradient(135deg, #7a4500, #e67e22);
}

.home-card-icon--template {
    background: linear-gradient(135deg, #4a235a, #8e44ad);
}

.home-card-icon--tabela-generica {
    background: linear-gradient(135deg, #1a4a3a, #27ae60);
}

.home-card-icon--planejamento {
    background: linear-gradient(135deg, #0d3b6e, #1a5fa8);
}

.home-card-icon--participantes {
    background: linear-gradient(135deg, #3b2a0d, #a87c1a);
}

.home-section-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.home-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 4px;
}

.home-card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.home-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 10px;
}

.home-card-desc {
    font-size: .875rem;
    color: #4a6785;
    flex: 1;
    line-height: 1.6;
    margin-bottom: 16px;
}

.home-card-link {
    font-size: .855rem;
    font-weight: 600;
    color: var(--blue-mid);
}

/* ================================================================
   Ícone TXT na drop zone
   ================================================================ */
.dz-icon--txt .fa-file-alt {
    color: #e67e22;
}

.file-icon-txt {
    color: #e67e22;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* ================================================================
   Botão download XML
   ================================================================ */
.icon-script--xml {
    color: #2a7a9a !important;
}

/* ================================================================
   Ícones coloridos do nav (mantidos para uso em outras views)
   ================================================================ */
.nav-icon--depara           { color: #47a04b; }
.nav-icon--regras           { color: #2a7a9a; }
.nav-icon--template         { color: #8e44ad; }
.nav-icon--projetos         { color: var(--blue-mid); }
.nav-icon--participantes    { color: var(--blue-light); }
.nav-icon--tabela-generica  { color: #27ae60; }

/* ================================================================
   Separador / utilitários
   ================================================================ */
.breadcrumb-sep { font-size: .75rem; }
.va-middle { vertical-align: middle; }

.layout-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.border-top-subtle { border-top: 1px solid #f0f0f0; }
.badge--sm { font-size: .72rem; }

.text-purple        { color: #8e44ad !important; }
.bg-purple          { background-color: #8e44ad !important; color: #fff; }
.text-blue-custom   { color: #4a7fcb !important; }
.bg-blue-dark       { background-color: #2471a3 !important; color: #fff; }
.bg-green-dark      { background-color: #1a7a4e !important; color: #fff; }

.btn-primary-montagem-cenario {
    background: #8e44ad !important;
    border-color: #8e44ad !important;
    color: #fff;
}
.btn-primary-montagem-cenario:hover:not(:disabled) {
    background: #7d3c98 !important;
    border-color: #7d3c98 !important;
}

.gap-2        { gap: 0.5rem !important; }
.gap-4        { gap: 1.5rem !important; }
.fw-semibold  { font-weight: 600 !important; }
.fs-82        { font-size: .82rem !important; }
.fs-92        { font-size: .92rem !important; }
.fs-2rem      { font-size: 2rem !important; }
.fs-85        { font-size: .85rem !important; }

.text-whatsapp { color: #25d366 !important; }
.text-nowrap   { white-space: nowrap !important; }
.d-inline      { display: inline !important; }
.min-w-140     { min-width: 140px !important; }

.btn-danger-light {
    background: #fdecea !important;
    color: #c62828 !important;
    border-color: #ffcdd2 !important;
}
.btn-danger-light:hover {
    background: #fbd6d2 !important;
}

/* ================================================================
   Form Controls — modernização global (Bootstrap override)
   ================================================================ */

.form-control {
    height: 44px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: .905rem;
    color: #1e293b;
    background: #f8fafc;
    padding: 0 14px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.form-control:focus {
    border-color: var(--blue-mid);
    background: #fff;
    box-shadow: 0 0 0 3.5px rgba(26, 95, 168, .10);
    color: #1e293b;
    outline: none;
}

.form-control::placeholder {
    color: #c8d6e3;
}

textarea.form-control {
    height: auto;
    padding: 10px 14px;
    resize: vertical;
}

select.form-control {
    appearance: auto;
    padding-right: 14px;
}

.form-control.input-validation-error {
    border-color: #f87171;
    background: #fff;
}

.form-control.input-validation-error:focus {
    box-shadow: 0 0 0 3.5px rgba(239, 68, 68, .10);
    border-color: #ef4444;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-label-custom {
    font-size: .72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .4rem;
    display: block;
}

/* ── input-group com olhinho: botão posicionado dentro do input via CSS ── */
/* Funciona sem alterar o HTML das views — usa :has() (suportado em todos browsers modernos) */

.input-group:has(.btn-toggle-senha) {
    position: relative;
}

.input-group:has(.btn-toggle-senha) > .form-control {
    border-radius: 10px !important;
    border-right: 1.5px solid #e2e8f0 !important;
    padding-right: 46px;
    z-index: 1;
}

.input-group:has(.btn-toggle-senha) > .form-control:focus {
    border-color: var(--blue-mid) !important;
    border-right-color: var(--blue-mid) !important;
}

.input-group:has(.btn-toggle-senha) > .input-group-append {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
}

.input-group:has(.btn-toggle-senha) .btn-toggle-senha {
    width: 42px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none !important;
    border: none !important;
    color: #94a3b8 !important;
    border-radius: 0 10px 10px 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-size: .88rem;
    cursor: pointer;
    transition: color .15s !important;
}

.input-group:has(.btn-toggle-senha) .btn-toggle-senha:hover {
    color: var(--blue-mid) !important;
}

/* ── Mensagens de validação ── */
.text-danger.small {
    font-size: .74rem !important;
}

/* ── Alerts modernizados ── */
.alert-danger {
    border-radius: 10px;
    font-size: .83rem;
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

.alert-success {
    border-radius: 10px;
}

/* ── Custom switch (toggle Ativo) ── */
.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--blue-mid);
    border-color: var(--blue-mid);
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px rgba(26, 95, 168, .15);
}

.custom-control-input:focus:not(:checked) ~ .custom-control-label::before {
    border-color: var(--blue-border);
}

.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-grid-4-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: .5rem;
    align-items: end;
}

.form-label-custom {
    font-size: .78rem;
    font-weight: 600;
    color: #475569;
    display: block;
    margin-bottom: .25rem;
    letter-spacing: .01em;
}

/* ================================================================
   Comparação de Snapshot de Folha
   ================================================================ */
.snap-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 700px) {
    .snap-upload-grid { grid-template-columns: 1fr; }
}

.snap-upload-col { display: flex; flex-direction: column; min-width: 0; }

.snap-upload-label {
    font-size: .9rem;
    color: var(--blue-dark);
    margin-bottom: .5rem;
}

.snap-drop-zone {
    border: 2.5px dashed var(--blue-light);
    border-radius: 10px;
    background: var(--blue-pale);
    padding: 36px 16px;
    text-align: center;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .1s;
    outline: none;
    flex: 1;
}

.snap-drop-zone:hover,
.snap-drop-zone:focus,
.snap-drop-zone.dragover {
    background: #d0e8f9;
    border-color: var(--blue-dark);
    transform: translateY(-1px);
}

.snap-drop-zone .fa-file-csv { color: #1e7e34; }
.snap-icon-destino { color: #1a5fa8 !important; }

.snap-csv-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    color: #1e7e34;
}

.snap-colunas-hint {
    font-size: .82rem;
    color: #6c8daa;
}

.snap-colunas-hint code {
    font-size: .8rem;
    color: var(--blue-dark);
    background: var(--blue-pale);
    border-radius: 4px;
    padding: 1px 5px;
}

.log-warn { color: #f0c040; }

.snap-btn-download-log {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2c7a4b, #3da35d);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    padding: 11px 32px;
    cursor: pointer;
    letter-spacing: .3px;
    transition: opacity .2s, transform .1s;
    font-family: inherit;
}

.snap-btn-download-log:hover {
    opacity: .9;
    transform: translateY(-1px);
}

/* ================================================================
   Responsividade
   ================================================================ */
@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-body {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-content {
        padding: 20px 16px;
    }

    .app-footer {
        padding: 14px 16px;
    }
}

@media (max-width: 900px) {
    .home-hero {
        padding: 20px 0 16px;
    }

    .home-hero-icon {
        font-size: 2.2rem;
        margin-bottom: 8px;
    }

    .home-hero-title {
        font-size: 1.25rem;
    }

    .home-card-icon {
        padding: 18px;
        font-size: 1.9rem;
    }

    .home-card-body {
        padding: 16px;
    }

    .home-cards,
    .home-cards--2col {
        grid-template-columns: 1fr;
        padding-bottom: 24px;
        gap: 14px;
    }
}

/* ── Dashboard Home ──────────────────────────────────────────── */
.dash-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--blue-dark);
}

.dash-stage-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dash-stage-header {
    display: flex;
    align-items: center;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .45rem .75rem;
    border-radius: 6px 6px 0 0;
    color: #fff;
    margin-bottom: 2px;
}
.dash-stage-header--cenario     { background: linear-gradient(90deg, #6a1a9a, #9b51c9); }
.dash-stage-header--planejamento { background: linear-gradient(90deg, #1a4a7a, #2a7ab4); }
.dash-stage-header--execucao    { background: linear-gradient(90deg, #155724, #28a745); }

.dash-proj-card {
    display: block;
    background: #fff;
    border: 1px solid #dde3ea;
    border-top: none;
    padding: .65rem .8rem;
    transition: background .15s, box-shadow .15s;
    text-decoration: none !important;
    color: inherit !important;
}
.dash-proj-card:last-child {
    border-radius: 0 0 6px 6px;
}
.dash-proj-card:hover {
    background: #f0f6ff;
    box-shadow: 0 2px 10px rgba(26, 74, 122, .1);
    z-index: 1;
    position: relative;
}

.dash-proj-nome {
    font-size: .88rem;
    font-weight: 600;
    color: var(--blue-dark);
    line-height: 1.3;
    flex: 1;
}

.dash-proj-info {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .8rem;
    margin-top: .3rem;
    font-size: .76rem;
    color: #6c757d;
}

.dash-proj-pct {
    font-size: .8rem;
    font-weight: 600;
    color: #495057;
    display: block;
    margin-top: .2rem;
}

.dash-empty-col {
    background: #f8f9fa;
    border: 1px dashed #ced4da;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: .8rem;
    font-size: .8rem;
    color: #adb5bd;
    text-align: center;
}

.dash-tarefas-table td,
.dash-tarefas-table th {
    font-size: .82rem;
    vertical-align: middle !important;
}

.dash-tarefa-link {
    color: var(--blue-dark);
    font-weight: 500;
}
.dash-tarefa-link:hover {
    text-decoration: underline;
}

.dash-atrasado-badge {
    font-size: .65rem;
    padding: .15rem .35rem;
    vertical-align: middle;
}
