/* Sistema de Emissão de NFSE - Rio de Janeiro */
/* CSS Moderno e Responsivo - Baseado no estilo do sistema financeiro */

:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fc;
    --dark-color: #343a40;
    --white: #ffffff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #e9ecef;
    background-image: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 0;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

nav {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

nav a.active {
    background-color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

/* Main Content */
main {
    background: white;
    border-radius: 10px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: box-shadow 0.3s;
}

main:hover {
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.2);
}

h2 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 700;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

h3 {
    color: var(--dark-color);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    border: none;
}

.alert-success {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--success-color);
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger-color);
}

.alert ul {
    margin: 0;
    padding-left: 1.5rem;
}

/* Forms */
.form-container {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    border: 1px solid #e3e6f0;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #d1d3e2;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-group small {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.info-box {
    background: var(--light-color);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #d1d3e2;
    color: var(--dark-color);
}

/* Serviços */
.servico-item {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e3e6f0;
}

.servico-item select,
.servico-item input {
    margin: 0;
}

/* Resumo de Totais */
.resumo-totais {
    background: var(--light-color);
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid #e3e6f0;
    margin: 1rem 0;
}

.resumo-totais h3 {
    margin: 0 0 1rem 0;
    color: var(--dark-color);
    border: none;
}

.resumo-totais div {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.resumo-totais .total {
    font-weight: bold;
    font-size: 1.3rem;
    color: var(--primary-color);
    border-top: 2px solid #e3e6f0;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #004085);
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1rem rgba(0, 123, 255, 0.25);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1rem rgba(108, 117, 125, 0.25);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1rem rgba(220, 53, 69, 0.25);
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1rem rgba(23, 162, 184, 0.25);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 2rem;
    border-radius: 10px;
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 1px solid #e3e6f0;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 1rem;
    text-align: left;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #e3e6f0;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.3s;
}

.table tbody tr:hover {
    background-color: var(--light-color);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Status */
.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-rascunho {
    background-color: #fff3cd;
    color: #856404;
}

.status-emitida {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-cancelada {
    background-color: #f8d7da;
    color: #721c24;
}

/* Dashboard Styles */
.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 10px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.welcome-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border: none;
    color: white;
}

.welcome-section p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: none;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.stat-content h3 {
    font-size: 2rem;
    color: var(--dark-color);
    margin: 0;
    border: none;
    font-weight: 700;
}

.stat-content p {
    color: var(--secondary-color);
    margin: 0.5rem 0 0 0;
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    border: none;
}

.dashboard-card h3 {
    margin: 0 0 1.5rem 0;
    color: var(--dark-color);
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
}

.no-data {
    color: var(--secondary-color);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.nfse-list {
    margin-bottom: 1.5rem;
}

.nfse-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e3e6f0;
    transition: background-color 0.3s ease;
}

.nfse-item:hover {
    background-color: var(--light-color);
}

.nfse-item:last-child {
    border-bottom: none;
}

.nfse-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nfse-info strong {
    color: var(--dark-color);
    font-size: 1.1rem;
}

.nfse-cliente {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.nfse-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.nfse-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.nfse-value {
    color: var(--success-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.card-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e3e6f0;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quick-action:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.action-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.action-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.action-text strong {
    color: var(--dark-color);
    font-size: 1.1rem;
}

.action-text span {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.info-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    margin-bottom: 2rem;
    border: none;
}

.info-section h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark-color);
    border: none;
    font-size: 1.8rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 1.5rem;
    border-radius: 10px;
    background: var(--light-color);
    transition: all 0.3s ease;
    border: 1px solid #e3e6f0;
}

.feature:hover {
    transform: translateY(-5px);
    background: white;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.feature h4 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.feature p {
    color: var(--secondary-color);
    line-height: 1.6;
}

footer {
    text-align: center;
    padding: 2rem;
    background: var(--dark-color);
    color: white;
    border-radius: 10px;
    margin-top: 2rem;
}

footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .servico-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .nfse-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .nfse-details {
        align-items: flex-start;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .servico-item .btn {
        width: auto;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Print Styles */
@media print {
    header, nav, .btn {
        display: none;
    }
    
    main {
        box-shadow: none;
        padding: 0;
    }
    
    .table {
        box-shadow: none;
    }
}

/* Table Responsive */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

/* Dialog/Modal styles para edição */
dialog {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    padding: 0;
    max-width: 800px;
    width: 90%;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}
