/*
 * alint.css — Estilos globais complementares do ERP Alint
 * Bootstrap não é usado no shell — estilos 100% custom
 */

/* ── Variáveis adicionais ───────────────────────────────── */
:root {
    --font-mono: 'Courier New', Courier, monospace;
    --ease-out:  cubic-bezier(0, 0, 0.2, 1);
    --ease-in:   cubic-bezier(0.4, 0, 1, 1);
}

/* ── Scrollbars globais ─────────────────────────────────── */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-2, #CBD5E1) transparent;
}
*::-webkit-scrollbar        { width: 6px; height: 6px; }
*::-webkit-scrollbar-track  { background: transparent; }
*::-webkit-scrollbar-thumb  { background: var(--border-2, #CBD5E1); border-radius: 4px; }

/* ── Animações utilitárias ──────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

.animate-in       { animation: fadeInUp .25s var(--ease-out) both; }
.animate-fade     { animation: fadeIn   .2s ease both; }
.animate-pulse    { animation: pulse    2s  ease-in-out infinite; }
.animate-spin     { animation: spin     .7s linear infinite; }

/* ── Utilitários de texto ───────────────────────────────── */
.text-primary  { color: var(--primary) !important; }
.text-success  { color: var(--success) !important; }
.text-danger   { color: var(--danger)  !important; }
.text-warning  { color: var(--warning) !important; }
.text-muted    { color: var(--text-3)  !important; }
.text-mono     { font-family: var(--font-mono); }
.text-head     { font-family: var(--font-head); }
.fw-600        { font-weight: 600; }
.fw-700        { font-weight: 700; }
.fs-12         { font-size: 12px; }
.fs-13         { font-size: 13px; }

/* ── Utilitários de espaçamento ─────────────────────────── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }

/* ── Flex utilitários ───────────────────────────────────── */
.d-flex     { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap  { flex-wrap: wrap; }
.flex-1     { flex: 1; }

/* ── Card genérico ──────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius, 10px);
    overflow: hidden;
}
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; font-weight: 600;
}
.card-body   { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); }

/* ── Seção de formulário ────────────────────────────────── */
.form-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.form-section:last-child { border-bottom: none; }
.form-section-title {
    font-size: 13px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-3); margin-bottom: 16px;
}

/* ── Select estilizado ──────────────────────────────────── */
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2394A3B8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    -webkit-appearance: none;
}

/* ── Input com prefixo (ex: R$) ─────────────────────────── */
.input-group {
    display: flex; align-items: stretch;
}
.input-group-prefix {
    display: flex; align-items: center; padding: 0 12px;
    background: var(--bg-2); border: 1.5px solid var(--border);
    border-right: none; border-radius: var(--radius-sm, 7px) 0 0 var(--radius-sm, 7px);
    font-size: 13px; color: var(--text-3); white-space: nowrap;
}
.input-group .form-control {
    border-radius: 0 var(--radius-sm, 7px) var(--radius-sm, 7px) 0;
}

/* ── Divisor com texto ──────────────────────────────────── */
.divider-text {
    display: flex; align-items: center; gap: 12px;
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-3); margin: 20px 0;
}
.divider-text::before, .divider-text::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
    .sidebar, .topbar, .tabs-bar, .crud-toolbar, .pagination,
    .modal-footer, .btn, .toast-container { display: none !important; }
    .main-content { margin: 0 !important; }
    .table-wrap { box-shadow: none !important; border: 1px solid #ccc; }
}

/* ── Responsividade CRUD ────────────────────────────────── */
@media (max-width: 640px) {
    .crud-container  { padding: 16px; }
    .page-header     { flex-direction: column; align-items: flex-start; }
    .crud-toolbar    { flex-wrap: wrap; }
    .crud-search     { min-width: 100%; }
    .table-wrap      { font-size: 12px; }
    .crud-table td,
    .crud-table th   { padding: 10px 12px; }
    .form-row        { grid-template-columns: 1fr; }
    .kpi-grid        { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
    .kpi-grid        { grid-template-columns: 1fr; }
}

/* ── Highlight de busca ─────────────────────────────────── */
mark {
    background: rgba(37, 99, 235, .2);
    color: var(--primary);
    border-radius: 3px;
    padding: 0 2px;
}

/* ── Estado vazio com ação ──────────────────────────────── */
.empty-state-action {
    margin-top: 16px;
}

/* ── Tabela de detalhes (chave: valor) ──────────────────── */
.detail-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.detail-table th {
    width: 35%; padding: 10px 12px;
    text-align: left; font-size: 11px;
    font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.detail-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.detail-table tr:last-child th,
.detail-table tr:last-child td { border-bottom: none; }

/* ── Passo a passo (stepper) ────────────────────────────── */
.stepper {
    display: flex; gap: 0; margin-bottom: 24px;
}
.stepper-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    position: relative; font-size: 12px; text-align: center;
}
.stepper-item:not(:last-child)::after {
    content: ''; position: absolute; top: 14px; left: 50%;
    width: 100%; height: 2px; background: var(--border);
    z-index: 0;
}
.stepper-item.done::after { background: var(--success); }
.stepper-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--border); color: var(--text-3);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; z-index: 1; margin-bottom: 6px;
    transition: all .2s;
}
.stepper-item.active .stepper-num  { background: var(--primary); color: #fff; }
.stepper-item.done   .stepper-num  { background: var(--success); color: #fff; }
.stepper-label { color: var(--text-3); font-weight: 500; }
.stepper-item.active .stepper-label { color: var(--primary); }
.stepper-item.done   .stepper-label { color: var(--success); }
