/* ==========================================================================
   Design System & Globais
   ========================================================================== */

:root {
    --bg-base: #080A0F;          /* Preto Profundo */
    --bg-surface: #0F111A;       /* Preto Grafite */
    --bg-card: #0F111A;          /* Preto Grafite */
    --bg-glass: rgba(15, 17, 26, 0.65);
    --border-glass: rgba(212, 175, 55, 0.15); /* Bordas douradas translúcidas */
    --border-color: #2E271D;     /* Dourado escuro queimado */
    
    --primary: #D4AF37;          /* Ouro Principal */
    --primary-glow: rgba(212, 175, 55, 0.22);
    --secondary: #B8860B;        /* Ouro Escuro */
    --secondary-glow: rgba(184, 134, 11, 0.18);
    
    --text-primary: #F5F1E8;     /* Marfim */
    --text-secondary: #C5BFA5;   /* Marfim escurecido */
    --text-muted: #7E7969;       /* Tom terroso de suporte */
    
    --success: #0B8A6A;          /* Verde Esmeralda */
    --warning: #D4AF37;          /* Ouro Principal */
    --danger: #A61E2D;           /* Vermelho Carnaval */
    --info: #0F6F7C;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-outfit: 'Outfit', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-base);
    background-image: 
        linear-gradient(45deg, rgba(212, 175, 55, 0.015) 25%, transparent 25%), 
        linear-gradient(-45deg, rgba(212, 175, 55, 0.015) 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, rgba(212, 175, 55, 0.015) 75%), 
        linear-gradient(-45deg, transparent 75%, rgba(212, 175, 55, 0.015) 75%),
        radial-gradient(rgba(212, 175, 55, 0.02) 1px, transparent 1px);
    background-size: 20px 20px, 20px 20px, 20px 20px, 20px 20px, 10px 10px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px, 0 0;
    color: var(--text-primary);
    font-family: var(--font-inter);
    font-size: 14px;
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

/* Scrollbar Customizada */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   Estrutura da Aplicação (Layout)
   ========================================================================== */

.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    width: 100vw;
}

/* Barra Lateral (Sidebar) */
.sidebar {
    background-color: #05060A; /* Fundo mais escuro */
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 24px;
    z-index: 10;
}

.sidebar-header {
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-outfit);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.gold-glow {
    color: var(--primary);
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.success-glow {
    color: var(--success);
    text-shadow: 0 0 12px rgba(11, 138, 106, 0.4);
}

.danger-glow {
    color: var(--danger);
    text-shadow: 0 0 12px rgba(166, 30, 45, 0.4);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-fast);
    cursor: pointer;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--primary);
    background-color: rgba(212, 175, 55, 0.06);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.08);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.nav-item.active {
    color: var(--primary);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(184, 134, 11, 0.05));
    border-left: 4px solid var(--primary);
    box-shadow: inset 2px 0 15px rgba(212, 175, 55, 0.1), 0 0 20px rgba(212, 175, 55, 0.08);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
    font-weight: 600;
}

.nav-item.active i {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.atelier-info {
    display: flex;
    flex-direction: column;
}

.atelier-info .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.atelier-info .version {
    font-size: 11px;
    color: var(--text-muted);
}

/* Área Principal (Main Content) */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Barra de Topo (Topbar) */
.topbar {
    background-color: rgba(9, 10, 15, 0.5);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    min-height: 70px;
}

.page-title h1 {
    font-family: var(--font-outfit);
    font-size: 22px;
    font-weight: 700;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.user-avatar i {
    font-size: 18px;
}

/* Área de Trabalho (Workspace) */
.workspace {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px 40px;
}

/* Loading & Empty States */
.loading-container, .empty-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 250px;
    color: var(--text-secondary);
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.empty-container i {
    font-size: 48px;
    color: var(--text-muted);
}

/* ==========================================================================
   Componentes Reutilizáveis (UI)
   ========================================================================== */

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 13px;
}

.btn-primary {
    background-color: var(--primary);
    color: #080A0F;
    border: 1px solid var(--primary);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background-color: #E5C04A; /* Ouro mais claro e brilhante */
    color: #080A0F;
    border-color: #E5C04A;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
}

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

.btn-secondary:hover {
    background-color: rgba(212, 175, 55, 0.05);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.1);
}

.btn-success {
    background-color: var(--success);
    color: var(--text-primary);
    border: 1px solid var(--success);
    box-shadow: 0 4px 12px rgba(11, 138, 106, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-success:hover {
    background-color: #0d9e7a;
    border-color: #0d9e7a;
    box-shadow: 0 6px 16px rgba(11, 138, 106, 0.35);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--text-primary);
    border: 1px solid var(--danger);
    box-shadow: 0 4px 12px rgba(166, 30, 45, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-danger:hover {
    background-color: #bc2537;
    border-color: #bc2537;
    box-shadow: 0 6px 16px rgba(166, 30, 45, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Formulários */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-control {
    background-color: var(--bg-base);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13.5px;
    transition: var(--transition-fast);
}

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

.form-control:focus {
    border-color: var(--primary);
    background-color: var(--bg-surface);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23D4AF37'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Cards */
.card {
    background-color: var(--bg-surface);
    border: 1px solid rgba(212, 175, 55, 0.15); /* Dourado suave */
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(212, 175, 55, 0.03);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card-glass {
    background: rgba(15, 17, 26, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), inset 0 1px 2px rgba(212, 175, 55, 0.08);
}

.card-glass::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.8;
}

/* Custom styles for financial cards */
.kpi-card {
    border-top: 3px solid transparent;
}

.kpi-card.kpi-saldo {
    border-top-color: var(--primary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.05);
}
.kpi-card.kpi-saldo:hover {
    border-top-color: var(--primary);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 25px rgba(212, 175, 55, 0.15);
    transform: translateY(-4px);
}

.kpi-card.kpi-receitas {
    border-top-color: var(--success);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 15px rgba(11, 138, 106, 0.05);
}
.kpi-card.kpi-receitas:hover {
    border-top-color: var(--success);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 25px rgba(11, 138, 106, 0.15);
    transform: translateY(-4px);
}

.kpi-card.kpi-despesas {
    border-top-color: var(--danger);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 15px rgba(166, 30, 45, 0.05);
}
.kpi-card.kpi-despesas:hover {
    border-top-color: var(--danger);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 25px rgba(166, 30, 45, 0.15);
    transform: translateY(-4px);
}

.kpi-card.kpi-clientes {
    border-top-color: var(--secondary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 15px rgba(184, 134, 11, 0.05);
}
.kpi-card.kpi-clientes:hover {
    border-top-color: var(--secondary);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 25px rgba(184, 134, 11, 0.15);
    transform: translateY(-4px);
}

/* Badges e Status */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-pendente {
    background-color: rgba(255, 184, 0, 0.15);
    color: var(--warning);
}

.badge-corte {
    background-color: rgba(0, 168, 255, 0.15);
    color: var(--info);
}

.badge-costura {
    background-color: rgba(243, 114, 44, 0.15);
    color: #f3722c;
}

.badge-pronta {
    background-color: rgba(0, 242, 161, 0.15);
    color: var(--success);
}

.badge-especial {
    background-color: rgba(143, 67, 255, 0.15);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Modais */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(5, 5, 8, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-surface);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.05);
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-family: var(--font-outfit);
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   Vistas Específicas
   ========================================================================== */

/* 1. Dashboard */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kpi-title {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-family: var(--font-outfit);
    font-size: 26px;
    font-weight: 800;
}

.kpi-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Barras de Progresso e Termômetro */
.thermometer-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.thermometer-header h2 {
    font-family: var(--font-outfit);
    font-size: 18px;
    font-weight: 700;
}

.thermometer-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.thermometer-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.thermometer-meta {
    display: flex;
    justify-content: space-between;
    font-weight: 500;
}

.thermometer-meta .info-ala {
    display: flex;
    flex-direction: column;
}

.thermometer-meta .info-ala .school-name {
    font-size: 11px;
    color: var(--text-muted);
}

.thermometer-meta .info-ala .ala-name {
    font-size: 14px;
    font-weight: 600;
}

.thermometer-meta .progress-numbers {
    text-align: right;
}

.thermometer-meta .progress-numbers .val {
    font-weight: 700;
}

.thermometer-meta .progress-numbers .pct {
    font-size: 12px;
    color: var(--success);
    font-weight: 600;
}

.progress-bar-container {
    background-color: var(--border-color);
    border-radius: var(--radius-sm);
    height: 12px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    box-shadow: 0 0 10px var(--secondary-glow);
    border-radius: var(--radius-sm);
    height: 100%;
    width: 0;
    transition: width 1s ease-out;
}

/* 2. Projetos */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-actions {
    display: flex;
    gap: 12px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 250px;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.project-card-header .school {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-card-header .ala {
    font-family: var(--font-outfit);
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
}

.project-card-financials {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.financial-stat {
    display: flex;
    flex-direction: column;
}

.financial-stat .lbl {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.financial-stat .val {
    font-size: 14px;
    font-weight: 700;
}

.financial-stat.devedor .val {
    color: var(--danger);
}

.project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 12px;
}

/* 3. Projeto Detalhes (Visualização Ala e Lista de Componentes) */
.project-info-banner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.project-details-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.details-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.details-item {
    display: flex;
    flex-direction: column;
}

.details-item .lbl {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.details-item .val {
    font-size: 15px;
    font-weight: 600;
}

.components-table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.table-header-row h3 {
    font-family: var(--font-outfit);
    font-size: 16px;
    font-weight: 700;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    font-family: var(--font-outfit);
    font-size: 12px;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    background-color: rgba(15, 17, 26, 0.6);
    border-bottom: 2px solid var(--primary);
    padding: 18px 24px;
}

.table td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.08); /* Dourado muito suave */
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background-color: rgba(212, 175, 55, 0.03);
    box-shadow: inset 4px 0 0 var(--primary);
}

.table tbody tr:hover td {
    color: var(--text-primary);
}

.table td.actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* 4. Perfil / Ficha do Componente */
.component-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.profile-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-section-title {
    font-family: var(--font-outfit);
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-data-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.profile-data-item {
    display: flex;
    flex-direction: column;
}

.profile-data-item .lbl {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.profile-data-item .val {
    font-size: 14px;
    font-weight: 600;
}

/* Grade de Medidas Corporais */
.measures-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.measure-box {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
}

.measure-box .lbl {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.measure-box .val {
    font-family: var(--font-outfit);
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary);
}

/* Observações */
.notes-container {
    background-color: rgba(255, 184, 0, 0.05);
    border: 1px solid rgba(255, 184, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    min-height: 80px;
    color: var(--text-primary);
}

/* Inputs de Medidas no Formulário */
.form-measures-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Notificações Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

.toast {
    background-color: var(--bg-card);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 14px 20px;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn var(--transition-fast) forwards;
}

.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* Animações */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================================================
   Motor de Etiquetas & Impressão (@media print)
   ========================================================================== */

/* Estilos de tela padrão para a tag print-only */
.print-only {
    display: none;
}

@media print {
    /* Oculta tudo que pertence ao app principal */
    body, html, .app-container, .modal-overlay, .toast-container, .topbar, .sidebar {
        display: none !important;
        height: auto;
        overflow: visible;
    }

    /* Revela a seção de impressão invisível */
    .print-only {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background-color: #fff !important;
        color: #000 !important;
        font-family: 'Inter', sans-serif;
    }

    /* Formatação da Etiqueta Térmica */
    .thermal-label {
        width: 80mm; /* Adaptável para bobina de 80mm */
        padding: 10mm 5mm;
        box-sizing: border-box;
        text-align: center;
        page-break-after: always;
        font-size: 14pt;
        line-height: 1.4;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border: 1px dashed #000;
        margin: 5mm auto;
    }

    .thermal-label .label-title {
        font-size: 16pt;
        font-weight: 800;
        text-transform: uppercase;
        margin-bottom: 4mm;
        border-bottom: 2px solid #000;
        padding-bottom: 2mm;
        width: 100%;
    }

    .thermal-label .label-field {
        margin: 2mm 0;
        font-size: 13pt;
    }

    .thermal-label .label-field strong {
        font-weight: 700;
    }

    .thermal-label .label-size {
        margin-top: 4mm;
        font-size: 20pt;
        font-weight: 800;
        border: 2px solid #000;
        padding: 2mm 8mm;
        display: inline-block;
    }
}

/* ==========================================================================
   Responsividade (Mobile e Tablet)
   ========================================================================== */

/* Botão de Toggle da Sidebar */
.btn-toggle-sidebar {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.btn-toggle-sidebar:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Overlay para Mobile/Tablet */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 8, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        width: 260px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .btn-toggle-sidebar {
        display: inline-flex;
    }
    
    .topbar {
        padding: 16px 20px;
    }
    
    .workspace {
        padding: 20px;
    }
    
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .project-info-banner {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .component-profile-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .details-row {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .form-measures-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }
    
    .measures-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .modal-content {
        padding: 20px !important;
        width: 95% !important;
        max-height: 90vh !important;
    }
    
    .profile-data-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 576px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding-bottom: 16px;
    }
    
    .topbar .user-menu {
        width: 100%;
        justify-content: space-between;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .section-header .section-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   Mini Calculadora e Inputs Monetários
   ========================================================================== */

.monetary-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.monetary-input-wrapper .form-control {
    flex: 1;
}

.btn-open-calc {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--primary);
    font-size: 16px;
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    width: 44px;
}

.btn-open-calc:hover {
    border-color: var(--primary);
    background-color: rgba(212, 175, 55, 0.08);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

/* Modal da Mini Calculadora */
.calc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(5, 5, 8, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 250; /* z-index superior ao modal de custos */
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.calc-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.calc-card {
    background-color: var(--bg-surface);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: var(--radius-lg);
    width: 290px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.calc-modal-overlay.active .calc-card {
    transform: scale(1);
}

.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calc-header h4 {
    font-family: var(--font-outfit);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc-close {
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.calc-close:hover {
    color: var(--primary);
}

.calc-display-container {
    width: 100%;
}

#calc-display {
    width: 100%;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    color: var(--primary);
    font-family: monospace;
    font-size: 20px;
    font-weight: 700;
    text-align: right;
    outline: none;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.calc-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn-calc {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    padding: 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-calc:hover {
    border-color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.03);
}

.btn-calc-op {
    color: var(--primary);
    border-color: rgba(212, 175, 55, 0.2);
}

.btn-calc-op:hover {
    border-color: var(--primary);
    background-color: rgba(212, 175, 55, 0.08);
}

.btn-calc-clear {
    color: var(--danger);
    border-color: rgba(166, 30, 45, 0.2);
}

.btn-calc-clear:hover {
    border-color: var(--danger);
    background-color: rgba(166, 30, 45, 0.08);
}

.btn-calc-equal {
    grid-column: span 1;
    background-color: var(--primary);
    color: #080A0F;
    border-color: var(--primary);
}

.btn-calc-equal:hover {
    background-color: #E5C04A;
    border-color: #E5C04A;
}

.btn-calc-zero {
    grid-column: span 2;
}

.calc-close {
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.calc-close:hover {
    color: var(--primary);
}

.calc-display-container {
    width: 100%;
}

#calc-display {
    width: 100%;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    color: var(--primary);
    font-family: monospace;
    font-size: 20px;
    font-weight: 700;
    text-align: right;
    outline: none;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.calc-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn-calc {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    padding: 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-calc:hover {
    border-color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.03);
}

.btn-calc-op {
    color: var(--primary);
    border-color: rgba(212, 175, 55, 0.2);
}

.btn-calc-op:hover {
    border-color: var(--primary);
    background-color: rgba(212, 175, 55, 0.08);
}

.btn-calc-clear {
    color: var(--danger);
    border-color: rgba(166, 30, 45, 0.2);
}

.btn-calc-clear:hover {
    border-color: var(--danger);
    background-color: rgba(166, 30, 45, 0.08);
}

.btn-calc-equal {
    grid-column: span 1;
    background-color: var(--primary);
    color: #080A0F;
    border-color: var(--primary);
}

.btn-calc-equal:hover {
    background-color: #E5C04A;
    border-color: #E5C04A;
}

.btn-calc-zero {
    grid-column: span 2;
}

.calc-footer {
    margin-top: 8px;
}

.calc-footer .btn {
    width: 100%;
    padding: 12px;
}
