/**
 * Estilos do Sistema de Gestão Cobs
 * Versão: 1.0
 */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2196F3;
    --secondary-color: #4CAF50;
    --danger-color: #f44336;
    --warning-color: #FF9800;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --border-color: #ddd;
    --text-color: #333;
    --white: #fff;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 15px rgba(0,0,0,0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), #1976D2);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

header nav a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
}

header nav a:hover,
header nav a.active {
    background: rgba(255,255,255,0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info .saldo-header {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), #1976D2);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
}

.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tabs input[type="radio"] {
    display: none;
}

.tabs label {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.tabs input[type="radio"]:checked + label {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    font-weight: bold;
}

.login-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 5px;
    font-size: 0.85rem;
    color: #666;
}

.login-info p {
    margin-bottom: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #1976D2;
}

.btn-secondary {
    background: #6c757d;
    color: var(--white);
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-success:hover {
    background: #45a049;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #da190b;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #e68900;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.card h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.card-destaque {
    background: linear-gradient(135deg, var(--secondary-color), #45a049);
    color: var(--white);
    text-align: center;
}

.card-destaque h3 {
    color: var(--white);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Dashboard */
.dashboard-header {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.dashboard-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.saldo-valor {
    font-size: 3rem;
    font-weight: bold;
    margin: 1rem 0;
}

.saldo-label {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* Listas */
.lista-simples {
    margin-bottom: 1rem;
}

.item-lista {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.item-lista:last-child {
    border-bottom: none;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-titulo {
    font-weight: 600;
    color: var(--dark-color);
}

.item-descricao {
    color: #666;
    font-size: 0.9rem;
}

.item-valores {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.item-data {
    font-size: 0.85rem;
    color: #999;
}

.valor-positivo {
    color: var(--secondary-color);
    font-weight: bold;
}

.valor-negativo {
    color: var(--danger-color);
    font-weight: bold;
}

.valor-cobs {
    font-weight: 600;
    color: var(--primary-color);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-credito {
    background: #e8f5e9;
    color: var(--secondary-color);
}

.badge-debito,
.badge-reserva {
    background: #ffebee;
    color: var(--danger-color);
}

.badge-estorno {
    background: #fff3e0;
    color: var(--warning-color);
}

.badge-recebido {
    background: #e3f2fd;
    color: var(--primary-color);
}

.badge-em-separacao,
.badge-em-separação {
    background: #fff3e0;
    color: var(--warning-color);
}

.badge-entregue {
    background: #e8f5e9;
    color: var(--secondary-color);
}

.badge-cancelado {
    background: #ffebee;
    color: var(--danger-color);
}

.badge-ativo {
    background: #e8f5e9;
    color: var(--secondary-color);
}

.badge-desligado,
.badge-afastado,
.badge-aposentado {
    background: #f5f5f5;
    color: #666;
}

/* Tabelas */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

table thead {
    background: var(--light-color);
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    font-weight: 600;
    color: var(--dark-color);
}

table tbody tr:hover {
    background: #f9f9f9;
}

table .acoes {
    display: flex;
    gap: 0.5rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #e8f5e9;
    color: var(--secondary-color);
    border-left: 4px solid var(--secondary-color);
}

.alert-error {
    background: #ffebee;
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fff3e0;
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #e3f2fd;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

/* Produtos Loja */
.produtos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.produto-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.produto-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.produto-imagem {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--light-color);
}

.produto-info {
    padding: 1.5rem;
}

.produto-titulo {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.produto-descricao {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.produto-preco {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.produto-estoque {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: 10px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    color: var(--primary-color);
}

.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
}

.modal-close:hover {
    color: var(--danger-color);
}

/* Info Cards */
.info-card {
    background: #e3f2fd;
    border-left: 4px solid var(--primary-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.info-item {
    padding: 1rem;
    background: var(--white);
    border-radius: 5px;
}

.info-item strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.info-item p {
    color: #666;
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.empty-state::before {
    content: "📭";
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Filtros */
.filtros {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Estatísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-valor {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Paginação */
.paginacao {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.paginacao a,
.paginacao span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-color);
}

.paginacao a:hover {
    background: var(--light-color);
}

.paginacao .active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Footer */
footer {
    background: var(--dark-color);
    color: var(--white);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
}

/* Upload de Imagem */
.image-upload {
    position: relative;
    width: 200px;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    background: var(--light-color);
}

.image-upload:hover {
    border-color: var(--primary-color);
}

.image-upload input[type="file"] {
    display: none;
}

.image-upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.image-upload-icon {
    font-size: 3rem;
    color: #999;
    margin-bottom: 0.5rem;
}

/* Responsividade */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    header nav ul {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    header nav a {
        display: block;
        text-align: center;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .produtos-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filtros-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    table th,
    table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Container de Erro */
.container-erro {
    text-align: center;
    padding: 3rem;
}

.container-erro h1 {
    font-size: 5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.container-erro h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Confirmação */
.confirm-box {
    background: #fff3e0;
    border-left: 4px solid var(--warning-color);
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.confirm-box h3 {
    color: var(--warning-color);
    margin-bottom: 1rem;
}

.confirm-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    white-space: nowrap;
    font-size: 0.85rem;
    z-index: 100;
}

/* Print Styles */
@media print {
    header,
    footer,
    .btn,
    .filtros {
        display: none;
    }
    
    body {
        background: var(--white);
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }