:root {
    --primary: #B5231E;
    --primary-dark: #8f1c18;
    --secondary: #1E5FA8;
    --secondary-dark: #164a85;
    --black: #212529;
    --dark: #1a1d20;
    --white: #ffffff;
    --gray: #f5f6f8;
    --gray-border: #e9ecef;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--gray);
    color: var(--black);
}

a { text-decoration: none; }

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

.sidebar {
    width: 260px;
    min-height: 100vh;
    background-color: var(--dark);
    color: #fff;
    flex-shrink: 0;
    transition: margin-left .25s ease;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .brand {
    padding: 1.5rem 1.25rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: .6rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar .brand-logo {
    height: 34px;
    max-width: 120px;
    object-fit: contain;
}

.sidebar .nav-link {
    color: rgba(255,255,255,.75);
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .93rem;
    border-left: 3px solid transparent;
    transition: all .15s ease;
}

.sidebar .nav-link:hover {
    color: var(--primary);
    background: rgba(181,35,30,.10);
}

.sidebar .nav-link.active {
    color: var(--primary);
    background: rgba(181,35,30,.15);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar .nav-link i { width: 20px; text-align: center; }

.content { flex: 1; min-width: 0; }

.topbar {
    background: #fff;
    padding: .9rem 1.5rem;
    border-bottom: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.main-content { padding: 1.5rem; }

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        z-index: 1050;
        margin-left: -260px;
        height: 100%;
    }
    .sidebar.show { margin-left: 0; }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1040;
    }
    .sidebar-backdrop.show { display: block; }
}

/* ---------- Componentes ---------- */
.card {
    border-radius: var(--radius);
    box-shadow: 0 0.4rem 1rem rgba(0,0,0,.06);
    border: none;
    background: #fff;
}

.stat-card {
    border-radius: var(--radius);
    padding: 1.25rem;
    background: #fff;
    box-shadow: 0 0.4rem 1rem rgba(0,0,0,.06);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform .15s ease;
}
.stat-card:hover { transform: translateY(-3px); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: rgba(30,95,168,.14);
    color: var(--secondary);
    flex-shrink: 0;
}

.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .8rem; color: #6c757d; }

.btn-yellow {
    background-color: var(--primary);
    color: var(--white);
    font-weight: 600;
    border: none;
}
.btn-yellow:hover { background-color: var(--primary-dark); color: var(--white); }

.btn-outline-yellow {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
    font-weight: 600;
}
.btn-outline-yellow:hover { background: var(--primary); color: var(--white); }

.table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6c757d;
    border-bottom: 2px solid var(--gray-border);
    white-space: nowrap;
}

.table td { vertical-align: middle; }

.thumb {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--gray-border);
    background: #fff;
}

.thumb-lg {
    width: 100%;
    max-width: 260px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-border);
    background: #fff;
    padding: .5rem;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}
.status-aguardando  { background: #e9ecef; color: #495057; }
.status-em_andamento{ background: #fff3cd; color: #856404; }
.status-aprovado    { background: #d1ecf1; color: #0c5460; }
.status-producao    { background: #e2d9f3; color: #4b2e83; }
.status-concluido   { background: #d4edda; color: #155724; }
.status-entregue    { background: #cce5ff; color: #004085; }
.status-cancelado   { background: #f8d7da; color: #721c24; }

.pago-pago     { background: #d4edda; color: #155724; }
.pago-pendente { background: #f8d7da; color: #721c24; }
.pago-parcial  { background: #fff3cd; color: #856404; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-color: #1b1e21;
    background-image:
        linear-gradient(135deg, rgba(20, 22, 24, 0.45) 0%, rgba(33, 37, 41, 0.35) 100%),
        url("../img/login-fundo.jpg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.login-card {
    border-radius: 18px;
    overflow: hidden;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
}

.login-brand-logo {
    max-height: 70px;
    max-width: 200px;
    object-fit: contain;
}

.login-brand {
    background: rgba(181, 35, 30, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--white);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card .col-md-7 {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}
.empty-state i { font-size: 2.5rem; color: #ced4da; margin-bottom: .75rem; }

.producao-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(16,24,32,.05), 0 6px 18px rgba(16,24,32,.07);
    transition: transform .18s ease, box-shadow .18s ease;
    background: #fff;
}
.producao-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(16,24,32,.08), 0 14px 30px rgba(16,24,32,.12);
}
.producao-card-img {
    height: 150px;
    background: linear-gradient(135deg, #f1f2f4 0%, #e5e7ea 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.producao-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}
.producao-card-img-empty { color: #b8bfc6; font-size: 1.8rem; }
.producao-card-progress {
    height: 4px;
    background: #eef0f2;
    width: 100%;
}
.producao-card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
    transition: width .3s ease;
}
.producao-card-num {
    font-size: .68rem;
    font-weight: 700;
    color: #98a1a8;
    letter-spacing: .02em;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}
.producao-card-title {
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1d20;
}
.producao-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .76rem;
    color: #6c757d;
    margin-bottom: .75rem;
}
.producao-card-meta i { width: 14px; color: #98a1a8; }
.producao-card-obs {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: #fff8e6;
    border: 1px solid #f5e4ad;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: .74rem;
    color: #6b5514;
    line-height: 1.4;
    margin-bottom: .85rem;
}
.producao-card-obs i { color: #c9a227; margin-top: 1px; flex-shrink: 0; }
.producao-card-actions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding-top: .5rem;
    border-top: 1px solid var(--gray-border);
}

.filters-bar { background: #fff; border-radius: var(--radius); padding: 1rem; box-shadow: 0 0.4rem 1rem rgba(0,0,0,.05); margin-bottom: 1.25rem; }

.file-drop {
    border: 2px dashed var(--gray-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    color: #6c757d;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    overflow: hidden;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
}

.app-footer {
    margin-top: 2.5rem;
    padding: 1.25rem 1rem;
    text-align: center;
    font-size: .76rem;
    color: #9aa1a8;
    border-top: 1px solid var(--gray-border);
    line-height: 1.6;
}
.app-footer strong { color: #6c757d; }
.app-footer-whats {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 6px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    font-size: .68rem;
    vertical-align: middle;
    transition: transform .15s ease;
}
.app-footer-whats:hover { transform: scale(1.12); color: #fff; }

.login-page .app-footer {
    border-top: none;
    color: rgba(255,255,255,.65);
    margin-top: 1.25rem;
}
.login-page .app-footer strong { color: rgba(255,255,255,.85); }
