/* ========================================== */
/* ARQUIVO: style.css - Estilos do Sistema TR */
/* VERSÃO REVISADA COM CORES ALINHADAS        */
/* ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #ff6b35 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* ========== HEADER ========== */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.header .logo {
    margin-bottom: 15px;
}

.header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    opacity: 0.9;
    font-size: 16px;
}

.admin-header {
    background: linear-gradient(135deg, #c31432 0%, #240b36 100%);
}

/* ========== NAVIGATION ========== */
.nav {
    background: #f8f9fa;
    padding: 15px 30px;
    border-bottom: 2px solid #dee2e6;
}

.nav-link {
    color: #1e3c72;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.nav-link:hover {
    color: #ff6b35;
}

/* ========== CONTENT ========== */
.content {
    padding: 30px;
}

/* ========== SEARCH SECTION ========== */
.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #1e3c72;
}

/* ========== STATISTICS ========== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: #1e3c72;
    color: white;
}

.btn-primary:hover {
    background: #152d5a;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-warning {
    background: #ff6b35;
    color: white;
}

.btn-warning:hover {
    background: #e55a28;
}

.icon-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

/* ========== FORMS ========== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1e3c72;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    justify-content: flex-end;
}

/* ========== TABLE ========== */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table .loading,
.table .no-data {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.action-btns {
    display: flex;
    gap: 5px;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ========== PREVIEW TR ========== */
.tr-preview {
    border: 3px solid #1e3c72;
    border-radius: 15px;
    padding: 40px;
    background: white;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.tr-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #ff6b35 100%);
    border-radius: 12px 12px 0 0;
}

.tr-preview-header {
    position: relative;
    z-index: 1;
    color: white;
    text-align: center;
    margin-bottom: 50px;
    padding-top: 20px;
}

.tr-preview-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.tr-preview-code {
    font-size: 16px;
    opacity: 0.9;
}

.tr-preview-body {
    line-height: 2;
    color: #333;
    text-align: justify;
}

.tr-preview-body p {
    margin-bottom: 20px;
}

.tr-preview-body strong {
    color: #1e3c72;
}

.tr-preview-observation {
    background: #fff3cd;
    border-left: 4px solid #ff6b35;
    padding: 15px;
    margin: 20px 0;
}

.tr-preview-signature {
    margin-top: 40px;
    text-align: center;
    border-top: 2px solid #dee2e6;
    padding-top: 20px;
}

.signature-line {
    width: 300px;
    margin: 30px auto;
    border-top: 2px solid #000;
    padding-top: 10px;
}

/* ========== FOOTER ========== */
.footer {
    background: #f8f9fa;
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid #dee2e6;
}

.footer p {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-links a {
    color: #1e3c72;
    text-decoration: none;
    margin: 0 10px;
    font-weight: 600;
}

.footer-links a:hover {
    color: #ff6b35;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 10px 5px;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
    }
    
    .header,
    .nav,
    .search-section,
    .footer,
    .btn,
    .action-btns {
        display: none !important;
    }
    
    .tr-preview {
        border: 2px solid #000;
        page-break-inside: avoid;
    }
}